Use this file to discover all available pages before exploring further.
RAGOpt is a Python optimization framework that eliminates manual hyperparameter guesswork in your RAG pipelines.
It uses Bayesian optimization to systematically tune over 20+ hyperparameters, from chunk size and overlap to model selection and embedding strategies automatically discovering the best configurations for your specific use case
Optimizing Retrieval-Augmented Generation (RAG) pipelines is complex and highly dependent on configuration choices that impact quality, latency, and cost.
Unlike AutoRAG, which relies on grid search, or Ragas, which enforces rigid evaluation frameworks, RAGOpt is partially opinionated: it provides smart defaults while staying flexible with any LangChain-compatible model or provider.RAGOpt helps answer a question like:
What’s the best RAG configuration to minimize cost and latency while maintaining accuracy and safety ?
For example, here’s you can get best RAG configurations in a few iterations using RAGOpt optimizer:
from rag_opt.dataset import TrainDatasetfrom rag_opt.optimizer import Optimizer# First you have to run generate_questions_.py# to get a list of QAs to be used in the evaluation process# Load the training dataset (questions/answers)train_dataset = TrainDataset.from_json("rag_dataset.json")# Initialize the optimizeroptimizer = Optimizer(train_dataset=train_dataset,config_path="rag_config.yaml",verbose=True)# Run optimization# Increase n_trials for better resultsbest_config = optimizer.optimize(n_trials=2, best_one=True,plot_hypervolume=True)best_config.to_json()
This will give you the optimal RAG configuration for your dataset.