Skip to main content

Knowledge Bases API

A knowledge base holds the documents agents answer from: uploads and Library artifacts. The platform indexes each document into a section tree (titles, summaries, pages); there is no vector store. An agent reads the knowledge bases its config lists (knowledgeBaseIds) and navigates them with the agent knowledge routes at the end of this page, the same ones its knowledge_catalog, knowledge_search, knowledge_outline and knowledge_read tools call.

See Knowledge for the dashboard.

Authentication​

All endpoints require an API key in the X-API-Key header (or, inside Strongly, the injected bearer token). Reads need the knowledge:read scope, changes knowledge:write.

Responses and errors​

A success is { "data": ..., "meta": { "requestId" } }. Lists are cursor-paged: pass limit (default 50, max 200) and cursor (the previous page's meta.nextCursor); meta carries total, limit and nextCursor (null on the last page).

Errors are RFC 9457 problem details (Content-Type: application/problem+json):

{
"type": "urn:strongly:problem:not-found",
"title": "Not found",
"status": 404,
"detail": "Knowledge base not found",
"code": "not-found",
"requestId": "req_abc123"
}

Knowledge Base Object​

FieldTypeDescription
_idstringKnowledge base ID
namestringName (up to 120 characters)
descriptionstringWhat the documents cover (up to 1000 characters); agents see it in their catalog
ownerIdstringOwner user ID
ownerNamestringOwner display name
organizationIdstringThe organization it belongs to
sharedWitharrayUser IDs it is shared with (editors)
isPublicbooleanWhether every user can find and use it
indexModelIdstringThe AI Gateway chat model that writes section summaries while documents are indexed
documentsarrayIts documents (single knowledge base responses only)
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp

Document Object​

FieldTypeDescription
_idstringDocument ID
knowledgeBaseIdstringThe knowledge base it belongs to
namestringThe file name, or the artifact's title
sourceobject{ "type": "upload", "filename", "contentType", "size" } or { "type": "artifact", "artifactId" }
statusstringpending, indexing, ready or failed
errorstringWhy indexing failed, or null
titlestringThe title indexing found
summarystringThe summary indexing wrote
pageCountnumberPages (PDF), or null
sectionCountnumberSections in its tree
addedBystringThe user who added it (indexing runs, and is billed, as them)
createdAtstringISO 8601 timestamp
indexedAtstringWhen indexing finished

Knowledge bases​

GET /api/v1/library/knowledge-bases​

List the knowledge bases you can use, by name (without their documents).

Scope: knowledge:read

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoResults per page (default 50, max 200)
cursorstringNometa.nextCursor of the previous page

Response 200 OK

{
"data": [
{
"_id": "Hq2kTn9xWv4pLmR8s",
"name": "Office guide",
"description": "Rooms, equipment and opening hours",
"ownerId": "u_sam",
"ownerName": "Sam Rivera",
"organizationId": "org_abc",
"sharedWith": [],
"isPublic": false,
"indexModelId": "665f1c2a9b1e8a0012ab34cd",
"createdAt": "2026-10-10T21:30:00.000Z",
"updatedAt": "2026-10-10T21:30:00.000Z"
}
],
"meta": { "total": 1, "limit": 50, "nextCursor": null, "requestId": "req_abc123" }
}

POST /api/v1/library/knowledge-bases​

Create a knowledge base. indexModelId must be a chat model you may use.

Scope: knowledge:write

Request Body

FieldTypeRequiredDescription
namestringYesName
descriptionstringNoWhat the documents cover
indexModelIdstringYesAI Gateway chat model ID that indexes documents

Response 201 Created: the knowledge base, with documents: [].

StatusCodeDescription
400validation-errorA field is missing or too long, the model is not a chat model, or you are not in an organization
404not-foundThe model does not exist or you may not use it

GET /api/v1/library/knowledge-bases/:id​

Get a knowledge base with its documents.

Scope: knowledge:read

Response 200 OK

{
"data": {
"_id": "Hq2kTn9xWv4pLmR8s",
"name": "Office guide",
"indexModelId": "665f1c2a9b1e8a0012ab34cd",
"documents": [
{
"_id": "3f9c2e7a1b4d4e0f9a8b7c6d5e4f3a2b",
"knowledgeBaseId": "Hq2kTn9xWv4pLmR8s",
"name": "rooms.md",
"source": { "type": "upload", "filename": "rooms.md", "contentType": "text/markdown", "size": 412 },
"status": "ready",
"error": null,
"title": "Rooms",
"summary": "Meeting rooms, their capacity and how to book them.",
"pageCount": null,
"sectionCount": 4,
"addedBy": "u_sam",
"createdAt": "2026-10-10T21:31:00.000Z",
"indexedAt": "2026-10-10T21:31:20.000Z"
}
]
},
"meta": { "requestId": "req_abc123" }
}

PATCH /api/v1/library/knowledge-bases/:id​

Change the name, description or indexing model. A new indexing model applies to documents added or re-indexed from now on.

Scope: knowledge:write

Request Body: any of name, description, indexModelId.

Response 200 OK: the knowledge base as it now is.


DELETE /api/v1/library/knowledge-bases/:id​

Delete a knowledge base, its documents and their stored data, and remove it from every agent that reads it. Artifacts added to it are kept. Cannot be undone.

Scope: knowledge:write

Response 204 No Content


Sharing​

Knowledge bases use the platform's one permissions shape. A member's role is editor: they can read the knowledge base, add and remove documents, and give it to their own agents. Knowledge bases have no use-only tier, so role user is refused.

MethodPathBodyDescription
GET/api/v1/library/knowledge-bases/:id/permissionsOwner, members (userId, role), visibility
POST/api/v1/library/knowledge-bases/:id/permissions/members{ "userId", "role": "editor" }Share with a user (201, the permissions)
DELETE/api/v1/library/knowledge-bases/:knowledgeBaseId/permissions/members/:userIdRemove a member (204)
PATCH/api/v1/library/knowledge-bases/:id/permissions{ "visibility": "public" | "private" }Public: every user can find and use it (200, the permissions)
{
"data": {
"id": "Hq2kTn9xWv4pLmR8s",
"owner": "u_sam",
"members": [{ "userId": "u_alex", "role": "editor" }],
"visibility": "private"
},
"meta": { "requestId": "req_abc123" }
}

Documents​

POST /api/v1/library/knowledge-bases/:id/documents​

Add a document. It is indexed in the background; poll the knowledge base until its status is ready or failed. Takes .pdf .md .markdown .txt .html .htm .docx .csv .json.

Scope: knowledge:write

Request Body

FieldTypeRequiredDescription
filenamestringYesFile name with its extension, e.g. rooms.md
contentstringOne ofThe document text (Markdown headings become its sections)
fileBase64stringOne ofThe file, base64-encoded
contentTypestringNoMIME type of fileBase64

Response 201 Created

{
"data": {
"_id": "3f9c2e7a1b4d4e0f9a8b7c6d5e4f3a2b",
"knowledgeBaseId": "Hq2kTn9xWv4pLmR8s",
"name": "rooms.md",
"source": { "type": "upload", "filename": "rooms.md", "contentType": "text/markdown", "size": 412 },
"status": "pending",
"error": null
},
"meta": { "requestId": "req_abc123" }
}
StatusCodeDescription
400validation-errorNo filename, no content, or a file type that cannot be indexed

POST /api/v1/library/knowledge-bases/:id/documents/import​

Add Library artifacts as documents. Each is read where it is stored (not copied), indexed again whenever it changes, and dropped from answers if the person who added it can no longer open it. Text, Markdown, HTML, PDF, Word, CSV and JSON artifacts can be indexed; images cannot.

Scope: knowledge:write

Request Body: { "artifactIds": ["..."] } (a non-empty array).

Response 201 Created: { "added": [ <document>, ... ] }, one document per artifact.


POST /api/v1/library/knowledge-bases/:knowledgeBaseId/documents/:id/reindex​

Index a document again (after a failure, or with the knowledge base's current indexing model).

Scope: knowledge:write

Response 200 OK: the document, status: "pending".


DELETE /api/v1/library/knowledge-bases/:knowledgeBaseId/documents/:id​

Remove a document with its stored index. An artifact removed this way is kept as an artifact.

Scope: knowledge:write

Response 204 No Content


An agent's knowledge​

Give an agent knowledge bases with PATCH /api/v1/agents/:id/config { "knowledgeBaseIds": ["..."] } (the complete list; each one added must be one you may use), then restart a running agent (POST /api/v1/agents/:id/redeploy). These routes read the agent's knowledge the way the agent does; each spans every knowledge base the agent reads that you may use.

GET /api/v1/agents/:id/knowledge​

What the agent knows: each knowledge base with every readable document's title and summary, and the documents still being indexed or that failed.

Scope: knowledge:read

{
"data": {
"knowledgeBases": [
{
"_id": "Hq2kTn9xWv4pLmR8s",
"name": "Office guide",
"description": "Rooms, equipment and opening hours",
"documents": [
{ "_id": "3f9c2e7a...", "name": "rooms.md", "status": "ready", "title": "Rooms", "summary": "Meeting rooms...", "sectionCount": 4 }
],
"notReady": []
}
]
},
"meta": { "requestId": "req_abc123" }
}

GET /api/v1/agents/:id/knowledge/search​

Find the sections that mention the query's words (keyword search, best match first).

Scope: knowledge:read

ParameterTypeRequiredDescription
qstringYesWords to look for
{
"data": {
"query": "room booking",
"results": [
{
"documentId": "3f9c2e7a...",
"sectionId": "0002",
"title": "Booking a room",
"path": ["Rooms"],
"pages": null,
"score": 3.41,
"knowledgeBaseId": "Hq2kTn9xWv4pLmR8s",
"knowledgeBaseName": "Office guide"
}
]
},
"meta": { "requestId": "req_abc123" }
}

GET /api/v1/agents/:agentId/knowledge/documents/:id/outline​

A document's section tree: { "document", "outline" }. The document carries its _id; every section in the outline has its id (a section is part of the document, not a resource), title, summary and pages.

Scope: knowledge:read

GET /api/v1/agents/:agentId/knowledge/documents/:documentId/sections/:id​

Read one section: its title, summary, pages, text (with page markers for a PDF) and children (its sub-sections; a section with sub-sections holds little text of its own).

Scope: knowledge:read

StatusCodeDescription
404not-foundThe agent, document or section does not exist, or the document is not in one of the agent's knowledge bases you may use

Python SDK​

from strongly import Strongly

client = Strongly()

kb = client.knowledge.create(name="Office guide", index_model_id="<chat model id>")
client.knowledge.add_document(kb.id, filename="rooms.md", content="# Rooms\n\n...")
client.knowledge.import_artifacts(kb.id, artifact_ids=["<artifact id>"])
for doc in client.knowledge.retrieve(kb.id).documents:
print(doc.name, doc.status)

client.knowledge.update_agent_knowledge_bases("<agent id>", knowledge_base_ids=[kb.id])
print(client.knowledge.agent_search("<agent id>", "room booking")["results"])

See Knowledge Bases in the SDK reference.

STAN and agent tools​

list_knowledge_bases, create_knowledge_base, get_knowledge_base, update_knowledge_base, delete_knowledge_base, add_knowledge_document, import_knowledge_artifacts, reindex_knowledge_document, remove_knowledge_document, get_knowledge_base_permissions, add_knowledge_base_member, remove_knowledge_base_member, set_knowledge_base_visibility, get_agent_knowledge, search_agent_knowledge, get_knowledge_outline, get_knowledge_section.

Scopes​

ScopeEndpoints
knowledge:readGET /library/knowledge-bases, GET /library/knowledge-bases/:id, GET …/permissions, GET /agents/:id/knowledge, GET /agents/:id/knowledge/search, GET …/outline, GET …/sections/:id
knowledge:writePOST /library/knowledge-bases, PATCH/DELETE /library/knowledge-bases/:id, POST/DELETE …/permissions/members, PATCH …/permissions, POST …/documents, POST …/documents/import, POST …/reindex, DELETE …/documents/:id