Papers
Topics
Authors
Recent
Search
2000 character limit reached

Cypher-RAG: Graph Retrieval Augmentation

Updated 15 January 2026
  • Cypher-RAG is a Retrieval-Augmented Generation method that leverages Cypher queries on property graphs for effective graph traversal and tool integration.
  • It combines natural language processing with structured graph querying to deliver improved semantic accuracy and context-aware reasoning.
  • Empirical evaluations show significant gains in execution reliability and explainability across domains like industrial automation and scientific literature.

Cypher-RAG is a class of Retrieval-Augmented Generation (RAG) methodologies in which retrieval is conducted not only over unstructured text but also over Labeled Property Graphs (LPGs) through the use of Cypher query language. This paradigm extends standard text-based RAG through declarative querying, explicit graph traversal, and feedback-driven query refinement, enabling LLM agents to interact with complex structured data and tool ecosystems at runtime. Cypher-RAG techniques are increasingly applied in industrial automation, scientific literature analysis, and agentic tool invocation, demonstrating improvements in semantic grounding, accuracy, and explainability across diverse information retrieval and reasoning tasks (Gusarov et al., 11 Nov 2025, Nagori et al., 30 Jul 2025, Lumer et al., 11 Feb 2025).

1. Foundations and Evolution of Cypher-RAG

Traditional RAG pipelines operate over unstructured document stores, leveraging vector similarity to retrieve context, which is subsequently passed to an LLM for answer generation. Early extensions introduced knowledge graph (KG)-based retrieval, initially focused on RDF triple stores and SPARQL queries. However, Labeled Property Graphs (LPGs) and their native query language Cypher offer substantially greater expressive power: arbitrary node/edge labels, property maps, path patterns, and native multi-hop graph traversal.

Cypher-RAG redefines retrieval in this setting as translation from natural language (NL) queries to Cypher, followed by execution over an LPG to extract graph-structured answers (Gusarov et al., 11 Nov 2025). With the emergence of agentic RAG frameworks (Nagori et al., 30 Jul 2025), LLM agents can now dynamically generate, validate, and refine Cypher queries—frequently in concert with vector and sparse retrieval—enabling hybrid pipelines that are both robust and contextually accurate.

2. System Architectures and Agentic Orchestration

Cypher-RAG systems are characterized by modular, agentic architectures that integrate Cypher-level graph querying as a core retrieval modality:

  • Multi-Agent GraphRAG (Gusarov et al., 11 Nov 2025) features a pipeline of seven LLM-based agents—spanning NL-to-Cypher query generation, semantic and syntactic evaluation, named-entity verification, human-readable feedback aggregation, and final answer synthesis. Each agent operates on well-structured JSON payloads, and control flow is managed via in-context prompting and explicit feedback loops.
  • Hybrid RAG for Scientific Literature (Nagori et al., 30 Jul 2025) employs a Llama-3.3-70B agentic controller to select, per-query, between Cypher-RAG (for KG metadata queries) and VectorRAG (for content-rich free text). Decision logic leverages few-shot tool-selection prompting, producing a softmax distribution over GraphRAG vs. VectorRAG and executing the retrieval mode whose probability exceeds a threshold (Ï„=0.5\tau=0.5).
  • Graph RAG-Tool Fusion (Lumer et al., 11 Feb 2025) incorporates graph traversal (using, e.g., Cypher or Neo4j API calls) within a vector-tool-retrieval pipeline: retrieved candidates are expanded to include all dependency nodes via depth-limited search, explicitly equipping agents for downstream tool invocation.

This agentic design allows dynamic, iterative interaction with the underlying LPG, correction of hallucinated entities, context-aware selection of retrieval mode, and transparent orchestration of data access.

3. Workflow: NL-to-Cypher Mapping and Self-Correction

A central problem in Cypher-RAG is reliably translating natural-language questions to syntactically/semantically correct Cypher queries that are schema-compliant and executable on the target graph. The process involves:

  1. Schema Retrieval and Prompt Construction: The query generator agent is prompted with explicit node/edge schemas (often as Cypher DDL snippets) and few-shot NL-to-Cypher exemplars (Gusarov et al., 11 Nov 2025, Nagori et al., 30 Jul 2025).
  2. LLM-Based Query Generation: An LLM backbone (e.g., Gemini 2.5 Pro, Llama-3.3-70B) generates an initial Cypher candidate given the NL question, schema, and accumulated feedback.
  3. Execution and Evaluation: The Cypher is executed; results, errors, or empty sets are returned to the agentic pipeline.
  4. Semantic and Entity Verification: If the query is incorrect, a Query Evaluator agent identifies logical misalignment and provides feedback. For syntactic or schema errors, a Named Entity Extractor and Verification Module check for hallucinated entities and suggest schema-compliant alternatives using string similarity and semantic embedding ranking (simL\text{sim}_L, simc\text{sim}_c).
  5. Instruction Generation and Aggregated Feedback: Concrete revision instructions are formulated and merged with critique, shaping the next query.
  6. Iterative Refinement: The generator produces an updated Cypher candidate incorporating new feedback. Up to T=4T=4 iterations are typical; convergence is reached on "Accept" status or after the maximum allowed turns.

