Skip to content

TunaRAG Python

Find the best configuration for your existing RAG application.

TunaRAG is a Python-first optimization toolkit for retrieval-augmented generation systems. Attach a LangChain, LangGraph, or Google ADK RAG pipeline; define the configurations to explore; and measure the tradeoff between answer quality, cost, and latency.

Get started Read the API reference

What TunaRAG provides

  • Typed optimization


    Search arbitrary typed configuration spaces with deterministic random search or a provider-neutral LLM strategy.

  • Practical evaluation


    Combine custom metrics, optional RAGAS evaluators, and weighted quality, cost, and latency objectives.

  • Durable experiments


    Persist studies and trials in SQLite with retries, caching, resumability, failure isolation, callbacks, and deterministic reports.

  • Framework integrations


    Optimize LangChain, LangGraph, and Google ADK pipelines while your application retains ownership of retrieval, generation, indexes, and credentials.

Install

python -m pip install tunarag-python

Optional integrations are installed as extras:

python -m pip install "tunarag-python[frameworks,ragas,mlflow]"

How it works

Optimization overview: dataset and strategy feed the optimizer, which executes a framework RAG, evaluates results and persists trials.

The optimizer proposes a candidate configuration, runs the user-owned RAG over the evaluation dataset, evaluates its outputs, calculates one benefit-oriented objective, and records the trial. The process stops according to explicit trial, budget, time, score, failure, or stagnation rules.

Start reading

Package boundary

TunaRAG optimizes a RAG application; it does not create or host one. Your application owns its vector database, retriever, generator, provider clients, credentials, and production serving.