Skip to main content

Knowledge Bases

Knowledge bases store documents, URLs, and structured data that agents use for retrieval-augmented generation (RAG). Each KB has its own vector index, document registry, and optional knowledge graph.
All API requests require a valid JWT token in the Authorization: Bearer <token> header. The API Gateway decodes the JWT and forwards auth context (user-id, organization-id, user-email, x-platform-role, x-org-role) as headers to downstream services.

Create Knowledge Base

Create a new knowledge base in your organization. Requires the member organization role or higher (platform superadmins always pass).
There is no visibility field. Access to a knowledge base is decided by organization membership plus per-resource grants. A visibility key sent in a create or update body is ignored (BSIO-449).

Request Body

string
required
Knowledge base name.
string
Description of the knowledge base contents.
object
Custom KB settings (embedding config, chunking strategy, etc.).

Response (201)

object
The created knowledge base.

Errors

error
The caller’s organization role is below member. Nothing is created. Body: { "error": "Forbidden", "message": "Requires member role or higher" }.

List Knowledge Bases

List all knowledge bases in your organization.

Query Parameters

number
default:"50"
Maximum results.
number
default:"0"
Pagination offset.

Response (200)

object[]
Array of KB objects.
number
Total count.
number
Applied limit.
number
Applied offset.
curl

Get Knowledge Base

Get a single knowledge base with full details.

Path Parameters

string
required
KB UUID.

Response (200)

object
Full KB object.

Update Knowledge Base

Update knowledge base metadata.

Path Parameters

string
required
KB UUID.

Request Body

string
Updated name.
string
Updated description.
object
Updated settings.

Response (200)

Returns the updated KB object.

Delete Knowledge Base

Permanently delete a knowledge base, including all documents, chunks, vectors, and graph data. Requires delete on the knowledge base. Its agent links are removed with it (kb_agent_links cascades) — no agent is deleted, and agents that used it keep answering without it. Writes a knowledge_base.delete audit entry, and attributes the vector-store cost, to the organization that owned the knowledge base (they differ from the caller’s only for a superadmin).

Path Parameters

string
required
KB UUID.

Response (204)

No content on success.
This action is irreversible. All documents, embeddings, and knowledge graph data for this KB will be permanently deleted.

Link a knowledge base to an agent, enabling RAG context retrieval for that agent’s conversations. Requires edit on the knowledge base and edit on the agent. Org owners, admins and members have both on everything in their organization; a viewer needs a grant on each. The knowledge base and the agent must belong to the same organization. Writes a knowledge_base.agent_link audit entry under the knowledge base’s organization. Linking an already-linked pair updates its permissions and priority.

Path Parameters

string
required
KB UUID.
string
required
Agent UUID.

Request Body

object
Optional permission overrides for this link.
number
default:"0"
Priority level for search result ranking when multiple KBs are linked.

Response (200)

Errors


Remove the link between a knowledge base and an agent. Requires edit on the knowledge base and edit on the agent, like linking. Idempotent: unlinking a pair that is not linked still returns 200. Writes a knowledge_base.agent_unlink audit entry under the knowledge base’s organization when a link was actually removed. A platform superadmin may remove a link whose two sides are in different organizations (a link created before cross-organization links were refused); everyone else gets 404 for an agent outside their organization.

Path Parameters

string
required
KB UUID.
string
required
Agent UUID.

Response (200)

Errors


Get KB’s Linked Agents

Get all agents linked to a specific knowledge base — the reverse lookup of Get Agent’s Linked KBs. Powers the KB Overview page’s Connected Agents card.

Path Parameters

string
required
KB UUID.

Response (200)

object[]
Array of linked agents, ordered by link priority (descending) then link creation time.
Soft-deleted agents (deleted_at IS NOT NULL) are excluded.
curl

Get Agent’s Linked KBs

Get all knowledge bases linked to a specific agent.

Path Parameters

string
required
Agent UUID.

Response (200)

object[]
Array of KB objects with link metadata (permissions, priority, linked_at).
number
Number of linked KBs.