Skip to main content
A knowledge base holds indexed documents. Upload files, wait for indexing, then either query for raw retrieved chunks or send a chat request that the platform grounds in your documents. Full lifecycle in one page — this is the biggest step in the walkthrough.

Create a knowledge base

Save the id for the next calls:

Upload a file

Send multipart/form-data:
Supported types include PDF, DOCX, TXT, and common images (OCR runs automatically).

Wait for indexing

Indexing runs asynchronously. Poll the file list until every file’s status is ready:

Query for retrieved chunks

Retrieval only — no LLM call. Useful for inspecting what your KB actually contains.

Chat with the knowledge base (RAG)

Same OpenAI-compatible chat shape as /v1/chat/completions, plus a KB reference. The platform retrieves the relevant chunks and grounds the model’s answer in them.
This endpoint is stateless too — send the full messages[] on every turn. The server injects fresh KB context each call. Next: Research →