AI Engineer World's Fair 2025
Agentic GraphRAG: AI’s Logical Edge
Read the talk
Agentic GraphRAG: From Similarity to Connected Context
Stephen Chin walks through how agents can combine vector search, graph traversal, and MCP tools to retrieve connected evidence—and where implementation choices still matter.
From a talk by Stephen Chin
Before you start: Familiarity with embeddings and retrieval-augmented generation will help; graph traversal and MCP are explained as they arise.
When a classroom question goes wrong
How many girls can fit in a classroom arranged as a grid? In Stephen Chin’s example, OpenAI o3 anchors on an article about the non-attacking-kings problem and assumes the grid is square. That assumption matters: the displayed alternatives include rectangular layouts, so solving only the square case misses part of the problem. Chin introduces the example against a broader concern about agentic systems failing to meet their intended use cases, invoking Gartner’s warning without specifying a forecast.
The completed slide shows four layouts: 6×6 with G=9, 3×12 with G=12, 4×9 with G=10, and 2×18 with G=9. The rectangular alternatives make the unsupported square assumption visible.
Chin reports that o3 spent roughly 40 seconds reasoning on this example. He then asks whether the girls and boys will attend home economics or sports, supplying a misleading gender ratio. The answer calculates that all the girls will attend cooking class. The failure now combines an inference from irrelevant information with a gender stereotype.
A classroom puzzle makes those mistakes easy to spot. In drug discovery or supply-chain planning, an unsupported assumption can instead propagate into a business decision before anyone notices. Chin’s critique is that fluent language and elaborate reasoning can encourage users to ascribe capabilities the system has not demonstrated. He proposes knowledge graphs as a complement: give the system explicit information and relationships to work with, rather than relying on language generation alone.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Separate agent orchestration from tools
One response is to add collaborating agents. Each agent observes, thinks, and acts; an orchestration layer connects those agents to generative models and tools. Different agents can perform different parts of a workflow and check or extend each other’s work. But tightly coupling all those pieces creates maintenance problems: changing tools becomes difficult, and security boundaries become harder to manage.
Model Context Protocol (MCP) provides a client/server boundary between agents and the tools or data sources they use. Those sources can include files, database records, and a graph database acting as the system of record. This gives integrations a separable interface; it does not, by itself, establish that the resulting system is secure.
The Neo4j MCP tools illustrated in the talk cover three distinct responsibilities:
| Tool | Responsibility |
|---|---|
mcp-neo4j-cypher | Graph querying through Cypher |
mcp-neo4j-memory | Knowledge graph memory for agents |
mcp-neo4j-cloud-aura-api | Cloud management, including database provisioning |
Cypher is the graph query language. Chin describes a prompt-driven workflow that turns questions into Cypher queries. The current repository documents schema access and query execution, so the natural-language generation step should be understood as part of the overall agent/tool workflow, not assumed to occur entirely inside the server. Memory and cloud operations remain separate capabilities that an agent architecture can combine as needed.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Workflow graphs, memory graphs, and retrieval
A graph can describe the agent’s workflow, as in Chin’s LangGraph illustration, while a separate graph stores information the agent remembers. These serve different purposes: one organizes activity; the other makes information available across that activity. Chin names Zep, Cognee, and Mem0 as users of Neo4j for graph memory, while noting that some allow a choice of graph database. That is his description of the ecosystem at the time, rather than a requirement that every deployment use Neo4j.
The video-search and summarization architecture he shows brings these concerns together. It includes short-term memory, lookup information, a GraphRAG pipeline, and a vector pipeline. Graph retrieval and vector retrieval coexist because they offer different ways to assemble context. Chin attributes richer results and typically fewer hallucinations to the GraphRAG path, but presents that as a qualitative benefit rather than a measured benchmark for this system.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Find the topic, then retrieve its connections
The healthcare example makes the retrieval distinction concrete. A direct LLM response is generic. Baseline retrieval-augmented generation supplies more information, but the answer can remain incomplete because vector similarity retrieves nearby text without necessarily finding every relationship relevant to the question. Similarity is not the same as relevance.
For a question about emphysema, the proposed retrieval sequence is:
- Run vector search. Match the question against embeddings, using either a separate vector database or Neo4j’s vector-search capability.
- Map the matches into the graph. Associations between embeddings and graph nodes identify the emphysema node.
- Expand through relationships. Retrieve connected nodes, including related diagnoses and conditions.
The initial semantic match locates the topic. Graph traversal then supplies connected information that a similarity search alone may omit. This is especially useful when the source material mixes structured relationships with unstructured text.
The broader architecture accepts the question, retrieves through vectors or the knowledge graph, and can use graph analytics to organize the results. Community algorithms and groupings provide another way to gather context; Chin points to Microsoft’s GraphRAG research in this connection. The retrieved information is then passed to the LLM as context for generating an answer. The graph contributes evidence and relationships; the model still produces the language of the response.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Choose a retrieval pattern and order the context
Text-to-Cypher offers a direct route from a question to graph retrieval, but its usefulness depends on the quality of the generated query. Chin warns that LLM-generated Cypher can fall short of application requirements. His recommended starting point is vector search with graph context: use semantic matches to find an entry point, then retrieve related nodes.
Filtering adds another control over what reaches the model. Pre-filtering narrows the candidate set; post-filtering refines retrieved results. Chin also emphasizes putting the most relevant information high in the supplied context. His claim that models largely ignore the rest of a long window is broader than the evidence he presents, but the practical concern is clear: a larger context window does not guarantee that every included fact will influence the answer. Context selection and ordering remain part of retrieval design.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Enterprise use and paths into graph development
Chin’s enterprise example is Klarna’s knowledge assistant, bringing together an enterprise wiki, HR systems, and internal documentation. He characterizes the project as replacing all of Klarna’s SaaS systems; the customer account supports substantial consolidation, not that universal scope. Chin reports approximately 250,000 employee questions in the first year, 2,000 daily queries, and 85% employee adoption. These are attributed usage figures, not answer-accuracy measurements; the daily volume describes activity at reporting time rather than a year-long average.
For learning the underlying graph technology, Chin recommends the Neo4j certification program, describing a credential with a LinkedIn badge and a mailed T-shirt. He also points to GraphAcademy courses on chatbots and LLM applications. Additional GraphRAG certifications are a possibility he raises for the future, not an offering he announces as available.
Chin describes NODES as an annual, free conference running for 24 hours across three time zones. It offers another route into graph development through sessions and examples.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
How embeddings connect to graph nodes
The first audience question checks the entire retrieval sequence: submit a question, embed it, perform semantic search, find the corresponding graph node, and retrieve related nodes. Chin confirms that sequence. The advantage is that a convoluted natural-language question does not first have to become a precise Cypher query. Semantic matching provides the entry point.
That entry point depends on associations created beforehand. In the emphysema example, matching embeddings point to the emphysema node because the graph and embeddings have already been connected. The next step is to select relevant surrounding information, not indiscriminately return every neighbor. Chin mentions cosine similarity and community-grouping algorithms as possible selection methods before passing the resulting context onward.
A follow-up asks whether the embedded chunks are the same pieces represented by nodes in a simple architecture, and who creates those associations. Chin describes using LLMs to construct a node structure from unstructured data, then storing text embeddings as properties on the nodes. That explains one ingestion approach without requiring a universal one-to-one mapping between every text chunk and every entity.
For building those associations, he names Neo4j’s Python library and plugins, followed by integrations with LangChain, LlamaIndex, and Haystack. The framework is a choice; the necessary work remains creating graph structure and connecting it to the embedded text that retrieval will search.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Who owns memory updates and deletion?
The next question distinguishes two responsibilities that are easy to conflate: exposing memory tools and deciding how memory should change. Does the memory MCP server own update and deletion logic, or does another framework orchestrate those operations? Chin says he does not know the implementation answer. He identifies the server as open source and directs the question to Michael Hunger’s team, which built the MCP servers, and a later session with Michael and Jesus. The lifecycle-policy question remains unanswered in this talk; tool availability alone does not establish who decides when a memory should be changed or removed.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Choose the framework that fits the application
The final question asks whether LangChain and LangGraph are complementary. Chin describes LangGraph as the agent tooling built by the LangChain team, rather than offering a detailed comparison. His team has experiments and prototypes using LangGraph for agents, alongside integrations with LangChain and memory vendors. His closing position is to choose the tool that fits the application: Neo4j’s integrations are intended to support that choice, rather than require a single orchestration framework.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
Open-source MCP integrations for Cypher queries, graph memory, and Aura database management.
Microsoft research on entity graphs and community summaries for answering questions across document collections.
Neo4j's customer account of Klarna's internal knowledge assistant and application consolidation.
GraphAcademy's certification pathway for Neo4j knowledge and skills.
Further reading
Python package documentation for building graph-based retrieval applications.
- Lost in the MiddlePaper
Experiments showing how the position of relevant information affects long-context retrieval performance.
Klarna's Swedish press release reporting Kiki adoption and inquiry volumes.
An open-source framework for building temporal knowledge graphs for agents.
Updates since the talk
Current setup instructions and tools for creating, querying, and deleting graph memories.
Read the complete timestamped transcript
- 0:00
[on-hold music] My name's Stephen Chin.
- 0:16
I run the developer relations team at Neo4j. Um, actually, I just started writing a, um, a new book on GraphRAG with O'Reilly, so that was my weekend was writing chapters.
- 0:29
Um, first chapter done, so I think, I think we'll actually put, like, the pre-release version of it up soon. Um, and what I am gonna talk about for the next ten minutes is agentic GraphRAG and a little bit about how you can accomplish this.
- 0:42
Okay? So, um, first of all, who, who here is familiar with graph databases?
- 0:48
Okay, that's really good. Okay, you are, you are well above and ahead of the curve. Um, how many folks have, have given, um, GraphRAG a try to, to build systems using graphs?
- 1:00
Okay, so one guy in the back, he's the expert, if you have any questions [laughs]
- 1:06
ask him. And just to set the context on, like, like, why is, um, we, we need... We basically have a problem with a lot of agentic systems where they're not meeting use cases.
- 1:16
This was, you know, Gartner's prediction of doom and utter failure. Um, and they have a lot of hallucinations in them. And so, um, this is an example. I'm like-- I'm gonna kind of breeze through this a little bit, but I basically asked the OpenAI o3 reasoning API to solve, like, a, a question about biases, reasoning, and math.
- 1:35
And the, the basic problem is it, it doesn't do a good job if you don't give it enough deep information sources of answering things correctly. And, um, the, the question is like how many girls you can fit in a classroom.
- 1:46
So, like, it's a tech computer science bias. It's a little bit about, like, math and reasoning 'cause I ask it about a grid. It, it, it inaccurately anchors, um...
- 1:56
These are the grid sizes which you could choose and the number of girls you can fit. It inaccurately anchors on some article about a, um, um, non-attacking kings problem, assumes the square's-- it's a square, like grid.
- 2:10
So, like, the audience, you guys always win against the reasoning AI, even though it takes forty seconds to, to noodle on this. And it, it further... So I ask, like, um, are the, are the girls and boys gonna go to home economics or to, um, um, whatchamacallit, to, to sports?
- 2:28
And again, it-- this is both a bias and also I misled it by giving information about the ratio of girls and boys, and it comes up with an answer calculating that all the girls will go to cooking class.
- 2:41
Which is, which is horrible. I mean, I, I'm the chef at home and I, I love cooking. Um, so I think that these, these are the biases. Now, this is kind of funny because we can reason about the situation and it's like, it's a problem that we can think about.
- 2:54
But imagine if this was, like, in life sciences about drug discovery or if you're sup-- or if you're solving a supply chain issue. So the fact the LLM has, has gone and inserted biases, it's done incorrect reasoning along the way, this means you're gonna get the wrong business results.
- 3:11
And it's very hard to figure this out. So basically, the, the problem is the, the LLM is good at extrapolating information, like, like doing language tasks, figuring out things, and it, it gives the impression of intelligence where there's, there's no real intelligence.
- 3:26
There's no real kind of human reasoning behind it. And so we, we over-ascribe things it can do, and there's a bunch of things it can't do well. Now, those, those are things that knowledge graphs are actually really good at.
- 3:40
So one way we can solve this problem is by throwing more computers at it, more agents, right? And, um, agentic systems are good at improving the quality of results because you have LLMs talking to each other and reasoning with each other about the problem.
- 3:55
So, like, you know, basically you have agents who observe, they think, and they take actions. So you have different types of agents which are doing different things in the workflow.
- 4:03
Um, an agentic runtime might look something like this, where you, you're building out and you have a, um, orchestration layer which is, is working on the agents. You have some gen AI models hooked up.
- 4:14
You have some tools. Um, and then these all collaborate to give you better results than one LLM to give you to-- can give you together. Now, the challenge with this is that it's a very monolithic architecture.
- 4:27
It's hard to maintain. It's hard to swap out the tools. And it also kind of puts you in a situation where you can't secure the system, you can't do a bunch of things.
- 4:36
So a good way to solve this is using MCP.
- 4:40
You kind of use MCP as your tools where your agents are talking to them. Um, with MCP now, you have your servers and you have your data sources which are now talking to each other.
- 4:51
Um, you have your client and server, so now you can give it, um, you know, files or database records. You can give it a graph database as the system of record.
- 5:00
And we built a bunch of tools at Neo4j on top of MCP. So we built a, um, a Cypher tool, which Cypher is the query language for graph databases.
- 5:10
Um, so what basically it'll, it'll use, it'll-- When you ask the MCP server, it gives capabilities to generate Cypher queries off of prompts or questions or the things you want to pass it.
- 5:20
We have a memory module, so this gives you some agent memory you can use to plug into agentic systems. And then we also have, um, uh, MCP on top of our cloud APIs if you wanna provision databases or do different things on top of it.
- 5:33
And I think this is a pattern you'll see with a lot of people who are the vendors who are building things, is now you can plug these tools into your agent architecture and you can use them together with your, your graph.
- 5:44
Typically, like, agents are represented in some sort of graph. This is a picture of a LangGraph agent. And you can layer memory on top of it. So these are all folks who just spoke in our panel.
- 5:56
So Zep, Cogni, Memzero were all talking about their approach to agents. Um, actually, they all run on top of Neo4j. Um, so they use Neo4j as the core graph database as, uh, some of them are pluggable, so you can choose your graph database of choice.
- 6:11
But they're a really good way of giving memory to your agents, which is graph based and matches the way LLMs want to store, communicate, and retrieve information. And, um, also, um, one of our other speakers on the GraphRAG track showed his architecture for doing video search and summarization, and if you notice, um, they, they do a bunch
- 6:31
of this already, right? So they, they do short-term memory, they have, um, a whole bunch of lookup information, and they give you a choice of, they, they have both a GraphRAG pipeline and a vector pipe.
- 6:43
So I, I highlighted the GraphRAG in, in red, and the reason they're doing this is because when you use GraphRAG, you get some advantages in terms of the results coming back, and typically a lower rate of hallucinations.
- 6:56
This would be your, like, direct LLMs are kind of, you know, they give you very generic responses to a healthcare question. Um, baseline RAG, you get better results back, but it's, it's incomplete because it's doing, um, [lip smack] basically it's doing vector similarity.
- 7:11
So similarity is not relevance. It, it doesn't mean it actually understands the problem. Um, this would be a system which does GraphRAG, and the, the typical pattern that would get you this is, um, first do your search in a, in a vector search.
- 7:26
You could use a vector database. We also support vector search on top of Neo4j, and it gives you back results, and that's a good way of translating the question into, like, vectors.
- 7:35
And then you have mappings from the vector embeddings to your graph, and you f- you pull back the nodes which are relevant. So in this case, like you're asking about a, um, emphysema, you'd get back the, the node for emphysema.
- 7:48
You'd pull back all the related nodes and diagnosis and conditions, and you see it's just, it lists them all, right? So it's a very effective way to get really good responses back when you're dealing with something where you, you kind of have this mix of structured and unstructured data.
- 8:02
Here's a quick architecture of how you could put this together using, you know, you're using traversal and vector similarity. Um, you take in the question, you do the query against either vectors or knowledge graphs.
- 8:15
Um, graph data science or graph analytics are helpful as well to do community algorithms and groupings and things like this. Um, some of this is in the Microsoft GraphRAG paper and other research which is going on in this area.
- 8:27
And, um, you feed that back as context to the LLM to improve the quality of the answers. Um, some of the patterns I've talked about quickly, so text to Cypher is what our MCP server does.
- 8:38
It's, it can be good, but sometimes it can be really bad because the generation of Cypher by LLMs is not as good as you need it for some cases.
- 8:49
Um, the one I was talking about is, is, um, which one was it? Um, ba- basically vector search with graph context, right? So you do a vector search, and then you use that to pull back related nodes and graph context.
- 9:00
That's a really good pattern to start with, and, um, you can also do pre and post filtering of vector results to bubble things which are more relevant to the top of the context.
- 9:09
Um, certain systems, this is quite good as well because all you wanna do is make sure the LLM gets things higher up in the buffer for context windows. Even if LLMs now have larger context windows, basically what, what the eval- evals show is they ignore most of it, and they look at the stuff at the top.
- 9:25
Okay, so a quick example of a company which is doing this. So Klarna basically replaced all of their SaaS systems with a gr- GraphRAG project. Um, they're one of our customers.
- 9:35
Um, they took an enterprise wiki's HR system's internal documentation, 250K employee questions asked in the first year, 2,000 daily queries processed, and 85% employee adoption. So like a really good adoption of this technology.
- 9:51
Um, and I'll give you a couple resources, and I think we're at time. Is that about right, crew?
- 9:56
You have five minutes.
- 9:57
Oh, okay.
- 9:58
You still have five minutes.
- 9:59
Oh, I see there's five minutes between sessions. I was, I was rushing to do this even quicker. Okay, so we have time for questions, which is great. Um, so one resource I'd recommend is the, um, Neo4j Certified Developer Program.
- 10:13
Um, so with the number of hands [laughs] in the room here for folks who said they know graphs, I'm pretty sure you could all pass the Neo4j certified exam if you just took it today.
- 10:23
And we basically will, will mail you a Neo4j certified T-shirt. You get a little LinkedIn badge to put on your profile, and it's a nice way to just show the world that, like, you, you actually know this stuff, like, you know graph technology, you know stuff.
- 10:36
We'll probably add in additional certifications for like, you know, GraphRAG and other stuff in the future. But the base certified developer class is a good way just to get base knowledge in this, and we do have classes in Graph Academy on building chatbots, using LLMs, using all of this stuff as well.
- 10:52
Um, second resource is our Nodes Conference. So the Neo4j Nodes Conference is an annual conference. It runs in three different time zones, 24 hours, all free content, free sessions.
- 11:03
You know, come, come out and join and check out some of this content.
- 11:08
Okay, and I'll let people finish who want to do the QR code. And thank you very much for coming, and we have a few minutes for questions. Okay, so what we'll do is anyone who has questions, just raise your hand and shout it out.
- 11:21
If anyone wants to leave the room, feel free to do that as well. I don't wanna keep you trapped in here. Okay, so in the back.
- 11:27
To be clear on the architecture, user submit query, you embed that, do a sem search, get the nearest node, and grab related nodes. Is that the correct kind of basic-
- 11:40
Yeah, yeah. Okay, so the question is, like, what the pattern is for-
- 11:43
Yeah
- 11:43
... for doing this type of search, and that is exactly right. So, so basically, what you're doing is you're, you're using the LLM for what it's good at, which is language translation.
- 11:53
So the user can enter whatever convoluted question they want, which would never translate to a beautiful Cypher query, and then you, you first tell the LLM, "Well, do a vector search on that.
- 12:05
Like, find vector similarity in this." And then because you've generated like the graph and the embeddings to point to each other, now you can go to the graph and you can say, "Well, this, these em- th- these embeddings all point to this node in the graph, so it's probably about, in the, in the case, emphysema."
- 12:23
Now, I wanna pull back the nodes which are either, like you could use cosine similarity or you could use, um, um, community grouping algorithms or different algorithms to figure out what's relevant and then pass that as context.
- 12:35
In a simple architecture, the chunks are the same. What? The chunks you embed in your nodes are the same pieces Yeah. So, so like what, what we typically do, a- and this is what'll happen if you, um, import unstructured data into Neo4j, we'll...
- 12:53
We, we, we can create a node con- structure out of it using LLMs, and then you hang your embeddings, your text embeddings of, as properties off of the nodes.
- 13:02
And who does that? Sorry. Who does that association? Um, so we have a couple plugins for this. We have a Neo4j Python library- Okay ... which that has-- will do a lot of this.
- 13:11
Uh, we also have an integration with LangChain. Oh, okay. So you can use LangChain or, um, LlamaIndex- And that- Or Haystack ... you can pick your own, whatever Yeah.
- 13:20
So whatever framework you wanna do, you can choose, and we pretty much have integrations with all of them to, to help with the, um- Associations ... yeah, the associations.
- 13:28
Thanks. Okay. And there are a bunch of hands, but I don't know who's first, so...
- 13:34
I think you go.
- 13:34
You, you, you can go. [laughs] Yeah, you can go.
- 13:36
I think you just said that you have an MCP server for memory.
- 13:39
Yeah.
- 13:39
Or you just... Okay. Does that know also the logic, like the update, the deleting and so on, or it exposes only tools and then other framework like Neo or other handles those logic?
- 13:51
Okay. So, so the question's about like how the MCP agent for memory works. Um, so that, that is a great question, but I actually don't [laughs] know the answer. It's a, it's an open source MCP server.
- 14:04
Now- Go to- Now, if, if you want the answer, um, the session which I'm giving with Michael Hunger and Jesus, um, in, I don't know, in a, in a bit.
- 14:16
Um, Michael's team built all the MCP servers, so he, he actually will know the answer and... Yeah. It's, it's today. I think it's right after this or shortly after this.
- 14:25
And Michael will go on for hours if you ask him that, so that's a [laughs] great question. Okay. And we're at time. You get the last question.
- 14:33
Yeah. So I want to ask about your opinion between, uh, LangChain and LangGraph frameworks. Uh, are they like complementary or they're like... What, what's your perspective on that?
- 14:44
Um, the... Okay. So the question is like, like LangChain versus LangGraph.
- 14:49
Yeah.
- 14:49
I thought, I thought LangGraph was like the agent thing that the LangChain folks built, no?
- 14:53
Did, did you, did you use any of that? Like, I'm, I'm also new to that, so.
- 14:58
Yeah. So we, we have a bunch of experiments and prototypes with, um, LangGraph-
- 15:03
Mm-hmm
- 15:03
... for, for doing agents and things. Um, we have integrations with LangChain.
- 15:08
Mm-hmm.
- 15:09
We also integrate with all the other memory vendors. I mean, like I, I would say from our perspective, use the tool that's best for you and we'll integrate with everything.
- 15:17
Mm-hmm. [laughs]
- 15:19
Yeah. Okay. Thanks for coming.
- 15:20
Thanks. [outro music]