Skip to main content
The RAGPipelineManager is the heart of the optimization process. It orchestrates component loading, caching, and configuration sampling to efficiently evaluate thousands of RAG configurations.

Overview

The manager handles:
  • Component Loading: Initialize LLMs, embeddings, vector stores, and rerankers
  • Caching: Reuse components across configurations to save time and cost
  • Configuration Sampling: Generate RAG configs from the search space
  • Encoding/Decoding: Convert between RAGConfig objects and optimization tensors
  • Parallel Processing: Batch evaluation with thread pools
Important: You typically don’t need to interact with the RAG Manager directly. The Optimizer class handles it automatically.

How It Works

The manager operates in several key phases:

1. Component Initialization

When created, the manager:

2. Lazy Loading & Caching

Components are loaded once and cached:
This dramatically reduces:
  • API initialization overhead
  • Memory usage
  • Evaluation time

3. Configuration Sampling

The manager samples configurations from the search space:

4. Encoding for Optimization

Converts RAGConfig ↔ Tensor for Bayesian Optimization:
This allows the optimizer to work in continuous space while evaluating discrete configurations.

5. RAG Instance Creation

Creates RAGWorkflow instances with cached components:

Integration with Optimizer

The optimizer uses the manager internally:

Create Custom Manager