This iterative self-correcting loop distinguishes Cypher-RAG from linear NL-to-SQL/SPARQL translation, increasing execution success rate and semantic fidelity (Gusarov et al., 11 Nov 2025). For scientific literature KGs, few-shot prompting achieves high Cypher translation accuracy, with domain-adapted instruction tuning further reducing hallucinations (Nagori et al., 30 Jul 2025).

4. Graph Traversal and Tool Selection via Cypher Queries

In tool ecosystems, Cypher-RAG leverages explicit graph traversal to resolve tool dependencies and orchestrate multi-step toolchains:

  • Graph RAG-Tool Fusion (Lumer et al., 11 Feb 2025) represents the tool knowledge base as G=(V,E)G=(V,E) (nodes as tools/APIs, edges as dependency relations). Vector retrieval surfaces initial candidates; Cypher or API-based traversal (e.g., depth-first search subject to dlimitd_{limit}) expands each to all direct/indirect dependencies. Tools are merged and truncated to the final ≤K\leq K list.
  • Scoring of candidate subgraphs incorporates both node retrieval weights and edge-type weights (direct vs. indirect), balanced by a λ\lambda parameter.
  • This approach yields significant performance improvements on benchmarks (ToolLinkOS: mAP@10 = 0.856, +71.7% over naïve RAG), especially in deeply layered tool graphs where dependencies are semantically non-obvious.

A plausible implication is that plug-and-play integration of Cypher-backed graph traversal with vector-based retrieval enables LLM agents to discover and assemble composite toolchains beyond what lexical similarity alone affords.

5. Empirical Evaluation and Performance Metrics

Evaluation of Cypher-RAG pipelines is domain-specific but shares methodological core:

  • Text-to-Cypher Pipelines: Multi-Agent GraphRAG (Gusarov et al., 11 Nov 2025) demonstrates improvements in semantic answer accuracy (Gemini 2.5 Pro: from 67.00% to 77.23% on CypherBench) and execution success rates (+8–12%) using agentic (self-correcting) loops versus single-shot LLM translation.
  • Scientific Literature Review: The agentic hybrid Cypher-RAG framework (Nagori et al., 30 Jul 2025) yields measurable gains in context recall (+0.63), context precision (+0.56), faithfulness (+0.24), and answer relevance (+0.12) for vector store and KG retrieval tasks, with uncertainty quantified via bootstrap.
  • Tool Selection: Inclusion of graph expansion increases mAP@10 from 0.210 (naïve RAG) to 0.856 on ToolLinkOS; LLM reranking further increases this to 0.927 (Lumer et al., 11 Feb 2025).

Metrics employed include answer faithfulness (F=∣V∣/∣S∣F=|V|/|S|), context precision/recall, answer relevance (ARAR via cosine similarity on queries), BLEU, ROUGE, METEOR, BERTScore, and factual consistency. This suggests that Cypher-RAG delivers improvements in both execution reliability and groundedness relative to baseline RAG pipelines.

6. Extensibility, Scalability, and Limitations

Cypher-RAG architectures are natively modular and extensible:

  • Supporting new concepts or attack classes requires only augmenting classifier pools or graph schemas, not retraining the core agent or search/generation logic (Blefari et al., 3 Jul 2025, Gusarov et al., 11 Nov 2025).
  • Dynamic discovery of available labels and endpoints at runtime is achieved through generic tool/system-prompt descriptions.
  • Industrial digital-twin and meta-science settings benefit from scalable storage/compute backends (e.g., Memgraph, persistent Neo4j, FAISS), with per-query latencies under 300 ms even on multi-million entity graphs (Gusarov et al., 11 Nov 2025).

Limitations include persistent challenges in compositional graph queries (e.g., OR/UNION, symmetric patterns), management of multi-intent queries, and propagation of vector retrieval errors into graph traversals. Entity hallucinations are partially mitigated by verification sub-pipelines, but schema evolution and dynamic ontology changes require ongoing adaptation.

7. Practical Implications and Best Practices

Deployment of Cypher-RAG is most effective when best practices are followed (Gusarov et al., 11 Nov 2025, Nagori et al., 30 Jul 2025, Lumer et al., 11 Feb 2025):

  • Prompt LLMs with detailed schema snapshots, including example property values and clear formatting for Cypher constructs.
  • Provide explicit, actionable feedback on semantic and syntactic errors, structured as revision directives to enhance iterative correction.
  • Use hybrid few-shot prompting with ample real-query exemplars for both Cypher and tool selection tasks.
  • Leverage entity verification (fuzzy string matching and semantic reranking) to detect and repair hallucinated or invalid Cypher references.
  • Quantify uncertainty via bootstrap or agentic loops, especially in scientific or safety-critical domains.
  • Modularize pipelines into well-typed API-driven agents, enabling asynchronous orchestration and runtime graph expansion.

Taken together, Cypher-RAG methods exemplify the integration of modern LLMs with declarative graph data access, structured tool invocation, and transparent reasoning over structured and unstructured sources. This enables scalable, explainable, and high-fidelity retrieval-augmented reasoning for complex knowledge domains (Gusarov et al., 11 Nov 2025, Nagori et al., 30 Jul 2025, Lumer et al., 11 Feb 2025, Blefari et al., 3 Jul 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Cypher-RAG Technique.