Skip to main content
The Knowledge module (also called RAG) manages semantic search in vector knowledge bases.

Standalone Knowledge Manager

Agentic RAG in Agent

When RAG is configured in an agent, the SDK automatically creates a searchKnowledge tool that the LLM can decide when to use. This is more efficient than always searching, as the LLM only searches when necessary.

Multiple Vector Stores

Managing Documents

Add text documents:
Upload files:

Async Ingestion for Large Files

Available since SDK 1.3.2 (platform July 2026). For small files addFile still works — async ingestion is the recommended path for anything big.
addFile processes the file synchronously — fine for a manual or an FAQ, but a 50k-row catalog would hold the HTTP request open for minutes. ingestFile uploads the file, returns in seconds with a job id, and the platform embeds everything in the background with batched embeddings and checkpoint resume (if a worker restarts mid-job, ingestion continues from where it stopped instead of starting over).
Or block until it finishes:

CSV: one document per row

CSV files are ingested one document per row — ideal for product catalogs and structured data. Each row becomes a searchable Column: value document. You can control which columns are embedded and which go to metadata:

Data hygiene

Optional cleanup applied server-side before embedding — useful when the source data carries HTML, URLs, or placeholder values that hurt search quality:

Job status

getIngestionJob(jobId) (and the onProgress callback) return: waitForCompletion throws if the job fails or the timeout (default 30 min) elapses — on timeout the job keeps running server-side and you can keep polling.

Metadata Filters

Filter search results by document metadata using the filters option. Each key maps to a metadata field. Simple equality filter:
Custom operators (JSONB): Pass an object with value and operator for non-equality comparisons:
Supported operators: = (default), !=, >, >=, <, <=, @> (contains), <@ (contained by). Filters also work in agent RAG config:

RAG Interceptor & Rerank

Interceptor - Filter & Transform Results:
Rerank Strategies:
  • reciprocal-rank-fusion - Standard RRF algorithm
  • score-boost - Boost results containing keywords
  • metadata-weight - Weight by metadata field value
  • custom - Custom scoring function

Next Steps

Agents

Learn about agents

Use Cases

See RAG examples