run-llama/llama_index · error · NotImplementedError

Vector query not implemented for SimplePropertyGraphStore.

Error message

Vector query not implemented for SimplePropertyGraphStore.

What it means

SimplePropertyGraphStore is the default in-memory property graph store in llama-index-core. It keeps nodes and triplets in Python dicts/networkx but performs no embedding computation, so the vector_query interface required by PropertyGraphStore subclasses is intentionally left unimplemented. Calling vector_query (directly or via a retriever that needs similarity search over graph nodes) raises NotImplementedError.

Source

Thrown at llama-index-core/llama_index/core/graph_stores/simple_labelled.py:251

    def get_schema(self, refresh: bool = False) -> str:
        """Get the schema of the graph store."""
        raise NotImplementedError(
            "Schema not implemented for SimplePropertyGraphStore."
        )

    def structured_query(
        self, query: str, param_map: Optional[Dict[str, Any]] = None
    ) -> Any:
        """Query the graph store with statement and parameters."""
        raise NotImplementedError(
            "Structured query not implemented for SimplePropertyGraphStore."
        )

    def vector_query(
        self, query: VectorStoreQuery, **kwargs: Any
    ) -> Tuple[List[LabelledNode], List[float]]:
        """Query the graph store with a vector store query."""
        raise NotImplementedError(
            "Vector query not implemented for SimplePropertyGraphStore."
        )

    @property
    def client(self) -> Any:
        """Get client."""
        raise NotImplementedError(
            "Client not implemented for SimplePropertyGraphStore."
        )

    def save_networkx_graph(self, name: str = "kg.html") -> None:
        """Display the graph store, useful for debugging."""
        import networkx as nx

        G = nx.DiGraph()
        for node in self.graph.nodes.values():
            G.add_node(node.id, label=node.id)
        for triplet in self.graph.triplets:

View on GitHub (pinned to afd0fef371)

Solutions

  1. Switch to a graph store that supports vector queries, e.g. Neo4jPropertyGraphStore, KuzuPropertyGraphStore, or FalkorDBPropertyGraphStore, passed via PropertyGraphIndex(..., graph_store=store).
  2. Avoid vector retrieval over graph nodes with the simple store; rely on text/keyword-based retrieval (e.g. LLMSynonymRetriever or default text-to-cypher paths that don't need vector_query).
  3. Subclass SimplePropertyGraphStore and implement vector_query yourself (e.g. by embedding node text with Settings.embed_model and ranking with numpy) if you must stay in-memory.
  4. Persist the graph and reload it into a real backend: simple_store.save_networkx_graph / persist, then construct the external store and use it.

Example fix

# before
index = PropertyGraphIndex.from_documents(docs)  # defaults to SimplePropertyGraphStore
nodes, scores = index.property_graph_store.vector_query(query)  # NotImplementedError

# after
from llama_index.graph_stores.neo4j import Neo4jPropertyGraphStore
graph_store = Neo4jPropertyGraphStore(username, password, url)
index = PropertyGraphIndex.from_documents(docs, property_graph_store=graph_store)
nodes, scores = graph_store.vector_query(query)
Defensive patterns

Strategy: type-guard

Validate before calling

from llama_index.core.graph_stores import SimplePropertyGraphStore
store = index.property_graph_store
supports_vector = not isinstance(store, SimplePropertyGraphStore)

Type guard

def supports_vector_query(store) -> bool:
    return type(store).vector_query is not SimplePropertyGraphStore.vector_query

Try / catch

try:
    nodes, scores = store.vector_query(q)
except NotImplementedError:
    nodes, scores = [], []  # fall back to text-based graph retrieval

Prevention

When it happens

Trigger: Calling simple_store.vector_query(query) directly; using PropertyGraphIndex with a retriever that falls back to node-level vector search (e.g. VectorContextRetriever or synth queries) while the graph store is the default SimplePropertyGraphStore; any code path that assumes every PropertyGraphStore supports vector queries.

Common situations: Building a PropertyGraphIndex without specifying graph_store and then attempting vector/similarity retrieval over graph nodes; writing store-agnostic code against PropertyGraphStore and testing only against a real backend (Neo4j, Kuzu, FalkorDB) before running against the simple store.

Related errors


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/cbce2ae33f59655c. Report an issue: GitHub.