Add a knowledge source to an agent
add_agent_knowledgeAdd a knowledge source to an agent
Adds one knowledge source to a voice agent. The body is one of three shapes chosen by type: url reads one page and reads it again every syncInterval (weekly by default), text takes up to 200000 characters of text to store verbatim, crawl reads a whole website from its start page, up to maxDepth links deep and maxPages pages, and crawls it again every syncInterval. A crawl runs in the background with status pending; follow it with GET /agents/{agentId}/knowledge/crawl. title is optional and defaults to the URL, the host name for a crawl, or to "Text Knowledge" for a text entry. Files go through POST /agents/{agentId}/knowledge/files. The document is created in the voice engine and then attached to the agent, which from then on draws on it in calls. The entry is stored under the account that owns the agent, also when a reseller key adds it. When the document cannot be created or attached, the request still succeeds and the entry is stored with status failed; delete it and add it again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agentId": "<agentId>",
"body": "<body>"
},
"name": "add_agent_knowledge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | A page, a text or a website. Set `type` to `url` and send `url`, to `text` and send `text`, or to `crawl` and send the start page as `url`. | |
| agentId | Yes | Identifier of the voice agent. Accepted either as the public form `agent_12` or as the bare number `12`; the prefix is stripped before the lookup. |