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

MethodPathDescriptionAuth
GET/knowledge-basesList knowledge bases for a tenant[User+Key]
GET/knowledge-bases/:idGet a knowledge base[User+Key]
GET/knowledge-bases/:id/promptGet prompt settings[User+Key]
POST/knowledge-basesCreate a knowledge base[User+Key]
PATCH/knowledge-bases/:idUpdate a knowledge base[User+Key]
DELETE/knowledge-bases/:idDelete a knowledge base[User+Key]
GET/knowledge-bases/:id/a2a-agentsList registered external agents[User+Key]
POST/knowledge-bases/:id/a2a-agentsRegister an external agent[User+Key]
GET/knowledge-bases/:id/a2a-agents/:agentIdGet a registered external agent[User+Key]
PATCH/knowledge-bases/:id/a2a-agents/:agentIdUpdate a registered external agent[User+Key]
DELETE/knowledge-bases/:id/a2a-agents/:agentIdRemove a registered external agent[User+Key]
GET/knowledge-bases/:id/memoriesList knowledge base memories[User+Key]
GET/knowledge-bases/:id/memories/graphGet the memory graph[User+Key]
DELETE/knowledge-bases/:id/memories/:memoryIdDelete a memory[User+Key]

List knowledge bases

GET /knowledge-bases Returns the knowledge bases in a tenant.
tenant_id
string
required
The tenant whose knowledge bases to list.
curl "https://api.autosage.ai/api/v1/knowledge-bases?tenant_id=TENANT_ID" \
  -H "Authorization: Bearer sk_live_your_key_here"

Get a knowledge base

GET /knowledge-bases/:id Returns a single knowledge base, including its name, description, status, and memory mode.
curl "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID" \
  -H "Authorization: Bearer sk_live_your_key_here"

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.
curl "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID/prompt" \
  -H "Authorization: Bearer sk_live_your_key_here"

Create a knowledge base

POST /knowledge-bases Creates a knowledge base in a tenant. Creation is subject to the tenant’s knowledge base quota.
tenant_id
string
required
The tenant that will own the knowledge base.
name
string
required
Human-readable name.
description
string
Short description of the content.
persona
string
Optional prompt field describing the assistant’s voice and role.
instructions
string
Optional additional answering instructions.
customPrompt
string
Optional prompt override. See Prompts for precedence.
mainCustomPrompt
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.
curl -X POST "https://api.autosage.ai/api/v1/knowledge-bases" \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "tenant_id": "TENANT_ID",
    "name": "Support docs",
    "description": "Product help center content"
  }'

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.
name
string
Human-readable name.
description
string
Short description of the content.
status
string
Lifecycle status of the knowledge base.
kbMemoryMode
string
One of disabled, subject, or kb_restricted. Controls how durable memory is scoped. See Memory modes.
agent_sharing
object
Agent sharing configuration, e.g. { "inbound_delegation_enabled": true }. See Agent sharing.
persona
string
Prompt persona field.
instructions
string
Additional answering instructions.
customPrompt
string
Prompt override field.
mainCustomPrompt
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.
curl -X PATCH "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID" \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated help center content",
    "kbMemoryMode": "kb_restricted"
  }'

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.
curl -X DELETE "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID" \
  -H "Authorization: Bearer sk_live_your_key_here"

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
curl "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID/a2a-agents" \
  -H "Authorization: Bearer sk_live_your_key_here"

Register an external agent

POST /knowledge-bases/:id/a2a-agents
name
string
required
Display name for the external agent.
cardUrl
string
required
URL of the external agent’s capability card.
description
string
What the agent does.
headers
string
Optional serialized request-header configuration. Stored encrypted.
metadata
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.
curl -X POST "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID/a2a-agents" \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Billing specialist",
    "cardUrl": "https://partner.example.com/agent-card.json",
    "description": "Answers billing and invoicing questions"
  }'

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.
curl "https://api.autosage.ai/api/v1/knowledge-bases/KB_ID/memories" \
  -H "Authorization: Bearer sk_live_your_key_here"

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.