Voice Agent Knowledge Base

Answer from your own content, not just the base model

Agents is in beta. Shapes on /v1/agents/* may change before general availability.

A knowledge base lets an agent answer from your own content instead of relying on the base model alone. You create a knowledge base, add documents, and attach it to an agent, which then retrieves relevant passages during a call.

1

Set your API key

$export SPEECHIFY_API_KEY="your-api-key-here"
2

Create a knowledge base

POST
/v1/agents/knowledge-bases
1curl -X POST https://api.speechify.ai/v1/agents/knowledge-bases \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "name": "Example name",
6 "description": "Example description."
7}'

Keep the knowledge base id from the response.

3

Add your content

Add documents to the knowledge base from the console or the API. See Upload documents and Import from a URL for the full ingestion options.

4

Check retrieval

Search the knowledge base to confirm it returns the passages you expect:

POST
/v1/agents/knowledge-bases/search
1curl -X POST https://api.speechify.ai/v1/agents/knowledge-bases/search \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "query": "example",
6 "kb_ids": [
7 "kb_01jqr8x9zg5k2m3n4p5q6r7s8t"
8 ],
9 "limit": 50
10}'

How the agent uses it

Once a knowledge base is attached to an agent, the agent retrieves relevant passages during a conversation and grounds its answer in them. That keeps replies aligned with your own documentation rather than the model’s general knowledge. See Knowledge base concepts for how attachment and retrieval work.

Next steps