Agentic AutoRAG: RAG Pipeline Optimization through Reasoning-Driven Agents
Abstract
Configuring a retrieval-augmented generation (RAG) pipeline is an expensive hyperparameter optimization problem over many interacting choices. Existing optimizers reduce each trial to an aggregate score and search without modeling why a configuration performed as it did. We introduce Agentic AutoRAG, an LLM-agent optimizer that proposes configurations scored on a frozen exam from the corpus: after each trial a Diagnoser attributes each failed question to retrieval or generation, and a Proposer, grounded in a knowledge base of model rankings and pricing, selects the next configuration, weighing accuracy against cost. On three multi-hop QA benchmarks it reaches higher LLM-judge accuracy than every baseline we compare, and within its first 10 trials it matches or beats the statistical baselines' full 30-trial judge accuracy. In its cost-aware mode on a real-world healthcare corpus it reaches a median exam accuracy of 77%, above the strongest baseline's 71.5%, at 58% of that baseline's per-query cost, and matches that 71.5% at 22% of the cost.