
The comparison in the title is one I've been asked maybe twenty times in the last six months, and the framing is wrong every time. GraphRAG and Neo4j aren't competitors. GraphRAG is a retrieval pattern — a way of combining vector similarity with graph traversal to feed better context into an LLM. Neo4j is a graph database — a piece of infrastructure where you store and query graphs. You can implement GraphRAG on Neo4j. You can also implement it on SynapCores, on Postgres+Apache AGE, on TigerGraph, or on a custom engine. The right question isn't "which one wins" — it's "for my workload, what's the right architecture?"
This post is that decision. I'll walk through what Neo4j is genuinely excellent at, what implementing GraphRAG on top of it looks like, where the dual-store sync cost (Neo4j + vector DB) starts to hurt, and when a unified engine is the better choice. The examples use Cypher on both sides: on Neo4j for the multi-store path, and on SynapCores for the unified-engine path. The conclusion isn't "pick SynapCores" — it's "pick the architecture that matches your operational appetite."
Try the architecture before expanding your stack. Reproduce the knowledge-base example in this article with sample runbooks, system relationships, and an expected result. Install free and run the example → or inspect the step-by-step recipe first →. Community Edition needs no signup or credit card.
What Neo4j is
Neo4j is the dominant native graph database. It was the first commercially successful one, it invented or popularized Cypher (the graph query language that most other engines now speak), and it has fifteen-plus years of production deployments behind it. The data model is property graphs — typed nodes with properties, typed edges with properties — and the query language is among the most ergonomic any database has ever shipped.
Comparing Neo4j with Oracle? See Oracle vs Neo4j.
What Neo4j does excellently:
- Native property-graph storage. Indexes on labels, properties, relationships. Designed for graphs, not retrofitted from rows.
- Cypher. The query language is genuinely good.
MATCH (a)-[r:KNOWS]->(b) WHERE a.name = 'Alice' RETURN bis the right level of abstraction. - Mature traversal performance. Multi-hop walks at millisecond latency on graphs of hundreds of millions of nodes.
- Production tooling. Clustering, backups, multi-tenancy, monitoring. The boring stuff is solved.
- The ecosystem. Graph data science library, visualization tools (Bloom, Neo4j Browser), integrations with everything.
What Neo4j doesn't do natively:
- Vector search. Neo4j added vector indexes in 5.11 (~2023). They work. They are not at parity with dedicated vector databases for high-recall workloads at scale. If your vectors are the primary access pattern, Neo4j's vector index is the secondary citizen of the engine.
- LLM integration. No
GENERATE()function inside Cypher. You call out to Python/LangChain. - Relational joins at scale. Neo4j is great at graph traversals; it's not optimized for "JOIN three tables on big indexed keys."
- AutoML or in-DB training. Out of scope.
This isn't a knock. Neo4j is a graph database. It does graphs. The tradeoff is that everything not graph (vectors, LLMs, ML training) lives somewhere else — and you become responsible for keeping those somewhere-elses in sync with Neo4j.
What GraphRAG is
GraphRAG is a retrieval pattern, not a piece of software. The pattern:
- Embed the user's question.
- Find the top-k chunks (or nodes) by vector similarity.
- Walk the graph N hops out from those seeds along typed edges.
- Feed the resulting subgraph (chunks + nodes + edges) into the LLM context.
You can read the long-form on this, including how it differs from plain vector RAG and how to implement it step by step, in what GraphRAG is and how to implement it. The relevant point for this post: GraphRAG requires a vector index AND a graph engine. Two capabilities. How you provision them is the architectural decision.
Neo4j GraphRAG (the neo4j-graphrag package): how it works
"Neo4j GraphRAG" usually means Neo4j's official Python package, neo4j-graphrag (pip install neo4j-graphrag, Apache 2.0, the renamed successor of neo4j-genai). It is a first-party toolkit for building GraphRAG on a Neo4j database (5.18.1 or later, or Aura), and it has three parts:
documents ──► KG builder pipeline ──► Neo4j (nodes, relationships, chunk embeddings + vector index)
(LLM entity/relation extraction) │
▼
question ──► Retriever ──► context (chunks + graph neighbourhood) ──► LLM ──► answer
(vector, vector+Cypher, hybrid, text-to-Cypher) GraphRAG class
- Knowledge graph builder. A pipeline that splits documents into chunks, embeds them, asks an LLM to extract entities and relationships, resolves duplicates and writes the result to Neo4j.
- Retrievers.
VectorRetriever(similarity search on a Neo4j vector index),VectorCypherRetriever(similarity search, then a Cypher query that walks out from each hit: the GraphRAG step),HybridRetrieverandHybridCypherRetriever(vector plus full-text), andText2CypherRetriever(an LLM writes the Cypher). External retrievers can keep the vectors in Weaviate, Pinecone or Qdrant instead. - Generation. The
GraphRAGclass passes the retrieved context and the question to an LLM (OpenAI, Anthropic, Ollama, Vertex AI and others).
So with the package, the graph and the vectors can both live in Neo4j: the retriever does the similarity step against Neo4j's vector index and the expansion step in Cypher, and Python orchestrates the LLM calls. What stays outside Neo4j is the embedding model, the LLM and, usually, your relational system of record, which still has to be synced into the graph.
The same retrieval shape on SynapCores runs as one Cypher statement inside the database, shown in the unified-engine section below.
Implementing GraphRAG on Neo4j (the multi-store path)
The most common architecture for GraphRAG on Neo4j is the dual-store pattern: Neo4j for the graph, a separate vector database (Pinecone, Chroma, Weaviate, pgvector) for the embeddings.
The flow:
User question
-> embed via OpenAI/sentence-transformers
-> top-k vector search in Pinecone
-> get node IDs back
-> Cypher query in Neo4j: MATCH (n) WHERE n.id IN [...] -[*1..2]- ()
-> assemble chunks + subgraph
-> stuff into LLM context
Code-wise (Python + LangChain-ish pseudocode):
# Step 1: vector search
seeds = pinecone.query(vector=embed(question), top_k=5)
seed_ids = [s['id'] for s in seeds]
# Step 2: graph traversal in Neo4j
cypher = """
MATCH (n:Chunk) WHERE n.id IN $ids
MATCH (n)-[r*1..2]-(m)
RETURN n, r, m
"""
subgraph = neo4j.run(cypher, ids=seed_ids)
# Step 3: feed to LLM
context = format_subgraph(subgraph)
response = openai.chat.completions.create(
messages=[{"role": "user", "content": question + "\n\nContext:\n" + context}]
)
This works. It's the canonical pattern, and there's nothing wrong with it on a small scale. Neo4j's vector index is also an option — keeps everything in one engine, gives up some vector-search performance, simplifies operations. Both are valid.
The cost shows up at scale. Specifically:
1. Two stores, one source of truth (sort of)
Every node in Neo4j has a corresponding vector in Pinecone. When the node's content changes, both stores need to update. The write path becomes:
def update_chunk(chunk_id, new_content):
new_emb = embed(new_content)
pinecone.upsert([(chunk_id, new_emb)])
neo4j.run("MATCH (n:Chunk {id: $id}) SET n.content = $c", id=chunk_id, c=new_content)
Two writes, no transaction across them. If the Pinecone write succeeds and the Neo4j write fails (or vice versa), you have drift. Every team I've seen running this pattern at scale has built some kind of reconciliation job — usually as a nightly cron — to scan for divergence. The reconciliation works. It's tax.
2. Two operational footprints
Neo4j has its own cluster topology, backup story, monitoring story, version cadence, IAM model. Pinecone (or your chosen vector DB) has another. Your on-call rotation now covers two clusters. Your DR plan covers two clusters. Your version bumps are coordinated.
3. The retrieval round-trip
The flow above does two network round-trips per query: app → Pinecone → app → Neo4j → app. At 10ms each, that's 20ms of pure overhead before the LLM is called. This is fixable with batching and connection pooling, but it's a real cost that disappears when both indexes share a process.
4. Schema divergence
This is the subtle one. Pinecone has a different notion of "filter" than Neo4j has of "property." When you want a hybrid query — "vectors close to X and nodes connected to Y" — the filtering happens in two places and the semantics don't always line up cleanly. The application becomes the merge layer, which means bugs live in the merge logic.
Implementing GraphRAG on a unified engine (the single-store path)
The alternative: an engine where the graph and the vector index share storage and the planner. SynapCores does this; so do a few other unified engines now. In SynapCores the similarity step is a hop inside Cypher: nodes carry an embedding property, and [:SIMILAR_TO > 0.8] walks to their nearest neighbours through an HNSW index. The same GraphRAG retrieval becomes:
// From the runbook an engineer is reading: related runbooks (vector hop),
// the systems they cover and the team that owns them (graph hops).
MATCH (seed:KbDoc {id: "DOC-101"})-[:SIMILAR_TO > 0.8]->(doc:KbDoc)
MATCH (doc)-[:COVERS]->(s:KbSystem)-[:OWNED_BY]->(team:KbTeam)
WHERE s.tier = "database"
RETURN doc.title AS runbook, team.name AS owning_team, team.oncall AS page;
On SynapCores 2.5.1, with the knowledge base from this recipe loaded, it returns one row: Database connection pool exhaustion | Core Data | core-data-oncall. The sample uses fixed demo vectors, so this retrieval step does not require an embedding API or an LLM. It exercises connected retrieval rather than complete answer generation. After that first result, configure a model and add the recipe’s optional llm_score() ranking step.
You can inspect a larger implementation in the SynapCores support-agent reference application: follow memory, retrieval, and tool routing through the source. It is a SynapCores-built reference application. To see how teams use SynapCores beyond this sample, read the anonymized production deployment summaries.
Neo4j brings a long track record and a broad ecosystem of drivers, tools and experienced practitioners, and a team that already runs Neo4j well keeps that operational investment. The unified engine's advantage is structural: the embedding model, the LLM calls and the SQL tables live in the same engine as the vector hop and the graph hops, so there is no second system to keep in sync. Why Traditional Databases Fail Modern AI Workloads makes the full case — it is about architecture, not "Neo4j bad."
