When RAG Meets Query Planning: Logical Query Trees for Resolving Exploratory Reasoning Problems

📅 2026-07-01
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitations of traditional retrieval-augmented generation (RAG) in handling highly uncertain exploratory reasoning problems (ERPs), where it is prone to retrieval noise and error propagation due to the absence of an end-to-end query planning mechanism. To overcome this, the authors propose PlanRAG, a novel framework that introduces database-inspired query planning into RAG for the first time. PlanRAG formalizes complex natural language queries as logical query trees (LQTs) and constructs high-quality LQTs using a multidimensional cost model combined with dynamic programming. It then executes a concurrent, iterative pipeline of retrieval, rewriting, aggregation, and generation, enabling parallel processing of subqueries. Evaluated on the newly introduced WikiWeb-ERP dataset, PlanRAG significantly outperforms existing iterative and graph-based RAG approaches, demonstrating its effectiveness and superiority in exploratory reasoning tasks.
📝 Abstract
Retrieval-Augmented Generation (RAG) effectively grounds large language models (LLMs) in external knowledge but struggles with \textbf{exploratory reasoning problems (ERPs)} that are the complex queries involving high uncertainty and ambiguity. Resolving ERPs requires complex reasoning with unclear paths, tending to result in retrieval noise and error accumulation. Furthermore, the absence of an end-to-end planning mechanism makes it difficult to generate effective trajectories for ERPs. Motivated by database query planning, we introduce \emph{PlanRAG}, an RAG framework that models ERPs of natural language as \textbf{logical query trees (LQTs)}. However, translating ERPs into LQTs is non-trivial due to representation and optimization gaps between structured SQL and unstructured natural language, making it highly challenging to construct high-quality LQTs. To address these problems, we first decompose ERPs into atomic queries and then organize them into LQTs using dynamic programming guided by a cost model involving multiple complementary dimensions. Finally, we execute iterative aggregation, rewriting, retrieval, and generation over LQTs, processing nodes concurrently and propagating intermediate results upward, with further parallelization across multiple threads for efficiency. Our experimental results show that PlanRAG outperforms state-of-the-art iteration-based and graph-based RAG systems on our newly constructed dataset, \textbf{WikiWeb-ERP}, thereby providing a new formulation for optimizing natural language queries. Our source code and dataset are available at https://anonymous.4open.science/r/PlanRAG-main-B2C8/.
Problem

Research questions and friction points this paper is trying to address.

exploratory reasoning problems
retrieval-augmented generation
logical query trees
query planning
reasoning uncertainty
Innovation

Methods, ideas, or system contributions that make the work stand out.

PlanRAG
Logical Query Trees
Exploratory Reasoning Problems
Query Planning
Retrieval-Augmented Generation
G
Ganlin Xu
School of Computer Science, Fudan University, Shanghai, China
L
Linghao Zhang
School of Computer Science, Fudan University, Shanghai, China
Z
Zhitao Yin
School of Computer Science, Fudan University, Shanghai, China
H
Hongda Xi
School of Computer Science, Fudan University, Shanghai, China
C
Chen Yang
School of Computer Science, Fudan University, Shanghai, China
Jiaqing Liang
Jiaqing Liang
Fudan University
knowledge graphdeep learning
Weijia Lu
Weijia Lu
Senior Research Scientist, AI Lab, Tencent
Artificial IntelligenceSignal ProcessingFEMElectrophysiologyUltrasonics
Sihang Jiang
Sihang Jiang
Fudan University
Knowledge GraphLarge Language Models
Y
Yanghua Xiao
College of Computer Science and Artificial Intelligence, Fudan University, Shanghai, China
Deqing Yang
Deqing Yang
School of Data Science, Fudan University