Knowledge Base API
RAG-powered knowledge management for AI agents
The Knowledge Base API enables you to build RAG (Retrieval-Augmented Generation) powered AI agents. Upload documents, search with hybrid vector+text queries, and let your agents access business knowledge programmatically.
Base URL
https://platform.protobox.ai/api/v1/knowledgeAuthentication
All endpoints require authentication via Bearer token or API key:
# Bearer token (from login)
Authorization: Bearer <access_token>
# API key (for MCP/integrations)
X-API-Key: <api_key>
X-Workspace-ID: <workspace_id>Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /knowledge | Create manual entry |
GET | /knowledge | List entries |
GET | /knowledge/:id | Get entry |
PATCH | /knowledge/:id | Update entry |
DELETE | /knowledge/:id | Delete entry |
POST | /knowledge/search | Search knowledge |
POST | /knowledge/upload | Upload URL/text |
POST | /knowledge/upload/file | Upload file |
GET | /knowledge/tasks | List tasks |
GET | /knowledge/tasks/:taskId | Get task status |
GET | /knowledge/config | Get KB config |
PATCH | /knowledge/config | Update KB config |
GET | /knowledge/stats | Get statistics |
POST | /knowledge/folders | Create folder |
GET | /knowledge/folders | List folders |
GET | /knowledge/folders/:id | Get folder |
PATCH | /knowledge/folders/:id | Update folder |
DELETE | /knowledge/folders/:id | Delete folder |
POST | /knowledge/:id/move | Move to folder |
GET | /knowledge/:id/sync-config | Get sync config |
PATCH | /knowledge/:id/sync-config | Update sync config |
POST | /knowledge/:id/sync | Trigger sync |
Search Modes
Combines vector semantic search with text matching using Reciprocal Rank Fusion (RRF).
Best for: Most queries - balances meaning and exact matches
{
"query": "What's your return policy for electronics?",
"mode": "hybrid",
"limit": 5
}Pure semantic search using OpenAI embeddings (1536 dimensions).
Best for: Conceptual questions where exact words don't matter
{
"query": "Can I get my money back?",
"mode": "vector",
"limit": 5
}Full-text search with MongoDB text indexes (BM25-style).
Best for: Finding specific terms, product names, codes
{
"query": "SKU-12345 warranty",
"mode": "text",
"limit": 5
}Source Types
| Source | Description | Use Case |
|---|---|---|
manual | Text entries created directly | Quick FAQ entries, announcements |
document | Uploaded files (PDF, DOCX, etc.) | Product manuals, policies |
webpage | Crawled web pages | Help center articles, blog posts |
faq | Structured Q&A pairs | Common customer questions |
api_docs | API documentation | Technical support |
Supported File Types
| Category | Formats |
|---|---|
| Documents | PDF, DOCX, TXT |
| Web | HTML, URLs (auto-crawled) |
| Markdown | MD, MDX |
Processing Pipeline
Rate Limits
| Operation | Limit |
|---|---|
| Create/Update | 100/min |
| Search | 200/min |
| Upload | 20/min |
| File size | 10 MB |
MCP System Tools
When using the Knowledge Base via MCP, these system tools are available:
| Tool | Description |
|---|---|
kb_search | Search with hybrid/vector/text modes |
kb_add | Create a manual entry |
kb_list | List entries with pagination |
kb_get | Get a single entry by ID |
kb_stats | Get KB statistics |