Knowledge Base Deep-Dive
Knowledge Base Deep-Dive
What you build: a reusable retrieval layer. This page treats the Knowledge Base as a primitive in its own right — how ingestion works, how to poll it, how retrieval is tuned, and how to run pure RAG queries from your own code (no voice or messaging turn involved). If you just want a KB attached to a support agent, start at Inbound support + KB; come here to understand the machinery.
Who it’s for: developers building BYOM agents that do their own retrieval, teams debugging “why didn’t the agent use my doc,” and anyone who wants a hosted vector-search endpoint over their content.
The two ways to use a KB
Step 1 — Create a KB
Step 2 — Add documents
Two source types. Files (pdf/docx/txt) use a three-step flow; URLs ingest immediately.
File upload (register → PUT → finalize)
URL source (one step)
File uploads need object storage configured on the deployment; if it isn’t, document creation returns 503. URL sources don’t. Image-only PDFs (no text layer) can’t be extracted and end up failed.
Step 3 — Poll to ready
Ingestion is async. Only ready documents are searched:
Step 4 — Query it (RAG without a call)
This is the standalone superpower — vector search over your content from any code path:
top_k— 1–10, default 5.score— cosine similarity (0–1, higher = more relevant).- Below-threshold chunks are dropped, so a query with no good match returns
count: 0and200(not404). queryis capped at 4096 characters.
Using it in a BYOM turn
How retrieval works (and why it sometimes returns nothing)
- The query (or caller message) is embedded as a vector.
- Cosine-distance search over the KB’s
readychunks (HNSW index) finds the closest. - Top
top_kreturned best-first, after dropping anything below the relevance threshold. - Hosted agents: chunks are prepended to the system prompt. BYOM: you assemble the prompt.
For hosted agents, retrieval is fail-soft — if it errors or exceeds a 1-second budget, the agent still answers, just without KB context for that turn. The relevance gate is deliberate: injecting weakly-related passages causes more hallucination, so “no good match → no context” is the correct behaviour, not a bug.
Results are cached per (workspace, KB, query) and invalidated whenever you add, delete, or change a document — updates appear immediately.
Manage KBs and documents
Limits
Dashboard & MCP
- Dashboard → Knowledge section: create, drag-drop docs, watch ingestion live.
- MCP → the MCP server exposes seven KB tools (
create_knowledge_base,list_knowledge_bases,upload_knowledge_document,complete_knowledge_document,get_document_status,query_knowledge_base,attach_knowledge_base).
Next steps
- Ground a live phone agent in this KB → Inbound support + KB.
- Do your own retrieval in a custom model → BYOM.