Skip to main content
The Knowledge Base Service provides endpoints for creating, managing, and querying document-based knowledge bases. It enables users to create vector stores from multiple document sources, manage documents, and perform semantic search over the stored content.

Authentication

All endpoints require a valid Bearer token in the Authorization header.

Base URL

Knowledge Base Endpoints

Create Knowledge Base

Create a new knowledge base in your organization.
Endpoint: POST /api/kb/create Query Parameters: Request Body: Source Configuration: Each source object must have the following fields: Example source configurations: S3 Source:
Web Source:
File Upload Source:

List Knowledge Bases

Retrieve all knowledge bases for an organization.
Endpoint: GET /api/kb/list Query Parameters:

Get Knowledge Base Details

Retrieve detailed information about a specific knowledge base.
Endpoint: GET /api/kb/get Query Parameters:

Update Knowledge Base

Update an existing knowledge base’s metadata.
Endpoint: PUT /api/kb/update Query Parameters: Request Body:

Delete Knowledge Base

Delete a knowledge base and all its contents.
Endpoint: DELETE /api/kb/delete Query Parameters:

Document Management Endpoints

Add Source to Knowledge Base

Add a new document source to an existing knowledge base.
Endpoint: POST /api/kb/add_source Query Parameters: Request Body:

List Documents

List all documents in a knowledge base with pagination.
Endpoint: GET /api/kb/list_documents Query Parameters:

Delete Document

Delete a specific document from the knowledge base.
Endpoint: DELETE /api/kb/delete_document Query Parameters:

Query Endpoints

Search Knowledge Base

Perform a semantic search on the knowledge base.
Endpoint: POST /api/kb/search Query Parameters: Request Body:

RAG Query

Perform a Retrieval-Augmented Generation (RAG) query on the knowledge base.
Endpoint: POST /api/kb/query Query Parameters: Request Body: LLM Parameters:

Status and Monitoring Endpoints

Get Ingestion Status

Check the status of document ingestion for a knowledge base.
Endpoint: GET /api/kb/ingestion_status Query Parameters:

Error Responses

Implementation Notes

  • Knowledge bases support multiple document sources (S3, web URLs, file uploads)
  • Documents are chunked and embedded for semantic search capability
  • RAG queries combine semantic search with LLM generation for context-aware responses
  • Metadata filters can be used to narrow search results
  • Document ingestion runs as a background process and can be monitored
  • Embeddings are stored in a vector database (PGVector) for efficient similarity search