TLDR: The Multi-Agent GraphRAG system is a new framework that allows large language models (LLMs) to generate accurate Cypher queries from natural language questions for Labeled Property Graph (LPG) databases. Unlike previous GraphRAG methods that focused on RDF graphs, this system uses a modular, multi-agent architecture with iterative feedback and verification to improve query accuracy. It consistently outperforms traditional LLM baselines and has been successfully applied to real-world engineering data, like building information models (IFC data), demonstrating its potential for industrial automation.
In the evolving landscape of artificial intelligence, a new approach is gaining traction for how large language models (LLMs) interact with complex, structured information. While traditional Retrieval-Augmented Generation (RAG) systems typically draw insights from unstructured documents, an emerging paradigm known as GraphRAG seeks to harness the power of structured data, specifically knowledge graphs.
Most current GraphRAG initiatives have concentrated on Resource Description Framework (RDF) knowledge graphs, which rely on triple representations and SPARQL queries. However, the significant potential of Cypher and Labeled Property Graph (LPG) databases as scalable and efficient reasoning engines within GraphRAG pipelines has remained largely unexplored. A recent research paper, Multi-Agent GraphRAG: A Text-to-Cypher Framework for Labeled Property Graphs, addresses this gap by introducing a novel system designed to bridge natural language with LPG-based graph data.
Understanding Labeled Property Graphs (LPGs)
Property graphs are a type of NoSQL database designed to manage data that is inherently graph-structured. They represent interlinked entities with rich semantics, using nodes (vertices) and edges (relationships). Both nodes and edges can have properties, which are key-value pairs, and labels, which categorize them. This model offers a highly expressive way to represent complex data, supporting flexible schemas and native compatibility with powerful declarative graph query languages like Cypher.
Introducing Multi-Agent GraphRAG
The proposed Multi-Agent GraphRAG system is a modular LLM agentic framework for generating Cypher queries from natural language. It acts as a natural language interface to LPG-based graph data, utilizing Memgraph as its graph database backend. The system features an LLM-based workflow for automated Cypher query generation and execution. A key innovation is its iterative content-aware correction and normalization, reinforced by an aggregated feedback loop, which ensures both semantic and syntactic refinement of the generated queries.
How the System Works: A Collaborative Agentic Approach
The Multi-Agent GraphRAG system operates through a collaboration of seven specialized agents and a graph database query executor module:
- Query Generator: Formulates the initial Cypher query based on the user’s natural language question and the provided graph schema. It refines queries based on feedback in subsequent iterations.
- Graph Database Executor: Interfaces with the Memgraph database to execute the generated Cypher query and retrieve results, error messages, or empty sets.
- Query Evaluator: An LLM-based critic that assesses the semantic and logical adequacy of the query against the user’s intent and the correctness of the results. It provides structured feedback and assigns a grade (Accept, Incorrect, Error or Empty).
- Named Entity Extractor: Identifies elements within the query, such as node labels, property-value pairs, and relationship types, that are prone to hallucination.
- Verification Module: Verifies the existence and correctness of extracted schema elements against the actual graph data, programmatically and with LLM assistance for semantic ranking and suggestions.
- Instructions Generator: Synthesizes revision instructions for the Query Generator based on verification results, focusing on hallucinated or misnamed entities.
- Feedback Aggregator: Integrates outputs from both the Query Evaluator and Verification Module into a unified, prioritized correction strategy.
- Interpreter: For accepted queries, this module generates a concise, domain-relevant natural language answer.
This self-correction loop, operating over a maximum of four iterations, progressively enhances query accuracy and semantic alignment by integrating feedback from semantic validation and data-level verification. The graph database schema is explicitly incorporated into the Query Generator’s prompt, often formatted to resemble Cypher syntax, which significantly improves generation quality.
Real-World Applications and Performance
The system was evaluated on the CypherBench graph dataset, covering several general domains with diverse query types. Additionally, its performance was demonstrated on a property graph derived from IFC (Industry Foundation Classes) data, which represents a digital twin of a building. This highlights the approach’s potential to bridge AI with real-world applications at scale, enabling industrial digital automation use cases, particularly in the Architecture, Engineering, and Construction (AEC) sector.
Experimental results showed that the Multi-Agent GraphRAG pipeline consistently outperformed linear-pass LLM baselines across all tested models (Gemini 2.5 Pro, GPT-4o, Qwen3 Coder, and GigaChat 2 MAX) and domains. On average, the agentic workflow yielded noticeable improvements in accuracy, demonstrating that iterative refinement, verification, and semantics-syntax feedback aggregation significantly enhance structured query generation capabilities.
Also Read:
- Unlocking Deeper Insights: AGRAG’s New Approach to Retrieval-Augmented Generation
- TeaRAG: Enhancing Language Models with Efficient Retrieval and Reasoning
Challenges and Future Directions
Despite its strengths, the system faces limitations, particularly in handling complex compositional queries involving disjunctions or symmetric relationships, and multi-intent questions that require decomposing distinct subgoals. Addressing these challenges may involve explicit query planning or intermediate symbolic representations of query intent.
In conclusion, the Multi-Agent GraphRAG system offers a robust solution for text-to-Cypher question answering over property graph databases. By combining modular LLM-agentic components with an iterative refinement loop, it significantly improves query accuracy and robustness, expanding the utility of LLM-based structured querying beyond traditional frameworks and into critical industry applications.


