Agents
Knowledge base
A knowledge base holds your own reference material (PDFs, text files, web pages, and plain text) so an agent can look up facts about your business during a call—such as prices, hours, and policies—and answer accurately instead of guessing.
How it works
- Create and populate: You create a knowledge base and add sources to it. Each source is automatically processed: text is extracted, split into passages with boundary overlap so context is preserved, and indexed for semantic search.
- Attach to agents: Attach the knowledge base to one or more agents in the agent’s LLM tab or via
knowledge_base_ids. - During a call: The agent uses the built-in
search_knowledge_basetool. When callers ask factual questions, the agent queries the knowledge base and retrieves the most relevant passages (up to five) along with source titles. - Answer grounded in fact: The agent formulates its answer using those passages. If no matching information exists, the tool indicates this so the agent can politely inform the caller rather than inventing facts.
Searches are semantic: phrasing such as “kya aap Sunday ko khule ho?” matches a document stating “closed on Sundays” even without direct keyword overlap.
Each search is recorded on the call timeline as a kb.search event.
Sources and limits
| Source | Details | Limits |
|---|---|---|
| PDF file | Text extracted from every page. Password-protected files or scanned images without readable text are not supported. | 5 MB and 100 pages per file |
Text file (.txt, .md) | UTF-8 plain text or Markdown. | 10 MB per file |
| Pasted text | Plain text with a custom title. | 500,000 characters |
| Web page | Main article text extracted (navigation and boilerplate discarded). | 5 MB per page, public addresses only |
| Limit | Value |
|---|---|
| Knowledge bases per workspace | 20 |
| Sources per knowledge base | 50 |
| Passages per knowledge base | 3,000 (roughly 3 MB of text) |
| Knowledge bases per agent | 10 |
Web pages must be accessible on the public internet. Private network addresses (loopback, private IP ranges, cloud metadata endpoints) are rejected.
Source status
status | Meaning |
|---|---|
processing | Currently being extracted and indexed. |
ready | Searchable. chunk_count reflects the indexed passages. |
failed | Processing error. Check error for details. |
Using knowledge bases with an agent
Attach knowledge bases via the console or specify knowledge_base_ids on the agent configuration:
| Field | Type | Default | Description |
|---|---|---|---|
knowledge_base_ids | array of strings | [] | Up to 10 knowledge base IDs accessible to your workspace. |
knowledge_mode | string | "auto" | Reading strategy: "auto" or "search". |
PUT /api/v1/agents/{id} replaces the whole configuration, so fetch the agent, change knowledge_base_ids, and send it back:
curl -s https://api.vaakyo.com/api/v1/agents/$AGENT_ID -H "Authorization: Bearer $VAAKYO_API_KEY" \
| jq '.knowledge_base_ids = ["kb_5f2c..."]' > agent.json
curl -X PUT https://api.vaakyo.com/api/v1/agents/$AGENT_ID \
-H "Authorization: Bearer $VAAKYO_API_KEY" -H "Content-Type: application/json" \
-d @agent.json
Retrieval modes
- Inline context (
"auto", default): When attached knowledge bases contain under 30,000 characters total, the entire text is provided directly in the prompt at call startup. This ensures instant, complete access without a separate retrieval round-trip. - Search: For larger knowledge bases (or when
knowledge_modeis set to"search"), the agent callssearch_knowledge_baseduring the conversation to retrieve up to 5 relevant passages combining semantic search and keyword matching.
search_knowledge_base is a reserved tool name and cannot be used for custom agent tools.
Testing search
Test retrieval in the console: open the knowledge base and use Test a search to see which passages a question finds, with their scores.
API endpoints
All endpoints are available under /api/v1/knowledge-bases:
| Method and path | Description |
|---|---|
GET /knowledge-bases | List knowledge bases with usage statistics |
POST /knowledge-bases | Create a knowledge base ({"name", "description"}) |
GET /knowledge-bases/{id} | Retrieve knowledge base details and sources |
DELETE /knowledge-bases/{id} | Delete knowledge base (returns 409 if currently attached to active agents) |
POST /knowledge-bases/{id}/sources/file | Upload a PDF or text file |
POST /knowledge-bases/{id}/sources/url | Add a web page source |
POST /knowledge-bases/{id}/sources/text | Add plain text source |
DELETE /knowledge-bases/{id}/sources/{source_id} | Remove a source |
Renaming a knowledge base, processing a source again and testing a search are done in the console.