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
Retrieve a knowledge base
Returns a single knowledge base with its files and a summary of their ingestion states.
Delete a knowledge base
Deletes a knowledge base along with its files and everything indexed from them.
List selectable knowledge bases
Returns the ID and name of every knowledge base that has finished indexing.
Files
Generate a file upload URL
Returns a pre-signed URL for uploading one file, plus the storage key to pass to the ingest endpoint.
Ingest uploaded files
Queues one or more uploaded files for indexing and returns a task per file.
Remove files from a knowledge base
Removes files and the chunks indexed from them, so their content stops being retrieved.
Ingestion
Retrieve ingestion task status
Returns the state of specific ingestion tasks for a knowledge base.
Retrieve status for multiple knowledge bases
Returns state, counts, and ingestion summaries for several knowledge bases in one call.
Cancel knowledge base ingestion
Stops the ingestion tasks that have not finished for a knowledge base.