Domain-Agnostic Translation of Natural Language Text to Cypher Query Language for GraphRAG

preprint OA: closed
Full text JSON View at publisher

Abstract

Abstract GraphRAG is a retrieval-augmented generation (RAG) framework that leverages knowledge graphs. Among the various knowledge retrieval techniques used with GraphRAG, subgraph retrieval using Cypher queries is employed by SubGraph Retrieval Augmented Generation (SG-RAG). However, SG-RAG relies on manually crafted Cypher templates, which limits its practicality and scalability in real-world applications. To address this limitation, we propose a domain-agnostic Text-to-Cypher (Text2Cypher) translation model as a flexible subgraph retrieval mechanism for SG-RAG and other GraphRAG-based methods. Due to the absence of large-scale, multi-domain Text2Cypher datasets, we generate a synthetic multi-domain Text2Cypher dataset and fine-tune a large language model (LLM) on this data. Furthermore, we introduce a GPT-based evaluation metric that does not require access to a populated graph database. We evaluate the fine-tuned model on both the generated dataset and the MetaQA benchmark. Experimental results demonstrate that our model significantly outperforms open-source generative LLMs across multiple few-shot settings, as well as the Text2Cypher model proposed by Neo4j. Finally, we analyze the correlation between the proposed GPT-based evaluation metric and execution-based F1 scores on MetaQA using the Pearson correlation coefficient, revealing a strong positive correlation.
Full text 10,387 characters · extracted from preprint-html · click to expand
Domain-Agnostic Translation of Natural Language Text to Cypher Query Language for GraphRAG | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Domain-Agnostic Translation of Natural Language Text to Cypher Query Language for GraphRAG Ahmmad O. M. Saleh, Gokhan Tur, Yucel Saygin This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8594899/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract GraphRAG is a retrieval-augmented generation (RAG) framework that leverages knowledge graphs. Among the various knowledge retrieval techniques used with GraphRAG, subgraph retrieval using Cypher queries is employed by SubGraph Retrieval Augmented Generation (SG-RAG). However, SG-RAG relies on manually crafted Cypher templates, which limits its practicality and scalability in real-world applications. To address this limitation, we propose a domain-agnostic Text-to-Cypher (Text2Cypher) translation model as a flexible subgraph retrieval mechanism for SG-RAG and other GraphRAG-based methods. Due to the absence of large-scale, multi-domain Text2Cypher datasets, we generate a synthetic multi-domain Text2Cypher dataset and fine-tune a large language model (LLM) on this data. Furthermore, we introduce a GPT-based evaluation metric that does not require access to a populated graph database. We evaluate the fine-tuned model on both the generated dataset and the MetaQA benchmark. Experimental results demonstrate that our model significantly outperforms open-source generative LLMs across multiple few-shot settings, as well as the Text2Cypher model proposed by Neo4j. Finally, we analyze the correlation between the proposed GPT-based evaluation metric and execution-based F1 scores on MetaQA using the Pearson correlation coefficient, revealing a strong positive correlation. Large Language Model GraphRAG Knowledge Graph Cypher Query Knowledge Retrieval Text2Cypher Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8594899","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":574265099,"identity":"9c23a1ea-e285-418a-a198-1d6bf17dbca4","order_by":0,"name":"Ahmmad O. M. Saleh","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA5ElEQVRIiWNgGAWjYDACCRDBZgNlGADZIJqHsJY00rUchjJgAJ8W/tndqRt+lJ2355/d/OzBj4LDeXwSCYwP3rbhseTO2W03e87dTpxx55i5YY/B4WI2iQRmw7l4tDDcyN12g7ftdgLDjQQzaQaDw4ltPAfYpHnxaJEHarn5t+2cvfyN9G8wLey/8WkxAGq5zdt2gHHDjRyoLewNbMz4tBiCtMicS07ceOdMmWSPQTpQS2Oz5JxzuLXIgRz2pszOXu52+zaJH3+sE+c3Mx/88KYMj/exAMYG0tSPglEwCkbBKMAAAH2zVf072Ko+AAAAAElFTkSuQmCC","orcid":"","institution":"Sabanci University","correspondingAuthor":true,"prefix":"","firstName":"Ahmmad","middleName":"O. M.","lastName":"Saleh","suffix":""},{"id":574265100,"identity":"1ba4ec5b-f967-486c-b157-186a671d33c0","order_by":1,"name":"Gokhan Tur","email":"","orcid":"","institution":"University of Illinois Urbana-Champaign","correspondingAuthor":false,"prefix":"","firstName":"Gokhan","middleName":"","lastName":"Tur","suffix":""},{"id":574265101,"identity":"d48748d0-b793-4389-8d79-58c5f699f0b6","order_by":2,"name":"Yucel Saygin","email":"","orcid":"","institution":"Sabanci University","correspondingAuthor":false,"prefix":"","firstName":"Yucel","middleName":"","lastName":"Saygin","suffix":""}],"badges":[],"createdAt":"2026-01-13 18:23:11","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8594899/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8594899/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":102393898,"identity":"c1aa51c3-4cff-4423-9b77-04b6b266c8b5","added_by":"auto","created_at":"2026-02-11 09:13:32","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":2810564,"visible":true,"origin":"","legend":"","description":"","filename":"AhmmadCypherQueryGeneration.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8594899/v1_covered_08233c0e-52c1-471c-8ab8-2988155bbe3b.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Domain-Agnostic Translation of Natural Language Text to Cypher Query Language for GraphRAG","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Large Language Model, GraphRAG, Knowledge Graph, Cypher Query, Knowledge Retrieval, Text2Cypher","lastPublishedDoi":"10.21203/rs.3.rs-8594899/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8594899/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"GraphRAG is a retrieval-augmented generation (RAG) framework that leverages knowledge graphs. Among the various knowledge retrieval techniques used with GraphRAG, subgraph retrieval using Cypher queries is employed by SubGraph Retrieval Augmented Generation (SG-RAG). However, SG-RAG relies on manually crafted Cypher templates, which limits its practicality and scalability in real-world applications. To address this limitation, we propose a domain-agnostic Text-to-Cypher (Text2Cypher) translation model as a flexible subgraph retrieval mechanism for SG-RAG and other GraphRAG-based methods. Due to the absence of large-scale, multi-domain Text2Cypher datasets, we generate a synthetic multi-domain Text2Cypher dataset and fine-tune a large language model (LLM) on this data. Furthermore, we introduce a GPT-based evaluation metric that does not require access to a populated graph database. We evaluate the fine-tuned model on both the generated dataset and the MetaQA benchmark. Experimental results demonstrate that our model significantly outperforms open-source generative LLMs across multiple few-shot settings, as well as the Text2Cypher model proposed by Neo4j. Finally, we analyze the correlation between the proposed GPT-based evaluation metric and execution-based F1 scores on MetaQA using the Pearson correlation coefficient, revealing a strong positive correlation.","manuscriptTitle":"Domain-Agnostic Translation of Natural Language Text to Cypher Query Language for GraphRAG","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-02-09 03:13:56","doi":"10.21203/rs.3.rs-8594899/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"7f145d4b-f043-49e4-bcea-5a5e135e03af","owner":[],"postedDate":"February 9th, 2026","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-02-11T09:13:02+00:00","versionOfRecord":[],"versionCreatedAt":"2026-02-09 03:13:56","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8594899","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8594899","identity":"rs-8594899","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2026) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00