Vector RAG vs GraphRAG: Why Build a Knowledge Graph with Neo4j
Vector RAG can't answer a question when the answer is split across three documents. In this GraphRAG tutorial I turn a folder of ordinary docs into a knowledge graph in Neo4j, then build a retriever that walks the graph two hops out from every chunk it finds. Same local model, same docs, and the question it got wrong comes back right. We also have a code for $250 in free credits for the first 50 users to sign up and follow along: DataAndAIGuy250 What we cover: - Chunking on markdown headings so each chunk keeps its context - Writing the schema before the prompt (6 node labels, 13 directed relationship types) - Structured extraction with Ollama + Pydantic, then throwing out anything that breaks the schema - Entity resolution with an alias file, so "Priya" and "Priya Nair" end up as one person - Loading into Neo4j with MENTIONS edges from each chunk to its entities - VectorRetriever vs VectorCypherRetriever, compared side by side - Keeping the graph clean when you go from 6 docs to 600 The schema file is the part to steal. Drop your own markdown into the docs folder, rewrite schema.py for your company, and run the pipeline. Code & resources AuraDB Free: https://console.neo4j.io Ollama: https://ollama.com neo4j-graphrag: https://pypi.org/project/neo4j-graphrag/ Free GraphRAG course on GraphAcademy:https://graphacademy.neo4j.com/ Chapters 00:00 The question vector search gets wrong 01:10 What we're building 02:30 Setup: AuraDB Free + Ollama 05:00 The source documents 06:30 Chunking on markdown headings 08:00 Schema design: nodes, relationships, properties 10:30 Extraction (and what the model gets wrong) 13:30 Entity resolution 15:30 Loading the graph into Neo4j 18:30 Querying with Cypher 21:30 Vector RAG vs GraphRAG, side by side 23:30 What breaks at scale 24:30 Recap #GraphRAG #Neo4j #KnowledgeGraph