Documentation

Knowledge Base API

Knowledge is stored on the agent itself and is available on every call. Paste text or upload a document and it is added immediately. There is no separate attach step. All endpoints require Authorization: Bearer YOUR_JWT. See the Knowledge Base guide.

List this agent's knowledge

Returns data.files. Each item has id, name, kind, and chars.

GET /api/agents/:agentId/knowledge_base
curl -X GET "https://bkechoplus.blutec.ai/api/agents/AGENT_ID/knowledge_base" \
  -H "Authorization: Bearer YOUR_JWT"

Add pasted text

Body: text (required) and optional name.

POST /api/agents/:agentId/knowledge_base/text
curl -X POST "https://bkechoplus.blutec.ai/api/agents/AGENT_ID/knowledge_base/text" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name":"Pricing FAQ","text":"Plans start at ₹999 a month."}'

Upload a document

Body: file_data (base64) and filename. Allowed types: DOCX, PPTX, XLSX, CSV, TXT, MD, HTML, up to 10MB. PDF is not accepted yet — save the file as DOCX or TXT first. The text is written into this agent immediately.

POST /api/agents/:agentId/knowledge_base/file
curl -X POST "https://bkechoplus.blutec.ai/api/agents/AGENT_ID/knowledge_base/file" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"file_data":"BASE64_ENCODED_FILE_CONTENT","filename":"faq.docx"}'

Remove an entry

Deletes one knowledge entry from this agent. Use the id from the list.

DELETE /api/agents/:agentId/knowledge_base/:kbId
curl -X DELETE "https://bkechoplus.blutec.ai/api/agents/AGENT_ID/knowledge_base/KB_ID" \
  -H "Authorization: Bearer YOUR_JWT"

Response and errors

Success responses use success: true and data. Errors return success: false and message. A missing or unowned agent returns 404.