SynapCores

GraphRAG vs Neo4j (2026): Which Do You Actually Need?

By , Founder & CTO, SynapCores · Published · Updated

GraphRAG is a retrieval pattern; Neo4j is a graph database. Different layers.

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 b is 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:

  1. Embed the user's question.
  2. Find the top-k chunks (or nodes) by vector similarity.
  3. Walk the graph N hops out from those seeds along typed edges.
  4. 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
  1. 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.
  2. 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), HybridRetriever and HybridCypherRetriever (vector plus full-text), and Text2CypherRetriever (an LLM writes the Cypher). External retrievers can keep the vectors in Weaviate, Pinecone or Qdrant instead.
  3. Generation. The GraphRAG class 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."

A decision matrix

Decision quadrant: Neo4j vs unified engine by workload weight

Real talk, here's how I actually advise teams:

Signal Choose Neo4j + vector DB Choose unified engine
You're already deeply on Neo4j Strong yes Switching cost is real
Graphs are the dominant workload, vectors are a side feature Yes — Neo4j is purpose-built Unified engine is unnecessary
Vectors are dominant, graph is for occasional relationship queries Dual-store sync is overkill Yes — one engine is simpler
Both vector and graph are equally first-class Sync cost real; pay it consciously Yes — designed for this case
Greenfield project, no existing investment Possible but operationally heavier Yes — fewer moving parts on day one
You need mature graph data science library (PageRank at scale, community detection, etc.) Yes — Neo4j ecosystem is unmatched here Unified engines have less in this area
You need GENERATE() and EMBED() callable from queries Need a Python layer Native — see SQLv2
Team has graph-DB ops experience Strong yes Either
Small team without graph-DB ops experience Operational tax is high Lower tax

A summary: Neo4j is the right answer when graphs are the workload. A unified engine is the right answer when AI workloads (vectors + graphs + LLMs) are the workload and you'd rather not assemble five services.

Where Neo4j genuinely wins, in detail

I want to give Neo4j its due. There are workloads where it's the cleanest choice and where adding a unified engine to the comparison is silly.

  • Pure graph workloads. Knowledge graphs in life sciences, social network analysis, supply chains. The vector dimension is incidental; the graph is the whole game.
  • Graph data science. GDS library — community detection, centrality algorithms, link prediction, embeddings of graph nodes (Node2Vec, GraphSAGE). Mature, fast, well-supported.
  • Cypher mastery on the team. If you have Cypher experts, leaning into Neo4j amortizes that expertise.
  • The ecosystem. Bloom for visualization, integrations with every BI tool, a fifteen-year corpus of patterns and conference talks.

If those bullets describe your project, the dual-store sync cost is a price worth paying. The vector dimension is the secondary concern, not the primary.

Where a unified engine genuinely wins

The flip side. Where I'd default to a unified engine:

  • Agent memory / GraphRAG as the primary product feature. Both layers (vectors and graph) are first-class. Sync is friction.
  • You want LLM calls inside the query. GENERATE() in SQL collapses three round-trips into one.
  • You want in-DB ML training. CREATE MODEL + PREDICT() are first-class — see What Is In-Database Machine Learning?.
  • You don't have graph-DB ops budget. Running one engine is meaningfully cheaper than running two, especially at small team size.
  • Latency budget is tight on relational queries. One round-trip vs two matters.

A worked migration scenario

Let's say you're already on Neo4j and you're evaluating whether to move to a unified engine. Here's the honest assessment:

  1. If your graph is well under 100M nodes and you have light vector volume: the unified engine usually pays back inside a quarter. The sync code you can delete is bigger than the migration cost.
  2. If your graph is large and graph-native (deep traversals, complex algorithms, GDS dependency): stay on Neo4j. Add a vector DB. The unified engine isn't worth the migration.
  3. If you're net-new and the requirements include both layers: start unified. Adopt Neo4j if and when the graph workload outgrows the unified engine.

The same advice in one line: migrate when the sync tax exceeds the migration cost. Don't migrate for ideology.

How GraphRAG-the-pattern translates between the two

Just to be concrete: the GraphRAG pattern itself is portable. You can implement it on either side. The architectural choice is about the operational shape of the implementation, not about whether GraphRAG is possible.

On Neo4j (dual-store):

seeds = vector_db.search(embed(q), k=5)
subgraph = neo4j.run("MATCH (n) WHERE n.id IN $ids MATCH (n)-[*1..2]-(m) RETURN ...", ids=[s.id for s in seeds])
answer = llm.complete(format(subgraph))

On a unified engine (SynapCores), the similarity hop and the traversal are one Cypher statement:

