Skip to main content
A knowledge base (KB) gives an agent a body of factual content to draw from — product specs, FAQs, policy documents, scraped support pages. When attached, the agent retrieves relevant chunks at every turn and includes them in the LLM context.

Attach a KB

1

Open Knowledge section

On the agent edit page, click the Knowledge section.
2

Click Attach knowledge base

Pick from your existing KBs. You can attach more than one.
3

Set retrieval parameters (optional)

Most agents work fine with defaults. See tuning below.
4

Save and republish

Changes only apply to new calls after the agent is republished.

How retrieval works

At each user turn:
  1. The agent’s STT produces a transcript of what the caller said.
  2. The platform embeds that turn (plus a small window of conversation context).
  3. It performs a vector similarity search across all attached KBs.
  4. The top top_n chunks (default 5) are inserted into the LLM context for that turn.
  5. The LLM generates a response that can quote or paraphrase the chunks.
The agent does this implicitly — you don’t have to tell the prompt to “use the knowledge base.”

Tuning retrieval

LeverDefaultWhen to change
top_n5Increase to 8-10 if answers are missing context. Decrease to 3 if the LLM keeps quoting irrelevant snippets.
Multiple KBsOneSplit into multiple KBs when the content covers very distinct domains (e.g. Product FAQ + Returns Policy) so retrieval is more focused.

When implicit retrieval isn’t enough

For most use cases, just attaching a KB is sufficient. Reach for explicit knowledge_base tools (see Tools) when:
  • You want the agent to announce that it’s looking something up
  • You want different KBs queried for different question types (“for product questions, query Product FAQ; for policy questions, query Policy KB”)
  • You want a higher top_n for some questions than the default

Anti-patterns

Putting too much in one KB. If your KB has 10,000 chunks covering five unrelated domains, retrieval will be noisy. Split it. Stale content. Embeddings are recomputed only when sources are added or updated. If your product changes, refresh the KB. Treating the KB as a memory store. KBs are for static reference content. For per-call state (the caller’s name, what they asked earlier), rely on the conversation context, not retrieval.

Pairing KBs with prompts

If you instruct the agent in the system prompt to “only answer from the knowledge base — don’t make things up”, you’ll get fewer hallucinations but more “I don’t know” responses. Conversely, telling it to “use the knowledge base when relevant, otherwise answer from general knowledge” makes it more flexible but also more prone to confident wrong answers. For most production agents, the safer instruction is:
When the caller asks a factual question, prefer the knowledge base. If you can’t find an answer in the knowledge base, say “I don’t have that information — let me get someone who does” and use the transfer tool.