Skip to main content
Knowledge bases ingest documents asynchronously (parse → chunk → embed) and let you search the result:
  • UploadPOST /v1/knowledge-bases/{kb_id}/upload_train (multipart). Returns run ids you can poll.
  • SearchPOST /v1/knowledge-bases/{kb_id}/search.
Replace kb_id and your_api_key. Use the prefix parameter to organise and scope documents into folders.

Upload documents and wait for ingestion

Upload returns immediately with run ids; ingestion runs in the background. Poll the training runs (SDK get_runs, or the running jobs endpoint) until they complete before searching. Don’t set Content-Type yourself on the upload — let your HTTP client set the multipart boundary.

Search the knowledge base

Runs a semantic / hybrid query (depending on the KB’s retrieval settings) over the ingested content and returns the matching chunks with their source documents. Scope the search with prefix.

Async / await with the SDK

Use the a-prefixed coroutines (aget, aupload_document, aget_runs, asearch) from async code so the event loop stays responsive.
Python SDK