MATCH (seed:KbDoc {id: "DOC-101"})-[:SIMILAR_TO > 0.8]->(doc:KbDoc)
MATCH (doc)-[:COVERS]->(s:KbSystem)-[:OWNED_BY]->(team:KbTeam)
RETURN doc.title, team.name;

Same pattern. Different operational story.

Want the guided version?

If you'd rather follow a step-by-step build than read pseudocode, we put together Build AI Agents with SynapCores — a runnable tutorial that goes from importing data, to your first agent in Python, to your first agent in Node.js, to wiring in exactly this GraphRAG pattern, to shipping a durable production agent with CREATE AGENT. Every step runs on the free Community Edition.

Run these GraphRAG patterns yourself

Each is a copy-paste recipe you can run on the free Community Edition:

The "GraphRAG vs Neo4j" how-to cluster

If you're weighing the two architectures in this post, these five certified how-to guides make it concrete. Each builds a real GraphRAG use case on a unified engine with a single [:SIMILAR_TO] semantic hop plus llm_score inline ranking — and shows, side by side, what the same capability costs on a Neo4j + vector-DB stack (four systems and a sync job). All run on the free Community Edition:

GraphRAG alternatives in 2026

"GraphRAG" covers several different tools. They split into libraries that build and query a knowledge graph on top of a store you choose, and databases that store and traverse it. A short map:

Option What it is Where the graph and vectors live Pick it when
Microsoft GraphRAG Open-source library (MIT). An LLM extracts entities and relationships, groups them into communities and writes community summaries Files or a store you configure You want global, summary-style answers over a large document set
LightRAG Open-source library (MIT) for graph-based RAG with a lighter indexing pipeline Pluggable storage, including Neo4j, PostgreSQL, MongoDB and OpenSearch You want a simpler, cheaper-to-index GraphRAG pipeline
LlamaIndex PropertyGraphIndex Framework index that extracts a property graph from chunks and retrieves paths plus source text A graph store and an optional vector store Your app is already built on LlamaIndex
Neo4j + neo4j-graphrag Official Neo4j package: KG builder, retrievers and a GraphRAG class (Apache 2.0) Neo4j (graph + vector index), or vectors in Weaviate, Pinecone or Qdrant You run Neo4j or want the largest graph ecosystem
FalkorDB GraphRAG-SDK FalkorDB's open-source SDK (Apache 2.0) for building and querying knowledge graphs FalkorDB You want low-latency, in-memory graphs
SynapCores One self-hosted engine with SQL, Cypher, HNSW vector search and LLM functions One engine: the vector hop and the traversal run in one Cypher statement You want GraphRAG without a separate graph, vector and relational store to sync

The libraries and the databases combine: you can run Microsoft GraphRAG or LightRAG and load the graph into a database to query it. If you are weighing graph databases for this rather than libraries, see how FalkorDB and Neo4j compare for GenAI and vector search and how TigerGraph and Neo4j compare for GenAI and knowledge graphs.

GraphRAG vs Neo4j: FAQ

Is GraphRAG better than Neo4j? They are not alternatives. GraphRAG is a retrieval pattern: find entry points by vector similarity, then walk relationships to collect connected context for an LLM. Neo4j is a graph database you can use to store and traverse that graph. The real choice is where GraphRAG runs: on Neo4j plus a separate vector and relational stack, or on one engine that holds vectors, graph, and SQL together.

Can I use GraphRAG with Neo4j? Yes. Neo4j is one of the most common backends for GraphRAG: it stores the knowledge graph, and its vector indexes or an external vector database supply the similarity step. The trade-off is operational: you typically also run a relational system of record and an embedding pipeline, and keep them in sync with the graph.

What is the difference between Microsoft GraphRAG and Neo4j? Microsoft GraphRAG is an open-source library that uses an LLM to extract entities and relationships from documents, groups them into communities, and summarizes them for retrieval. Neo4j is a database. You can load the graph a library like Microsoft GraphRAG produces into Neo4j (or another graph-capable engine) to query and traverse it.

What is Neo4j GraphRAG? Neo4j GraphRAG usually refers to neo4j-graphrag, Neo4j's official Python package (Apache 2.0). It builds a knowledge graph from documents with an LLM, retrieves context with vector, hybrid, vector-plus-Cypher or text-to-Cypher retrievers, and passes it to an LLM through a GraphRAG class. The graph and the vector index live in Neo4j; the embedding model and the LLM run outside it.

Do I need a graph database for GraphRAG? You need graph traversal, not necessarily a separate graph database. Any engine that can store typed relationships and walk them in the same query as vector similarity can run GraphRAG; a unified engine avoids keeping a graph store, a vector store, and a relational store in sync.

Comparing Neo4j with other graph databases?

If you're choosing a graph database rather than a retrieval pattern, these head-to-head comparisons cover the usual shortlist: