1 Why Vector RAG Fails at Multi-Hop Reasoning
Vector RAG chunks documents into isolated pieces. If Document A mentions "Alice is CEO of TechCorp" and Document B mentions "TechCorp acquired DataFlow", vector similarity cannot answer "Which company did Alice's firm acquire?" because the semantic bridge is severed.
Vector search cannot answer broad queries like "What are the primary recurring compliance risks across all 500 audit reports?" because top-k cosine similarity only fetches specific paragraphs, failing to synthesize holistic corpus patterns.
Extract Entities (Nodes) and Relationships (Edges) into a Knowledge Graph. Cluster interconnected communities using the Leiden algorithm, generating hierarchical summaries that enable both precise local traversals and high-level global sensemaking.
2 Labeled Property Graph & Cypher Fundamentals
Nodes & Labels
Entities in the domain (e.g. (:Person), (:Company), (:Incident)). Each node holds key-value properties such as {name: "Alice", role: "CEO"}.
Relationships & Edges
Directed connections between nodes: -[:MANAGES]->, -[:DEPENDS_ON]->. Relationships can also store properties (e.g. {since: 2024, confidence: 0.95}).
Index-Free Adjacency
Each node directly stores memory pointers to its adjacent neighbor nodes. Traversing 10 hops does not require table joins; it evaluates in O(k) time proportional to degrees, not overall database size.
Cypher Pattern Matching
Declarative graph query language: MATCH (p:Person)-[:WORKS_AT]->(c:Company) WHERE c.name = 'TechCorp' RETURN p.name.
3 Quickstart & Docker Compose (Neo4j 5.x)
Docker Compose Stack
Python Client Installation
Install official Neo4j Bolt driver and LangChain graph utilities:
4 Production Python: Multi-Hop Agent Retrieval
Agent Graph Traversal Tool
5 FAQ
How does GraphRAG combine with Vector Databases? →
-[:DEPLOYED_ON]->, -[:DEPENDS_ON]->), assembling a complete relational context graph before prompt injection.