Overview
Upload document files to create a knowledge base entry. The system automatically extracts text content and performs asynchronous vectorization using embeddings, enabling semantic search and RAG (Retrieval-Augmented Generation) capabilities. Endpoint:POST /api/knowledgebase/upload
Rate Limit: 3 requests per time window (Global + IP-based)
Vectorization Workflow
The upload process involves asynchronous vectorization:- Upload & Storage - File is validated and stored with metadata
- Status: PENDING - Knowledge base entry is created with initial status
- Status: PROCESSING - Background job extracts text and generates embeddings
- Status: COMPLETED - Vectors are stored and ready for querying
- Status: FAILED - If vectorization fails, use the revectorize endpoint to retry
Vectorization happens asynchronously. After upload, poll the status using GET /api/knowledgebase/ or list endpoint to check when
vectorStatus becomes COMPLETED.Request
Headers
Must be
multipart/form-dataBody Parameters
The document file to upload. Supported formats include PDF, DOCX, DOC, TXT, and other text-extractable formats.Max file size: Check your server configuration (typically 10-50 MB)
Custom display name for the knowledge base entry. If not provided, the original filename will be used.Example:
"Technical Documentation v2.1"Category to organize the knowledge base. Can be used for filtering and grouping.Example:
"Technical"Response
Response status code.
200 indicates success.Response message.
"success" on successful upload.Upload result containing knowledge base metadata.
Examples
- cURL
- cURL (no metadata)
- JavaScript (Fetch)
- Python
Response Example
Error Responses
Error code (non-200 value)
Error description
Common Errors
- 400 Bad Request - Missing required
fileparameter or invalid file format - 413 Payload Too Large - File exceeds maximum allowed size
- 429 Too Many Requests - Rate limit exceeded (3 requests per window)
- 500 Internal Server Error - File storage or processing failure
Post-Upload: Check Vectorization Status
After uploading, monitor the vectorization status:vectorStatus is COMPLETED, the knowledge base is ready for querying. If status is FAILED, check the vectorError field and use the revectorize endpoint to retry.
Revectorize Endpoint
If vectorization fails, manually retry the process: Endpoint:POST /api/knowledgebase/{id}/revectorize
Rate Limit: 2 requests per time window
Request
Response
See Also
- Query Knowledge Base - Search and query vectorized content
- List Knowledge Bases - View all knowledge bases and their status
- Delete Knowledge Base - Remove knowledge base entries
