/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
| Method | Path | Description | Auth |
|---|---|---|---|
GET | /knowledge-bases | List knowledge bases for a tenant | [User+Key] |
GET | /knowledge-bases/:id | Get a knowledge base | [User+Key] |
GET | /knowledge-bases/:id/prompt | Get prompt settings | [User+Key] |
POST | /knowledge-bases | Create a knowledge base | [User+Key] |
PATCH | /knowledge-bases/:id | Update a knowledge base | [User+Key] |
DELETE | /knowledge-bases/:id | Delete a knowledge base | [User+Key] |
GET | /knowledge-bases/:id/a2a-agents | List registered external agents | [User+Key] |
POST | /knowledge-bases/:id/a2a-agents | Register an external agent | [User+Key] |
GET | /knowledge-bases/:id/a2a-agents/:agentId | Get a registered external agent | [User+Key] |
PATCH | /knowledge-bases/:id/a2a-agents/:agentId | Update a registered external agent | [User+Key] |
DELETE | /knowledge-bases/:id/a2a-agents/:agentId | Remove a registered external agent | [User+Key] |
GET | /knowledge-bases/:id/memories | List knowledge base memories | [User+Key] |
GET | /knowledge-bases/:id/memories/graph | Get the memory graph | [User+Key] |
DELETE | /knowledge-bases/:id/memories/:memoryId | Delete a memory | [User+Key] |
List knowledge bases
GET /knowledge-bases
Returns the knowledge bases in a tenant.
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.
The tenant that will own the knowledge base.
Human-readable name.
Short description of the content.
Optional prompt field describing the assistant’s voice and role.
Optional additional answering instructions.
Optional full prompt override for Deep mode.
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.
Human-readable name.
Short description of the content.
Lifecycle status of the knowledge base.
One of
disabled, subject, or kb_restricted. Controls how durable memory is scoped. See Memory modes.Agent sharing configuration, e.g.
{ "inbound_delegation_enabled": true }. See Agent sharing.Prompt persona field.
Additional answering instructions.
Prompt override field.
Deep-mode prompt override field.
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.
External (A2A) agents
Register external agents so agents in this knowledge base can delegate to them. This outbound delegation setup is independent ofagent_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
Display name for the external agent.
URL of the external agent’s capability card.
What the agent does.
Optional serialized request-header configuration. Stored encrypted.
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 whenkbMemoryMode 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.
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.