Graph Query Generation with Constraint-guided Large Language Agents
Mengying Wang, Nicolaas Jedema, Rahul Pandey, RaviKiran Krishnan, Jens Lehmann, Yinghui Wu

TL;DR
UniQGen is a new framework that uses large language models and a dynamic query optimization algorithm to generate accurate, executable graph queries across languages without fine-tuning, improving KGQA performance.
Contribution
It introduces UniQGen, a constraint-based, LLM-guided query generation method that outperforms existing techniques and is adaptable to schema-less graphs without fine-tuning.
Findings
Achieves 31.6% F1 improvement on GraphQ benchmark.
Outperforms state-of-the-art in accuracy and efficiency.
Does not require schema matching fine-tuning.
Abstract
Knowledge Graph Question Answering (KGQA) has advanced through structured query generation, yet most efforts target RDF/SPARQL, leaving Cypher and property graphs underexplored, despite increasing demand for unified KGQA in industry settings. We propose UniQGen, a novel constraint-based framework that employs LLM agents to dynamically extract and refine representative graph query clauses into executable, intent-aligned graph queries across query languages. The foundation of our method is a variant of Chase & Backchase, a family of algorithms for query optimization and reformulation. We extend Chase & Backchase with a dynamic reasoning process over query constraints that also interact with LLMs for query quality estimation. With a Cypher-supported Freebase graph deployed on Amazon Neptune, we extensively evaluate our approach on popular KGQA benchmarks (GraphQ, GrailQA, and WebQSP). We…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
