CYGNET: Cypher Gate for Neural Execution Triage and Cost Containment
Title: CYGNET: A Cypher Gate for Neural Execution Triage and Cost Containment
Abstract:
When language models operate as agents over knowledge graphs, they frequently generate Cypher queries that suffer from structural failures—causing database crashes—or semantic errors, where queries execute but yield incorrect results. To address this, we introduce a pre-execution gate positioned between query generation and a production Neo4j database. This gate ensures structural integrity via a four-backend validation chain, culminating in execution against a mirror graph with a median latency of just 5.6 ms. Queries that fail structural checks are directed to a corrector, which leverages a language model to iteratively process structured error feedback.
Evaluated across seven CypherBench schemas (comprising 2,348 questions from ACL 2025), the pipeline preserves generation accuracy for every model tested, demonstrating its efficacy as a reliable defensive layer. The corrector component achieves success rates ranging from 81% to 95% across five different models, with a mean performance of 89%. Furthermore, testing on a template-generated corpus spanning nine schemas revealed that the gate successfully identifies 100% of parse errors, constraint violations, and schema-reference errors in path queries with labeled endpoints, recording zero false positives across 1,135 queries. Notably, property sibling-swaps—where the substituted name remains valid for the target label—score 0%, highlighting the formal threshold where structural validation concludes and semantic validation must take over. Additionally, a planner-based cost gate is employed to detect catastrophic plan structures prior to execution.
Source: arXiv Generated at: 2026-06-04 00:00:00 UTC



