Attaching a knowledge base is one field. Getting an agent to use it well on a live call is a prompting problem, and that is most of this page.

Attaching one

config.kb_ids is a list of knowledge base ids. Only a ready one can be attached — anything still building, or in error, is refused at save.
Writes replace the whole config, so read it, add the field and send it back — see agent overview. Attaching one that is not ready fails validation with the status named:
An id that does not exist reads knowledge base 3d1f5a70-… not found. Both are errors, so they block a publish. See validation. Knowledge works the same on voice, video and text. Agent tasks do not take knowledge bases — a task is one bounded run and reaches what it needs through its tools. kb_ids is frozen into a published version like the rest of the config, but a knowledge base is not versioned. The agent reads whatever the base contains at call time, so rebuilding it changes what live callers hear without a publish. Attaching a different base still takes a publish.

What the agent gets

Two things, both added at compile time: The knowledge map, appended to the system prompt. Every entry as one line — a short id, a title, a summary — indented to show the tree, preceded by the knowledge base’s name and its overview paragraph. No content. It is the same string on every turn of every call, so it lands in the model’s prompt cache after the first turn. Read the exact block with GET /v1/knowledge/{kb_id}/prompt — see editing. The map is appended after your prompt and after {{userdata.*}} substitution, so a stray {{...}} in crawled content is never mistaken for a template. A knowledge_fetch tool. The model calls it with the short ids from the map and gets the verbatim page text back.
knowledge_fetch is a reserved tool name. So are stop_recording and submit_result. A tool of yours cannot use it, in this workspace or any agent in it. See tool schema and description.
The tool is scoped to the ids in this agent’s map. An agent cannot read a node from a knowledge base it does not have attached. If every attached knowledge base is empty of entries, neither the map nor the tool is added at all — the agent runs as though nothing were attached.

How a fetch behaves

The 24,000-character cap is on the whole call, not per entry, so asking for six large entries at once gets less of each than asking for one. Truncation is always marked, never silent: the model is told it is reasoning from a partial document so it can fetch again more narrowly. The category behaviour is what makes the tree useful. A model that fetches a section heading is handed the section’s contents and can go a level deeper, which is cheaper than putting every leaf’s summary in front of it at once.

The directive the platform adds

Above the map, the platform appends a fixed instruction. You do not write it and cannot change it:
That covers the mechanics — consult the map, fetch, ground the answer, refuse rather than invent. What it cannot know is your business: which questions relate to the knowledge base, what to do when the answer is not in it, and how to behave on a call while a fetch is in flight. That is your prompt’s job.

Prompting for knowledge

This is what decides whether the feature works on a real call. Say what the knowledge base covers, in the agent’s own words. The model reads the map, but a sentence in the prompt is what makes it reach for the map in the first place. “You have a knowledge base covering returns, delivery, warranty and trade accounts” turns a vague question into a lookup. Say when to consult it, and be concrete about when not to. The failure mode is not an agent that never looks things up; it is an agent that looks things up for everything, including “hello”, and pauses for two seconds each time. Have the agent say something before it fetches. On a voice call a tool call is silence, and silence on a phone line reads as a dropped connection. One short line — “Let me check that for you” — covers it. Text agents do not need this. Say what to do when the answer is not there. The platform directive tells the model to say it does not have the information. Your prompt should say what happens next: transfer to a person, take a message, offer to email. An agent that stops at “I don’t have that” is a worse call than one that says “I don’t have that — let me put you through to someone who does.” Do not paste the same facts into the prompt as well. Two copies of a policy disagree the day one of them is updated, and the model has no way to know which is current. Do not use it for anything that must be exact. A price, stock, an order status, a booking slot — that is a tool calling your API. A knowledge base is a snapshot of a website.

Worked example

An inbound support agent with a knowledge base for policy and a tool for the caller’s own data. The prompt:
And the config it goes on, as a body you can POST to /v1/agents:
The split is the point. Policy comes from the knowledge base; the caller’s own data comes from a tool. The prompt says which is which, so the model does not go looking for an order number in a help centre article, and does not answer a returns question from memory because it thinks a tool will cover it. Four sentences in that prompt are doing the work: what the knowledge covers, when to consult it, what to say before the pause, and what to do when the answer is not there. Drop any one and the agent gets noticeably worse on a live call.

What multiple knowledge bases cost

You can attach several. They are rendered one after another, each with its own heading and overview, and the short ids run continuously across all of them — k1 through k7 in the first, k8 onwards in the second. The model does not need to know which base an id came from. The cost is context. Every entry of every attached base is in the system prompt on every turn of every call, on your own provider key. chars on GET /v1/knowledge/{kb_id}/prompt is the exact size of one; add them up before attaching a fourth. The second cost is attention. Retrieval here is a model choosing from a list, and a longer list of similar-sounding entries is a harder choice. Two knowledge bases covering distinct subjects are fine. Three that overlap will produce worse fetches than one well-organized base would. If you find yourself attaching several because each one is too broad, the fix is usually to split the agent rather than the knowledge — a triage agent that hands off to specialists, each with the one base it needs. See agent teams.

Next

Prompting

The rest of writing a system prompt, including what does not belong in one.

Fixing a knowledge base

When the agent will not fetch what you expected, this is where you find out why.