Knowledge Base
Verified against backend/internal/publicapi/builder_dto.go, knowledge_handler.go, and routes.go.
| Method | Path | Scope |
|---|---|---|
| GET | /agents/:id/knowledge | knowledge:read |
| POST | /agents/:id/knowledge | knowledge:write |
| DELETE | /agents/:id/knowledge/*title | knowledge:write |
There is no "knowledge base" object
This is worth stating plainly because every competitor's docs model a KB as a resource with an ID you create once and attach files to. This API doesn't, because the underlying table doesn't either: knowledge_base is a chunk table — one row per chunk, with a vector(1536) embedding inline. There's nothing to create ahead of time and no KB id to hold onto. Knowledge attaches directly to the agent.
Add a source
curl -X POST https://api.voicematrix.ai/api/v1/ext/agents/<agent-id>/knowledge \
-H "X-API-Key: vm_live_..." \
-H "Content-Type: application/json" \
-d '{
"source_type": "url",
"url": "https://docs.acme.com/pricing",
"title": "Pricing page"
}'| Field | Required | Notes |
|---|---|---|
source_type | yes | text or url |
content | required if source_type: text | |
url | required if source_type: url | Fetched server-side — SSRF-validated |
title | no, max 200 | Labels the source for listing/deletion |
{ "agent_id": "...", "title": "Pricing page", "chunks": 14 }Content safety on ingestion
Both text and url ingestion pass through the same multilingual (English + Hebrew) content guard used elsewhere in the platform, in enforcement mode — a flagged document is hard-blocked, not merely logged. This matters because ingested content goes straight into an agent's system context: on a Hebrew-first product, an injection attempt written in Hebrew has to be caught by the same gate as one written in English, not fall through to an English-only pattern list.
If ingestion returns 503
Embedding requires Azure OpenAI credentials to be configured. If they aren't, this endpoint answers 503 rather than accepting your document and silently storing it without an embedding — a document that "saved successfully" but is never retrievable would be a much worse failure mode.
List sources
GET /agents/:id/knowledge{ "data": [ { "title": "Pricing page", "chunks": 14, "created_at": "..." } ] }Delete a source
DELETE /agents/:id/knowledge/*titleNote the *title wildcard, not :title. A source's title can legitimately contain a / — a url-sourced title derives from host/path (e.g. docs.acme.com/pricing), and a caller-supplied text title might too. A single-segment path parameter can't carry that; the wildcard captures the full remainder and the handler strips the leading slash. If you're constructing this URL yourself, don't URL-encode the slashes in the title — pass it through as the DELETE path directly.
Next
- Agents
- Voice & Agent Capabilities — how
search_knowledgeis used at call time