Skip to main content
The Knowledge API gives you full control over the documents that power your agents’ Retrieval-Augmented Generation (RAG) capabilities. You can upload files for embedding, run semantic searches against the vector store, delete documents and their associated embeddings, and trigger URL-based ingestion for an agent’s configured web sources. Uploaded documents are processed asynchronously — the API returns immediately with a PROCESSING status, and the document transitions to COMPLETED or FAILED as the embedding pipeline runs. All requests require a valid bearer token in the Authorization header.

List documents

Returns a paginated list of all ingested knowledge documents with their metadata and processing status.
string
Filter results to documents belonging to a specific knowledge base UUID.
number
default:"0"
Zero-based page index for pagination.
number
default:"20"
Number of documents per page.
object[]
Array of KnowledgeContent objects.
Example response

Upload a document

Uploads a file for ingestion into the vector store. The file is processed asynchronously — the response returns immediately with status: "PROCESSING". Supported file types: PDF (.pdf), plain text (.txt).
file
required
The file to upload. Must be sent as multipart/form-data with the field name file.
string
Optional UUID of the knowledge base to assign this document to.
string
Optional human-readable description of the document’s content.
string
UUID of the newly created document record. Use this to check status or delete the document.
string
Always "PROCESSING" on successful upload.
string
Human-readable confirmation message.
Example response
Raw file bytes are not persisted after ingestion — only the extracted text and vector embeddings are stored. If ingestion fails, you must re-upload the original file; retrying a failed file upload via the retry endpoint is not supported.

Runs a semantic similarity search across all ingested documents using pgvector. Returns the most relevant document chunks ranked by embedding similarity.
string
required
The natural language query to search for. The server converts this to an embedding and performs a nearest-neighbor search.
object[]
Array of Document objects from the vector store, sorted by relevance score.
Example response

Delete a document

Deletes a document and all of its associated vector embeddings from the system. This is a hard delete — all embedding chunks stored in pgvector are removed in cascade.
string
required
UUID of the document to delete, as returned by the list or upload endpoints.
Returns 204 No Content with an empty body on success.
Deletion is irreversible. All vector embeddings for the document are permanently removed. You must re-upload and re-ingest the document to restore it.

Trigger URL ingestion for an agent

Triggers an asynchronous job to scrape and ingest the web URLs configured for the specified agent. Use this to refresh an agent’s knowledge base after its source URLs are updated. Returns a jobId immediately.
string
required
The unique identifier of the agent whose configured URLs should be ingested.
string
The identifier of the background ingestion job. You can track progress by monitoring document statuses via GET /api/knowledge.
Example response
Document status transitions (PROCESSINGCOMPLETED or FAILED) can be monitored by polling GET /api/knowledge and checking the status field of the document.