Skip to main content

Knowledge

List Knowledge Bases

Returns a list of your knowledge bases. The knowledge bases are returned sorted by creation date, with the most recent knowledge bases appearing first

Create a Knowledge Base

Creates an internal or external knowledge base. Internal knowledge bases embed and index uploaded content; external knowledge bases query the configured external retrieval API.

Retrieve a Knowledge Base

Retrieve a knowledge base with the settings.

Delete a Knowledge Base

Deletes a knowledge base. Deleting a knowledge base will delete all the datasources and chunks associated with it.

Update a Knowledge Base

Updates a knowledge base. Omitted optional fields retain their current values.

List Datasources

Returns the datasources in a knowledge base. Use cursors to page through results and optional query or status filters to narrow the list.

Create Datasource

Creates a datasource shell when only a display name is provided. When file_id is provided, the uploaded file is queued for chunking and ingestion.

Preview Chunks

Parses an uploaded file and returns the chunks it would produce for the given chunking options without creating a datasource.

Retrieve Datasource

Retrieves a datasource and its current processing status and chunk count.

Delete Datasource

Deletes a datasource from a knowledge base. Deleting a datasource will remove it from the knowledge base and all associated chunks. This action is irreversible and cannot be undone.

Update Datasource

Updates the display name of a datasource.

List Chunks

Returns chunks using cursor pagination, with optional text and processing-status filters.

Create Chunks

Creates between 1 and 100 chunks. Chunks with supplied embeddings are indexed immediately; chunks without embeddings are queued for embedding.

Delete Chunks

Deletes up to 100 chunks and reports IDs that were not found or could not be deleted.

Get Chunks Count

Returns the total count of chunks in a datasource. When q is provided, the count reflects indexed chunks only: recently created chunks may not be counted until embedding completes.

List Chunks Paginated

Returns a page of chunks, with optional text, enabled-state, and processing-status filters.

Retrieve Chunk

Retrieves a chunk by its chunk identifier.

Delete Chunk

Deletes a chunk from the datasource and its vector index.

Update Chunk

Updates chunk text, metadata, or a supplied embedding. Changing text without an embedding queues the chunk for re-embedding.

Toggle Chunk

Enables or disables a chunk for retrieval. If the vector-index document is missing, enabling the chunk queues it for embedding.

Retrieve Processing Status

Returns aggregate queued, completed, passed, and failed chunk counts together with the datasource and chunk processing attempts.

Search a Knowledge Base

Search a Knowledge Base and return the most similar chunks, along with their search and rerank scores. Note that all configuration changes made in the API will override the settings in the UI.

Retrieve File Url

Creates a presigned upload policy for a file that will be attached to a knowledge-base datasource. Submit the returned form fields and file directly to the returned URL.