How it works
When a caller asks a question, the agent runs a semantic search across every source in the connected knowledge bases. It retrieves the most relevant passages and incorporates them into its response in real time — without any scripted branching or manual lookup logic on your part. This means your agent can accurately answer questions about your pricing, product catalogue, return policy, or support runbook without you having to anticipate every possible question in advance.When to use a knowledge base
Good fits for a KB
- Product documentation and FAQs
- Pricing sheets and feature comparisons
- Support runbooks and troubleshooting guides
- Policy documents (refunds, shipping, compliance)
- Onboarding materials and how-to guides
Better suited to the system prompt
- Agent persona and tone of voice
- Call flow instructions (“always confirm the caller’s name”)
- Business rules (“never quote pricing without checking availability”)
- Escalation conditions
- Tool-use instructions
KB vs system prompt
The system prompt contains static instructions that shape how your agent behaves. It is always present, never searched. The knowledge base contains dynamic, searchable content that the agent pulls from on demand. It does not affect agent behaviour directly — it supplies facts.A good rule of thumb: put how to behave in the prompt, put what to know in the knowledge base.
Source types
Each knowledge base is made up of one or more sources. Truedy supports two source types:| Kind | Description |
|---|---|
document | A PDF, DOCX, TXT, or Markdown file you upload (max 50 MB, base64-encoded) |
web | One or more publicly accessible URLs that Truedy crawls and indexes |
Source status lifecycle
After you add a source, Truedy processes it asynchronously. Thestatus field on a source follows this lifecycle:
ready state. Poll GET /knowledge-bases/{id}/sources to check when processing is complete.
Connecting multiple knowledge bases
A single agent can be connected to multiple knowledge bases. All connected KBs are searched together at call time — the agent sees one unified search space across all of them. This lets you modularise your content: a general FAQ KB, a product-specific KB, and a region-specific pricing KB can all coexist and be mixed across different agents as needed.End-to-end example
The following walkthrough creates a knowledge base, adds two sources, and attaches it to an agent.Step 1 — Create the knowledge base
Step 2 — Add a document source
Upload a file as base64-encoded content. Here we encode a plain text file. The same pattern works for PDF, DOCX, or Markdown.Step 3 — Add a web source
Provide one or more URLs. Truedy crawls them and indexes the text content.Both source types move through
pending → processing → ready asynchronously. Wait for status: "ready" before testing the agent. max_depth: 0 indexes only the given URLs; max_depth: 1 also follows one level of links from each page.Step 4 — Attach the knowledge base to an agent
Pass the knowledge base ID in theknowledge_bases array when creating or updating your agent.
Next steps
Managing KB Sources
Add, update, and remove sources — including file uploads and URL re-crawls.

