Hierarchical Planning for Complex Tasks with Knowledge Graph-RAG and Symbolic Verification

Flavio Petruzzellis, Cristina Cornelio, Pietro Lio

Abstract

While Large Language Models (LLMs) excel at generating plausible sequences of actions, they often struggle with the logical rigor and environmental grounding required for long-horizon robotic tasks. This paper explores the HVR framework, a neuro-symbolic approach that integrates Hierarchical task decomposition, Knowledge Graph-based Retrieval-Augmented Generation (KG-RAG), and symbolic Verification. By combining the statistical reasoning of LLMs with formal logic, HVR significantly improves plan correctness and execution success in complex, multi-step environments.

Introduction

The application of LLMs to robotics faces two primary hurdles: the Long-Horizon Gap and Knowledge Blindness. As tasks increase in complexity (e.g., exceeding 40 steps), LLMs tend to lose track of the logical state, often hallucinating object properties or skipping essential preconditions. Furthermore, LLMs lack real-time awareness of their specific environment, leading to plans that are theoretically sound but practically impossible given the current state of the world.

Existing solutions like standard Retrieval-Augmented Generation (RAG) provide facts but do not address the underlying reasoning failures. Conversely, hierarchical planning provides structure but lacks a mechanism for factual grounding. The HVR framework bridges these gaps by anchoring LLM reasoning in a dynamic Knowledge Graph and validating outputs through a symbolic PDDL (Planning Domain Definition Language) checker.

The HVR Framework

The HVR framework is built upon three integrated components designed to enforce logical consistency and environmental grounding:

1. Hierarchical Planning (H)

To prevent the LLM from becoming overwhelmed by long-horizon tasks, HVR employs a "divide and conquer" strategy. The system first generates a Macro-plan consisting of high-level subtasks (e.g., "Pick up the bottle"). Each macro-action is then independently expanded into a sequence of Atomic Actions (e.g., navigate_to, pick_up). This hierarchical structure keeps the LLM's context focused on manageable segments of the overall goal.

2. Knowledge Graph-RAG (R)

The environment is modeled as a dynamic Knowledge Graph using the OntoThor ontology. Before the planning phase, the system performs RAG to retrieve a specific subgraph containing only the objects and states relevant to the current task. This ensures the LLM is grounded in the "ground truth" of the scene, such as whether a fridge is open or where a specific utensil is located.

3. Symbolic Verification (V)

Acting as the system's "logical conscience," the Symbolic Validator uses PDDL to check if a generated plan is physically possible. If the LLM proposes an invalid action—such as placing an item in a closed container—the validator catches the error. The system then "back-prompts" the LLM with a precise error message (e.g., "Precondition 'open' not met"), allowing the model to self-correct and regenerate a valid plan.

Experimental Setup

The researchers evaluated HVR within the AI2Thor simulator, a sophisticated 3D environment for indoor robotics. The study utilized a task suite of 12 tasks:

  • Moderate Complexity (T1–T6): Tasks involving 8–20 steps, such as "Toast bread."
  • High Complexity (T7–T12): Tasks involving up to 41 steps and 10 different objects, such as "Complex plate."

Tasks T11 and T12 were specifically designed to push the limits of current LLM reasoning capabilities, requiring intricate manipulation and long-term state tracking.

Results and Discussion

The integration of HVR led to substantial performance gains across different model architectures:

  • Gemini 1.5 Flash: Achieved a remarkable 94.19% Plan Correctness score with HVR, a massive leap from the 17.72% achieved by the vanilla planner.
  • Phi-3-mini: This smaller, open-source model saw its correctness jump from 11.79% to nearly 60%, demonstrating that HVR can significantly augment the capabilities of resource-constrained models.
  • Execution Success: In simulated trials, HVR-generated plans reached the goal with a 95% success rate. The remaining 5% of failures were attributed to simulator-specific physics glitches rather than logical errors in the plan.

Key Insights

  • Model-Size Synergy: The research revealed a division of labor between components. For smaller models (Phi-3), KG-RAG was the most critical element for providing basic factual grounding. For larger models (Gemini), Hierarchical Planning was the primary driver of success, providing the structural discipline needed for long-horizon reasoning.
  • The "Long Plan" Tax: HVR plans are often longer than the theoretical optimal path. This is because the symbolic correction process frequently inserts necessary safety or navigation steps that the LLM initially overlooked.
  • Effectiveness of Formal Feedback: LLMs proved highly capable of fixing their own mistakes when provided with precise, symbolic reasons for failure, validating the neuro-symbolic feedback loop.

Conclusion and Future Work

The HVR framework demonstrates that combining the intuitive reasoning of LLMs with the rigid logic of symbolic AI creates a more reliable robotic planner. While the system currently requires manually defined PDDL conditions, future work will focus on enabling LLMs to infer these symbolic rules directly from environment interactions. Additionally, moving HVR from simulated environments to physical hardware remains a key priority to test the framework's resilience against real-world sensor noise.

Summary updated

BibTeX
@inproceedings{petruzzellis2025hierarchical,
  author = {Flavio Petruzzellis and Cristina Cornelio and Pietro Lio},
  title = {{Hierarchical Planning for Complex Tasks with Knowledge Graph-RAG and Symbolic Verification}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=vfqdJy12Kk},
}
Figure