Skip to content

latent.rag.pipeline

PipelineBuilder — compose RAG pipelines from nested config dicts.

Translates nested config to RAGAdapter flat params + post-adapter wrappers (reranker, CRAG, query expansion). Caches indexed pipelines by hash of index-time params to avoid redundant re-indexing.

Classes

PipelineBuilder

PipelineBuilder(persist_base: str | None = None)

Build composed RAG pipelines from nested config dicts.

Caches indexed adapters by index-time param hash so that query-time-only changes (top_k, reranker, threshold) reuse the existing index.

Methods

PipelineBuilder.build

build(config: dict[str, Any]) -> _Pipeline

Validate config and build a composed pipeline.

Raises ValueError if config is invalid.

PipelineBuilder.cleanup

cleanup() -> None

Clean up temporary directories.