Knowledge Base
A Knowledge Base (KB) lets your agents answer from your own content — product docs, policies, FAQs, price lists — instead of only what the model already knows. You upload documents, Voicebip splits them into chunks, embeds each chunk as a vector, and at answer time retrieves the most relevant passages and feeds them to the model. This is retrieval-augmented generation (RAG).
There are two ways to use a KB:
- Hosted-AI agents — attach a KB to the agent (
knowledge_base_id) and retrieval happens automatically on every voice and messaging turn. No code on your side. - BYOM agents — call the query endpoint yourself, get back the relevant chunks, and inject them into your own LLM prompt.
Create a Knowledge Base
Response:
document_count and chunk_count are recomputed as documents are ingested and deleted.
Add documents
A KB is only useful once it has documents. There are two source types:
- File uploads (
pdf,docx,txt) — a two-step flow: register the document, upload the bytes, then finalize. - URLs (
url) — Voicebip fetches the page and extracts its text; ingestion starts immediately.
Supported formats: PDF, DOCX, TXT, and URL. Max file size is 50 MiB. (PDFs need a real text layer — image-only scans without OCR won’t extract.)
Upload a file (two-step)
Step 1 — register the document. You get back a short-lived presigned upload_url (valid ~10 minutes):
Step 2 — PUT the bytes to upload_url with a Content-Type matching the source type:
Step 3 — finalize. This verifies the upload landed and kicks off processing (chunk → embed → index):
The document status moves to processing. Finalize is idempotent — re-calling it on an already-ready document does nothing (no duplicate embedding charges). If you register a document but never finalize it, an automatic reaper cleans up the abandoned upload.
File uploads require object storage to be configured on the deployment. If it isn’t, document creation returns 503. URL sources don’t need storage.
Add a URL
For a URL, pass source_type: "url" and source_url. There’s no upload step — ingestion begins right away:
Track ingestion status
Processing is asynchronous. Poll the document until it’s ready:
status moves through:
Only ready documents are searched. A document with no extractable text (e.g. an image-only PDF) ends up failed.
Use with a hosted-AI agent
Attach the KB to the agent and retrieval is automatic — nothing else to build:
On every voice and messaging turn, Voicebip embeds the caller’s message, retrieves the most relevant chunks from the attached KB, and prepends them to the agent’s system_prompt before calling the model. Many agents can share one KB. Send an empty string ("") to detach.
Retrieval is fail-soft: if it errors or times out (1 second budget), the agent still answers — just without KB context for that turn. A relevance gate also applies: if nothing in the KB is similar enough to the question, no context is injected (low-relevance passages cause more hallucination than they prevent).
Query a knowledge base (BYOM)
BYOM agents run their own model, so retrieval isn’t automatic. Call the query endpoint to get the relevant chunks, then inject them into your prompt yourself:
top_k(1–10, default 5) caps how many chunks come back.scoreis cosine similarity (0–1, higher is more relevant). Chunks below the relevance threshold are filtered out, so a query with no good match returnscount: 0and an empty list (HTTP200, not404).queryis capped at 4096 characters.
A typical BYOM turn: call /query with the caller’s message, take the returned content blocks, and prepend them to the prompt you send your LLM (e.g. “Use the following context to answer: …”).
Manage knowledge bases and documents
Deleting a KB detaches it from any agents that referenced it (those agents fall back to no KB). Deletes return 204 No Content.
How retrieval works
- The caller’s message (hosted) or your
query(BYOM) is embedded as a vector. - A vector similarity search (cosine distance, HNSW index) finds the closest chunks across the KB’s
readydocuments. - The top
top_kchunks are returned best-first, after dropping anything below the relevance threshold. - For hosted agents, those chunks are formatted and prepended to the system prompt; for BYOM you do the prompt assembly.
Results are briefly cached per (workspace, KB, query) and the cache is invalidated whenever you add, delete, or change a document — so updates show up right away.
Limits
Dashboard & MCP
- Dashboard — manage knowledge bases under the Knowledge section: create a KB, drag-and-drop documents, and watch ingestion status update live.
- MCP — the MCP server exposes KB tools (
create_knowledge_base,list_knowledge_bases,upload_knowledge_document,complete_knowledge_document,get_document_status,query_knowledge_base,attach_knowledge_base) so AI coding agents can build and query knowledge bases directly.