Skip to main content
Use the Knowledge Bases API to create document collections that agents search in chat. Most people should start from the web UI; this page is for automating the same flow.
Anyone signed in can list bases they own or that are Shared. Creating, uploading, and deleting require that you own the base (administrators can manage any base). An administrator must enable knowledge bases in the web UI before indexing works.

Create a knowledge base

shared lets other signed-in users read the base. default_open attaches it to your new chats only. Optional max_documents sets the per-base file cap (0 = unlimited, default 100).

Upload a document

Supported files: text (.md, .txt, .rst, .html, .json, .jsonl, .yaml, .csv, .tsv), spreadsheets (.xls, .xlsx, .xlsm), plus .pdf, .docx, .pptx. With OCR enabled, also .png, .jpg, .jpeg, .webp and scanned PDFs. Indexing starts after the upload. The response includes upload progress while the file is accepted. To create markdown or text without uploading a file:

Knowledge bases

Documents and folders

Each owner can create up to 20 bases. Each base has a document limit (default 100; 0 means unlimited). Upload size follows the server file-size cap (default 100 MB).

Enable indexing (administrators)

Turn the feature on in Knowledge Bases → Knowledge base settings, or call these routes after you pick a local or online embedding model: