Back to the stack guide
Knowledge graph

Neo4j PropertyGraphIndex

Vectors answer “what is similar?”; the graph answers “what is connected, and how?” — prerequisites and learning paths are relational, so they live in Neo4j.

Why a graph next to a vector store

Some questions embeddings can't answer no matter how good the vectors are: what are the prerequisites of X, transitively? what does this lesson unlock? which concepts bridge these two topics? Those are traversals, not similarity lookups. This platform keeps both: Qdrant for "similar to this", Neo4j for "connected to this".

Ingestion: extraction is generation, so it's gated

Lessons and parsed docs flow through LlamaIndex's PropertyGraphIndex with LLM-driven entity/relation extraction into Neo4j AuraDB. Extraction prompts pin the allowed node and edge types — concepts, lessons, techniques, papers; prerequisite/covers/cites edges — so the model can't invent schema.

And because extraction is LLM output like any other, it passes the same deterministic + judge gates before landing. In a learning-path graph a hallucinated edge is worse than a missing one: it sends a learner down a wrong path confidently.

Query: two retrievers, fused

  • TextToCypher — natural language to Cypher for structural questions ("what depends on X?"). Powerful, and treated with respect: generated Cypher is still generated code, so it runs schema-constrained and read-only.
  • VectorContext — embedding similarity over graph nodes for fuzzy, conceptual questions that don't map to a clean traversal.

Fusing the two at the answer level is the pragmatic version of GraphRAG: vector retrieval for context, graph retrieval for structure, without a monolithic pipeline in between.

Why Neo4j

The graph store had to satisfy the same discipline as the rest of the stack: a first-class LlamaIndex PropertyGraphIndex backend (so ingestion and retrieval reuse the pipeline's primitives instead of a bespoke loader), a declarative query language a model can be constrained in — generated Cypher runs schema-pinned and read-only, the same posture as the SQL guards — and a managed deployment (AuraDB) so the graph adds zero operational surface next to Qdrant.

Where it surfaces

The graph powers the platform's interactive graph view — concept nodes, prerequisite edges, lesson links — and feeds recommendation lanes that need to know what a learner is ready for, not just what's textually similar to what they last read. The full extraction-to-query walkthrough is the Knowledge Graph guide.

Numbers

  • Extraction schema pinned to four node types (concepts, lessons, techniques, papers) and three edge families (prerequisite / covers / cites) — the model can't invent schema.
  • Two retrievers fused at the answer level: TextToCypher for structure, VectorContext for similarity.
  • Generated Cypher runs with zero write access — read-only, schema-constrained, like any other generated code here.