Skip to main content
A knowledge base groups the documents, prompt configuration, and agents that answer questions for a tenant. All endpoints are served under /knowledge-bases and accept either an API key or a user session.
All endpoints on this page are [User+Key] — call them with Authorization: Bearer sk_... or a signed-in session.

Endpoints

List knowledge bases

GET /knowledge-bases Returns the knowledge bases in a tenant.
string
required
The tenant whose knowledge bases to list.

Get a knowledge base

GET /knowledge-bases/:id Returns a single knowledge base, including its name, description, status, and memory mode.

Get prompt settings

GET /knowledge-bases/:id/prompt Returns the prompt configuration that shapes how answers are generated: persona, instructions, customPrompt, mainCustomPrompt, sqlCustomPrompt, sqlAgentInstructions, sqlAnsweringInstructions, and chartInstructions. See Prompts for how these combine.

Create a knowledge base

POST /knowledge-bases Creates a knowledge base in a tenant. Creation is subject to the tenant’s knowledge base quota.
string
required
The tenant that will own the knowledge base.
string
required
Human-readable name.
string
Short description of the content.
string
Optional prompt field describing the assistant’s voice and role.
string
Optional additional answering instructions.
string
Optional prompt override. See Prompts for precedence.
string
Optional full prompt override for Deep mode.
Creation also accepts sqlCustomPrompt, sqlAgentInstructions, sqlAnsweringInstructions, and chartInstructions for connected-data behavior. Use /swagger for their complete constraints.

Update a knowledge base

PATCH /knowledge-bases/:id Updates metadata, status, memory behavior, agent sharing, and prompt fields. Send only the fields you want to change.
string
Human-readable name.
string
Short description of the content.
string
Lifecycle status of the knowledge base.
string
One of disabled, subject, or kb_restricted. Controls how durable memory is scoped. See Memory modes.
object
Agent sharing configuration, e.g. { "inbound_delegation_enabled": true }. See Agent sharing.
string
Prompt persona field.
string
Additional answering instructions.
string
Prompt override field.
string
Deep-mode prompt override field.
The connected-data prompt fields accepted during creation can also be updated here. Send null to clear a nullable prompt field.

Delete a knowledge base

DELETE /knowledge-bases/:id Deletes the knowledge base. This removes its documents and associated data, and archives any agents built on it.
Deletion is destructive and cannot be undone. Documents and derived data are removed, and dependent agents are archived.

External (A2A) agents

Register external agents so agents in this knowledge base can delegate to them. This outbound delegation setup is independent of agent_sharing, which controls whether other knowledge bases can delegate into this one.

List external agents

GET /knowledge-bases/:id/a2a-agents

Register an external agent

POST /knowledge-bases/:id/a2a-agents
string
required
Display name for the external agent.
string
required
URL of the external agent’s capability card.
string
What the agent does.
string
Optional serialized request-header configuration. Stored encrypted.
string
Optional serialized metadata attached to the registration. Stored encrypted.
headers and metadata are stored encrypted at rest. Authorized reads return their decrypted values, so treat registration responses as sensitive.

Get, update, or remove an external agent

GET, PATCH, and DELETE /knowledge-bases/:id/a2a-agents/:agentId read, modify, and remove a single registration. PATCH accepts the same fields as registration; send only what changes.

Memories

Knowledge base memory-management endpoints return isolated data only when kbMemoryMode is set to kb_restricted. See Memory modes.

List memories

GET /knowledge-bases/:id/memories Supports optional limit, offset, and q query parameters. Other memory modes return memories: null rather than tenant-wide memory.

Get the memory graph

GET /knowledge-bases/:id/memories/graph Returns memories as a graph of entities and relationships.

Delete a memory

DELETE /knowledge-bases/:id/memories/:memoryId Removes a single memory.
Full request and response schemas for every field are available in the interactive explorer at /swagger.

Next steps

Knowledge bases

What a knowledge base is and how to structure content.

Prompts

Shape persona, instructions, and answering behavior.

RAG lifecycle

How retrieval and grounded answers work end to end.