Back openDesk Edu for a sovereign, open-source education β every vote counts.
Vote nowNatural language β SQL (NL2SQL) has been a research staple for a decade. In 2026, the graph world is getting its own version β and it is accelerating faster than anything else in the corpus.
Graph Query Languages is the fastest-growing category in the graph-research corpus (+262% year-over-year; 163 papers in the last 12 months). Within that category, NL2GQL β translating natural language into GQL, Cypher, PGQL or SPARQL β is the single largest source of new papers, and it has just acquired what NL2SQL had for years: proper benchmarks.
The NL2SQL story repeated itself: first benchmarks (Spider), then transfer models, then LLM-based approaches, then agentic orchestration. NL2GQL is at the same point in its lifecycle β except it is arriving with better foundation models than NL2SQL ever had.
| Era | NL2SQL | NL2GQL |
|---|---|---|
| Benchmarks | Spider (2018) | GQLBench (2026) |
| Core pain | Dialect variance | Dialect variance Γ 3 (Cypher, GQL, SPARQL) |
| Early models | Seq2seq encoders | RΒ³-NL2GQL (2023), MoMQ (2025) |
| LLM era | Schema-linking + in-context | Alignment fine-tunes, agent frameworks |
| Agent era | Multi-agent orchestration | NAT-NL2GQL, Multi-Agent GraphRAG Text2Cypher |
Two structural facts make graph query generation harder β and more interesting β than NL2SQL:
The field's biggest event in 2026 is the arrival of public benchmarks. GQLBench gives NL2GQL what Spider gave NL2SQL: a large-scale, cross-domain, cross-dialect evaluation set. The research corpus shows three distinct benchmark-driven threads:
The meta-point for practitioners: if you want to evaluate an LLM-powered graph query layer, you no longer have to build the benchmark yourself. GQLBench-style evaluation should be the default starting point for a production Text2Cypher acceptance test.
The 2025β2026 alignment papers share one finding: generic LLM instruction-tuning does not produce reliable Cypher/GQL. Alignment against a domain-specific graph database (with real node labels, relationship types, and query patterns) is what moves the needle. This matches what production teams observe: a RAG layer over schema documentation helps, but a fine-tune on actual query logs helps more.
SPARQL Query Generation with LLMs: Measuring the Impact of Training Data Memorisation (2025) shows that LLMs can memorise training queries and regurgitate them under distribution shift. For graph queries this is worse than for SQL: a memorised query references nodes and properties that may not exist in your database. Verification β executing the query against a schema or a test instance β is not optional.
The strongest 2026 systems are iterative: generate β execute against a sandbox β parse errors β retry. Multi-Agent GraphRAG: A Text2Cypher Framework for Labeled Property Graphs and Toward Multi-Database Query Reasoning for Text2Cypher (2026) both converge on execution-grounded refinement. The query generator is no longer a one-shot translation; it is a loop.
A production-ready NL2Cypher layer needs four components: schema context, a translation step, an execution sandbox, and a verification loop.
from neo4j import GraphDatabase
from openai import OpenAI
SCHEMA_PROMPT = """
You are translating natural language into Cypher for a Neo4j graph database.
Schema:
- Node labels: Person, Company, Investment, Product
- Relationships:
- (Person)-[:FOUNDED]->(Company)
- (Company)-[:RECEIVED_INVESTMENT]->(Investment)
- (Company)-[:PRODUCES]->(Product)
Rules:
- Use only node labels and relationship types from the schema above.
- Never invent properties. If a property is ambiguous, ask instead of guessing.
- Return only the Cypher query, no explanation.
"""
def text_to_cypher(question, client, retries=2):
"""Generate Cypher with execution-feedback verification."""
messages = [
{"role": "system", "content": SCHEMA_PROMPT},
{"role": "user", "content": question},
]
for attempt in range(retries):
query = client.chat.completions.create(
model="gpt-4o", messages=messages, temperature=0
).choices[0].message.content.strip()
# Verify by parsing β catches malformed Cypher cheaply
if not is_valid_cypher(query):
messages.append({"role": "assistant", "content": query})
messages.append({
"role": "user",
"content": "The query above failed to parse. Fix the syntax error and return only the corrected Cypher.",
})
continue
return query
raise RuntimeError("Failed to generate valid Cypher")
The critical detail is the verification loop: cheap syntactic validation (via the driver's query parser) catches most failures before they reach the database. For semantic validation, add a sandbox read-only transaction that runs the query against a test fixture.
| Concern | Recommendation |
|---|---|
| Dialect lock-in | Pick one dialect per environment. Cypher for Neo4j, GQL for GQL engines, SPARQL for RDF. Don't build a universal translator first. |
| Cost | Cache questionβquery pairs. Fine-tuned small models (7Bβ32B) beat large-model prompting per-query on cost once volume is significant. |
| Security | Generated queries must never run with write privileges by default. Read-only roles + query allow-listing + query timeout. |
| Evaluation | Build a GQLBench-style test set from your own query logs (β₯100 curated pairs), and gate deploys on accuracy. |
| Observability | Log the generated query + the question + execution result for every call. This is your fine-tuning dataset of the future. |
| Humans in the loop | Show the generated query in the UI ("Query preview") β surprising levels of accuracy gain come from letting users accept/correct. |
The 2026 trajectory is clear: NL2GQL is becoming an agent tool, not a standalone feature. In agentic GraphRAG architectures, the LLM does not just translate a question into a query β it decides whether to query the graph, which pattern to try, and when to retry based on results.
This changes the evaluation story again. Benchmark accuracy on a fixed questionβquery set stops being the metric; instead you measure task completion (did the agent answer the user's question correctly?) and query efficiency (how many wasted query executions per answer?).
For teams building agents over property graphs, this is the headline: your agent's ceiling is bounded by your NL2GQL accuracy. Every bad query the agent issues is a wasted step; every hallucinated node label is a failed tool call.
The corpus has only 13 review papers in the entire graph-query-languages category β 77% of them in the last 12 months. That means:
These are exactly the gaps a practitioner-oriented site can own: benchmark the tools on real data, report dialect-specific accuracy, and track the agent integration story as it unfolds.
Evidence base: graph-research corpus β 352 papers in Graph Query Languages, 163 in the last 12 months (+262% YoY), 37 with explicit GQL content. See the GQL deep-dive investigation for the full analysis.