Knowledge base
Give agents your documents (price lists, FAQs, policies) to answer from.
Agents can answer callers' questions from your own documents. Upload a file, wait for it to be
indexed, then attach it to an agent. Requires agents:write to upload or delete, and
agents:read to list.
Upload a document
curl -X POST https://api.resonera.ai/kb/items \
-H "X-API-Key: $RESONERA_KEY" \
-F "file=@Price list.pdf" \
-F "folder=docs/prices"{
"item": { "id": "6282b371-da50-4129-9115-6403b8918e1a", "name": "Price list.pdf", "type": "file", "path": "docs/prices/Price list.pdf", "size_bytes": 184233 },
"job_id": "a68caab0-a29e-47a1-a563-370928f8d03d"
}- Formats: PDF (scanned PDFs are read with OCR), DOCX, XLSX, XLS, CSV, TXT, MD and RST, up to 50 MB.
- Folders are optional and created as needed. They're shown in the dashboard's Knowledge Base page, where files uploaded through the API appear alongside everything else.
- Uploading the same name to the same folder replaces the file, keeping its
id, so agents that use it pick up the new version automatically. This is the way to update a price list.
Wait for indexing
Indexing splits the document into passages the agent can search. It usually takes seconds:
curl https://api.resonera.ai/kb/index/status/$JOB_ID -H "X-API-Key: $RESONERA_KEY"{ "status": "completed", "chunks_indexed": 42, "error": null }status goes queued → processing → completed, or failed with an error, for example when
a file has no readable text.
Attach it to an agent
Add the item's id to the agent's kb_item_ids. An agent with documents attached always has
its knowledge-base search available, whatever its tools list says.
curl -X PATCH https://api.resonera.ai/agents/$AGENT_ID \
-H "X-API-Key: $RESONERA_KEY" -H "Content-Type: application/json" \
-d '{"kb_item_ids": ["6282b371-da50-4129-9115-6403b8918e1a"]}'kb_item_ids replaces the whole list, so include any documents the agent already has. A
campaign can also override the agent's documents with its own kb_item_ids.
List and delete
GET /kb/items?folder=docs/priceslists a folder; leavefolderout for the top level.DELETE /kb/items/{kb_item_id}deletes a file, or a folder with everything in it. Agents that referenced a deleted file simply stop using it.
Tips for good answers
- Put facts the agent must get right, such as prices, timings and policies, in the knowledge base rather than the prompt. The agent looks them up when asked instead of guessing.
- Clear headings and one topic per section index better than long unstructured pages.
- Spreadsheets work well for price lists: one row per item, with a header row.