Skip to content

RagPipeline

Convenience class that wires embedder, vector store, chunker, and optional reranker into a single ingestion + retrieval pipeline.

Implements the Retriever interface so it can be passed directly to createVectorRetrievalTool() or used as an agent retriever.

new RagPipeline(options): RagPipeline;
Parameter Type

options

RagPipelineOptions

RagPipeline

ensureIndex(): Promise<void>;

Ensure the vector index exists, creating it if necessary. Requires at least one embed() call to determine dimension.

On edge stores that only implement VectorStoreCore (indexes provisioned out-of-band), this is a no-op — the store’s own listIndexes() is still consulted so a genuinely missing index surfaces later at query time via the backend’s own error.

Promise<void>


ingest(documents): Promise<void>;

Ingest documents: chunk, embed, and store in the vector store.

Parameter Type

documents

Document[]

Promise<void>


retrieve(query, options?): Promise<RetrievalResult[]>;

Retrieve relevant chunks for a query. Implements the Retriever interface.

Parameter Type

query

string

options?

RetrievalOptions

Promise<RetrievalResult[]>

Retriever.retrieve