Endpoints

Knowledge Bases

API reference for creating and managing knowledge bases that organize your documents.

Overview

Knowledge Bases are collections of documents that your AI agent uses for retrieval-augmented generation (RAG). Organize documents into knowledge bases by topic, department, or any grouping that makes sense for your use case.

Create Knowledge Base

POST /workspaces/{workspaceId}/knowledge-bases — Create a new knowledge base. Body: { name: string, description?: string, color?: string, metadata?: object }. The color field accepts hex codes and is used for visual identification in the dashboard.

List Knowledge Bases

GET /workspaces/{workspaceId}/knowledge-bases — Retrieve all knowledge bases in a workspace. Each entry includes the name, description, color, document count, and total size. Results are sorted by creation date.

Update Knowledge Base

PUT /workspaces/{workspaceId}/knowledge-bases/{kbId} — Update knowledge base metadata (name, description, color, metadata). Documents within the knowledge base are not affected.

Delete Knowledge Base

DELETE /workspaces/{workspaceId}/knowledge-bases/{kbId} — Delete a knowledge base. Documents within the knowledge base are moved to the default (unassigned) collection, not deleted. This is a soft delete operation.