Skip to main content

Knowledge Bases

Collections of your own documents that models can search while answering. These endpoints let you create knowledge bases, upload and index files, track indexing, and list the knowledge bases available to ground a conversation.

Adding a file takes two calls: generate a pre-signed upload URL and PUT the file to it, then queue the file for indexing. Indexing runs in the background, so poll a status endpoint until the knowledge base reports active.

Core

GET

List knowledge bases

Returns your knowledge bases with their file and chunk counts, paginated.

POST

Create a knowledge base

Creates an empty knowledge base that you then add files to.

GET

Retrieve a knowledge base

Returns a single knowledge base with its files and a summary of their ingestion states.

DEL

Delete a knowledge base

Deletes a knowledge base along with its files and everything indexed from them.

GET

List selectable knowledge bases

Returns the ID and name of every knowledge base that has finished indexing.

Files

GET

Generate a file upload URL

Returns a pre-signed URL for uploading one file, plus the storage key to pass to the ingest endpoint.

POST

Ingest uploaded files

Queues one or more uploaded files for indexing and returns a task per file.

DEL

Remove files from a knowledge base

Removes files and the chunks indexed from them, so their content stops being retrieved.

Ingestion

GET

Retrieve ingestion task status

Returns the state of specific ingestion tasks for a knowledge base.

POST

Retrieve status for multiple knowledge bases

Returns state, counts, and ingestion summaries for several knowledge bases in one call.

POST

Cancel knowledge base ingestion

Stops the ingestion tasks that have not finished for a knowledge base.

On this page