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¶
Optional integrations are installed as extras:
How it works¶
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¶
- Download the editable DOCX usage handbook for a progressive course with complete framework scripts and advanced tuning examples.
- Follow the comprehensive usage guide for executable examples of every public feature.
- Use the API reference for signatures and source-level contracts.
- Read the system architecture and technical design before extending the engine.
- Review the environment reference before running durable or provider-backed studies.
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.