{"record":{"id":"c828a142e22118d3","repo":"run-llama/llama_index","slug":"the-provided-graph-store-does-not-support-cypher-q-c828a1","errorCode":null,"errorMessage":"The provided graph store does not support cypher queries.","messagePattern":"The provided graph store does not support cypher queries\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/text_to_cypher.py","lineNumber":81,"sourceCode":"            The template to use for summarizing the response. Defaults to None.\n\n    \"\"\"\n\n    def __init__(\n        self,\n        graph_store: PropertyGraphStore,\n        llm: Optional[LLM] = None,\n        text_to_cypher_template: Optional[Union[PromptTemplate, str]] = None,\n        response_template: Optional[str] = None,\n        cypher_validator: Optional[Callable] = None,\n        allowed_output_fields: Optional[List[str]] = None,\n        include_raw_response_as_metadata: Optional[bool] = False,\n        summarize_response: Optional[bool] = False,\n        summarization_template: Optional[Union[PromptTemplate, str]] = None,\n        **kwargs: Any,\n    ) -> None:\n        if not graph_store.supports_structured_queries:\n            raise ValueError(\n                \"The provided graph store does not support cypher queries.\"\n            )\n\n        self.llm = llm or Settings.llm\n\n        if isinstance(text_to_cypher_template, str):\n            text_to_cypher_template = PromptTemplate(text_to_cypher_template)\n\n        if isinstance(summarization_template, str):\n            summarization_template = PromptTemplate(summarization_template)\n\n        self.response_template = response_template or DEFAULT_RESPONSE_TEMPLATE\n        self.text_to_cypher_template = (\n            text_to_cypher_template or graph_store.text_to_cypher_template\n        )\n        self.cypher_validator = cypher_validator\n        self.allowed_output_fields = allowed_output_fields\n        self.include_raw_response_as_metadata = include_raw_response_as_metadata","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/text_to_cypher.py#L63-L99","documentation":"TextToCypherRetriever generates Cypher from natural language and runs it via graph_store.structured_query, so it validates graph_store.supports_structured_queries at __init__ and refuses stores that cannot run Cypher (e.g. the default SimplePropertyGraphStore).","triggerScenarios":"Building PropertyGraphIndex with an in-memory/simple store (or omitting the store so the default is used) and then constructing TextToCypherRetriever(index=...) or including it in PGRetriever's sub_retrievers=['text_to_cypher'].","commonSituations":"Running examples/tutorials that assume Neo4j while locally using the default store; enabling the default 'text_to_cypher' sub-retriever on an index backed by SimplePropertyGraphStore.","solutions":["Attach a structured-query-capable store: Neo4jPropertyGraphStore, NeptunePropertyGraphStore, or KuzuPropertyGraphStore","Set sub_retrievers=['vector', 'synonym'] (no 'text_to_cypher') when using in-memory stores","For custom stores, set supports_structured_queries = True and implement structured_query()"],"exampleFix":"# before\nindex = PropertyGraphIndex.from_documents(docs)  # default in-memory store\nretriever = TextToCypherRetriever(index=index)  # raises\n\n# after\nfrom llama_index.graph_stores.neo4j import Neo4jPropertyGraphStore\nindex = PropertyGraphIndex.from_documents(\n    docs, property_graph_store=Neo4jPropertyGraphStore(username=..., password=..., url=...)\n)","handlingStrategy":"validation","validationCode":"if index.property_graph_store.supports_structured_queries:\n    sub_retrievers = ['text_to_cypher', 'vector', 'synonym']\nelse:\n    sub_retrievers = ['vector', 'synonym']\nretriever = index.as_retriever(sub_retrievers=sub_retrievers)","typeGuard":"def supports_cypher(store) -> bool:\n    return bool(getattr(store, 'supports_structured_queries', False))","tryCatchPattern":"try:\n    retriever = TextToCypherRetriever(index=index)\nexcept ValueError as e:\n    if 'cypher' in str(e):\n        retriever = index.as_retriever(sub_retrievers=['vector', 'synonym'])\n    else:\n        raise","preventionTips":["Wire a real Neo4j/Kuzu/Neptune store before enabling text_to_cypher","Default sub_retriever lists to non-cypher modes in environments without a graph DB"],"tags":["llama-index","property-graph","cypher","text-to-cypher","graph-store"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}