Skip to main content
Having larger configurations and multiple choices may affect the optimization speed and will require more trials to achieve better results.

Introduction

The RAG system uses a YAML-based configuration file to define all aspects of your retrieval-augmented generation pipeline. This includes indexing parameters, vector stores, embeddings, retrieval strategies, and language models.

Configuration Structure

Your configuration file consists of several main sections:
  • Indexing Parameters: Control how documents are chunked and processed
  • Vector Stores: Choose and configure your vector database
  • Embeddings: Select embedding models for document representation
  • Search Configuration: Define retrieval strategies
  • Language Models: Configure generation models
  • Retrieval Settings: Fine-tune the number of retrieved documents

Search Space Types

Each parameter has a searchspace_type that defines how it can be configured:
Numeric parameters with a range of values
Parameters with predefined choices
True/false parameters

Indexing Parameters

Configure how your documents are processed and chunked.
int
default:"512"
Size of text chunks in characters - Range: 200-2000 - Recommendation: 500-1000 for most use cases
int
default:"50"
Overlap between consecutive chunks in characters - Range: 0-500 - Recommendation: 10-20% of chunk_size
int
default:"500"
Maximum tokens for generation - Range: 100-1000
float
default:"0.7"
Temperature for generation randomness - Range: 0.0-1.0 - Lower values: More deterministic - Higher values: More creative

Example

Vector Stores

Choose from multiple vector database options, each with different pricing models:
  • FAISS: Local, free vector store with no cloud costs
  • Chroma: Open-source vector database with persistent storage
  • Pinecone: Managed vector database with cloud pricing
  • Weaviate: Open-source vector database with cloud version available

Configuration Structure

Examples

Embeddings

Select embedding models to convert text into vector representations.

Supported Providers

  • OpenAI: High-quality embeddings with various model sizes
  • HuggingFace: Free, open-source embedding models
  • Sentence Transformers: Optimized models for semantic similarity
  • Claude: Anthropic’s embedding models

OpenAI Embeddings

Recommendation: text-embedding-3-small offers the best balance of cost and performance

HuggingFace Embeddings

HuggingFace models are free for local or self-hosted deployments

Sentence Transformers

Claude Embeddings

Search Types

Configure retrieval strategies for finding relevant documents.

Available Search Types

  • similarity: Pure vector similarity search using cosine similarity
  • mmr: Maximum Marginal Relevance for diversity in results
  • bm25: Traditional keyword-based search algorithm
  • tfidf: Term frequency-inverse document frequency ranking
  • hybrid: Combines vector and keyword search for best results

Retrieval Settings

int
default:"5"
Number of documents to retrieve - Range: 1-20 - Lower values: More focused context - Higher values: Broader context, may include noise

Reranking

Optionally rerank retrieved documents for better relevance.

Available Reranker Types

  • cross_encoder: Cross-attention models for precise relevance scoring
  • colbert: Late interaction models for efficient reranking
  • bge: BGE reranker models from Beijing Academy of AI

Language Models

Configure the LLM for generation. Multiple providers are supported.

OpenAI Models

Anthropic Models

Azure OpenAI

DeepSeek Models

HuggingFace Models (Free)

Complete Configuration Example

Here’s a complete configuration file with all sections:
Replace all API keys in your configuration file with appropriate placeholders or environment variable references: