Перейти к содержимому

Knowledge Base API

Это содержимое пока не доступно на вашем языке.

Upload, manage, and search your bot’s knowledge base programmatically.

POST /v1/projects/:project_id/documents

Upload a document to be processed and indexed for RAG retrieval.

Supported formats: PDF, DOCX, TXT, MD, CSV

Request: Multipart form data with the file.

Response:

{
"document_id": "doc-001",
"filename": "support-faq.pdf",
"status": "processing",
"created_at": "2025-03-20T14:00:00Z"
}
GET /v1/projects/:project_id/documents

Returns all documents in the project’s knowledge base.

DELETE /v1/documents/:document_id

Remove a document from the knowledge base. Associated embeddings are also deleted.

POST /v1/projects/:project_id/search

Search the knowledge base using semantic search.

Request body:

{
"query": "How do I reset my password?",
"top_k": 5
}

Response:

{
"results": [
{
"chunk_id": "faq-password-reset",
"content": "To reset your password, go to Settings > Security...",
"score": 0.92,
"tags": ["account", "security"]
}
]
}