# Context Engineering: Connecting the Dots with Graphs — Stephen Chin, Neo4j

Stephen Chin

AI Engineer Code 2025

[Talk page](https://ai.engineer/talks/LLuKshphGOE-context-engineering-connecting-dots-graphs) · [Video](https://www.youtube.com/watch?v=LLuKshphGOE)

## Context Engineering: Connecting the Dots with Graphs

Knowledge graphs connect retrieval, memory, and agent tools so an LLM can work with related facts, temporal context, and inspectable evidence.

Familiarity with LLM context windows and retrieval-augmented generation is helpful; graph concepts are introduced as needed.

### From clever prompts to useful context

[0:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=1s)

How do you get an AI application to use the right information when a larger context window can hold so much irrelevant material? Stephen Chin, introducing himself as Neo4j’s VP of Developer Relations, opens with a Matrix metaphor: developers have become workers serving the machines, spending their time adjusting prompts. The escape is to move beyond clever one-shot phrasing and design the information the application receives.

**Context engineering is information architecture for the model.** It means dynamically selecting information for an application’s goal, curating it for the relevant domain, and structuring it so useful signals stand out. Enterprise applications particularly need this business context. A large context window does not ensure that the model attends to the facts that matter; retrieval and agent memory must help put those facts where they can influence the answer. In Chin’s metaphor, that is the move from trapped worker to superhero: gaining control over what the agent has available to accomplish its task.

![Slide contrasts one-shot prompt engineering with context engineering, listing relevance, structured inputs, signal over noise, and thinking like information architects.](https://ai.engineer/api/talk-essay-media/e521ebce4081a92b398acce642109827136970702be29a0b8b44681451816532)

From prompting to context engineering: dynamic, goal-driven, structured inputs.

### Build context, then curate memory

[2:44](https://www.youtube.com/watch?v=LLuKshphGOE&t=164s)

Prompt engineering remains one component of this larger system. The surrounding components supply evidence, continuity, and a usable output contract.

| Component | Contribution |
| --- | --- |
| Prompt instructions | Task, grounding, and guidance |
| Retrieval-augmented generation | Relevant enterprise and business data |
| State and history | Short-term collaboration and long-term continuity |
| Structured output | Results usable by applications and tools |

Together, these determine both what the model knows during a request and how its response can participate in a larger workflow.

**Short-term memory** holds what the agent needs for the current task. Compress that information, prioritize relevant results high in the context window, and integrate tool results selectively. A tool may have dumped useful output several exchanges ago, but retaining all of it can crowd out the information needed now.

**Long-term memory** requires more than saving a conversation transcript. Past episodes need semantic and structural interpretation: what was learned, how facts relate, and which lessons should become instructions, procedures, or planning guidance. Bringing those lessons into the current context fills gaps without replaying every previous exchange. The objective is to reduce noise and the missing information that can contribute to hallucinations.

Memory quality still obeys garbage in, garbage out. Chin points to [DSPy](https://dspy.ai/) and [BAML](https://docs.boundaryml.com/home) as ways to make prompting more dynamic, then extends the idea to reasoning that organizes context internally. The emphasis shifts toward what an agent can assemble and reason through at test time, alongside what a model learned during training. More context helps only when its inputs remain relevant and structured.

### Represent facts and their relationships

[6:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=413s)

A **knowledge graph** supplies structured information alongside the LLM’s language and generative capabilities. Nodes represent people, places, events, or things; relationships record how those entities connect. This gives humans and models a structure they can inspect, and it can represent a digital twin of an organization, supply chain, or business process.

The graph-components example uses Anne, Dan, and a car. The people know one another and have a living-with relationship; driving and ownership connect people to the vehicle. Properties add detail: the car is a Volvo V70, while relationship attributes can record how long someone has lived with another person or driven the car. The distinction matters because knowing an entity exists is different from knowing how someone relates to it.

![Neo4j Graph Components slide shows two Person nodes connected by KNOWS and LIVES WITH arrows, with DRIVES and OWNS arrows toward a car partly covered by the presenter.](https://ai.engineer/api/talk-essay-media/5fb35d8c81214302e461400f2be33775c9d15f6b03533aa56f5678db15af37ca)

Graph components: nodes, relationships, and properties.

Embeddings can also live on the graph, enabling vector lookups without discarding explicit relationships. A graph therefore need not replace semantic search: it can provide the structure around its results. The combination joins the graph’s stored knowledge and context with the LLM’s language, reasoning, and creativity.

### Retrieve a connected context

[9:23](https://www.youtube.com/watch?v=LLuKshphGOE&t=563s)

Chin uses **GraphRAG** broadly: any retrieval pipeline that uses graphs during retrieval. Its basic flow is straightforward:

1. A user asks a question.
2. The application searches for relevant information by querying a knowledge graph.
3. Retrieved graph information becomes additional context for the LLM.
4. The LLM answers using that context.

The additional retrieval signals include relationships, nodes, and community groupings. These can supply domain facts that a similarity search alone does not bring together.

The retrieved subgraph also gives you something concrete to inspect: which facts and connections were passed into the model? As knowledge changes, the graph can evolve. Chin proposes adding role-based access overlays, using a patient system as an example: a doctor receives diagnosis information, while administrative staff receive contact information such as phone numbers and addresses. The proposed design combines graph access rules with instructions about what the model may disclose; the talk does not demonstrate permission enforcement.

The same inspectable structure can support improvement over time. Store learning from user and agent interactions, visualize conversation flows and associated reasoning, then examine where context quality or agent performance breaks down. Relationships can be improved and duplicate nodes removed. Chin returns to the Matrix’s virtual dojo: repeated inspection and adjustment provide a way to improve the system’s behavior by changing the information it works with.

### Build a graph from supply-chain documents

[12:05](https://www.youtube.com/watch?v=LLuKshphGOE&t=725s)

The first demonstration starts with a running Neo4j Aura instance on the free tier and the open-source [LLM Knowledge Graph Builder](https://github.com/neo4j-labs/llm-graph-builder). Its web interface accepts drag-and-drop files. Chin has already uploaded two representative documents: a supply-chain document describing artifacts, digital signatures, and relationships, and a VEX security document describing Jackson library vulnerabilities, affected versions, remediation, and fixing commits.

Ingestion has also happened before the demonstration. The LLM extracts a graph from the documents, and Chin inspects the resulting nodes and relationships. The extracted information includes who discovered a vulnerability and a vulnerability-database URL. Connecting these facts makes them available for queries and traversals, rather than leaving them only as passages inside the source documents.

Retrieval then runs in two passes:

1. **Find entry nodes:** use vector similarity to identify relevant nodes in the graph.
2. **Expand the context:** retrieve related nodes and pass the connected information to the LLM.

The desired boundary is that the application answers from this knowledge pool and declines questions outside it. That boundary is an intended behavior, separate from the mechanism that retrieves context.

Chin first asks about Jasper, another Java library that is absent from the VEX document, intending to test that boundary. He then corrects the query toward Jackson and comments on the model’s tolerance for typos. In the Jackson response, he reports information about Jackson Databind, an attack characterized as XML injection, the affected version, whether it has been fixed, and the fixed version. Those are the response details described in the demonstration, rather than a remediation recommendation for a particular installation.

The useful property is that the answer draws on a finite, editable body of information. The graph aggregates connected facts for the response, and its contents can be corrected or expanded to change what subsequent retrieval provides. That gives the application a concrete place to improve its evidence.

### Put graph memory into the agent loop

[16:09](https://www.youtube.com/watch?v=LLuKshphGOE&t=969s)

The Matrix analogy changes when Chin turns to agents: the film’s antagonists cooperate and have distinct personalities, much like collaborating LLM agents. Those agents need memory retrieval as well as document retrieval. An open-source [Neo4j MCP server](https://github.com/neo4j-contrib/mcp-neo4j) can expose graph retrieval tools, allowing an agent to search knowledge, vectors, and structural signals such as communities or nearest neighbors. Retrieved information then feeds the agent loop as contextual memory.

![Graph Based Retrieval diagram links Search to Graph Memory Retrieval Tools, Agent Loop, and Contextual Memory. Retrieval query and relevant information arrows connect the tools to Neo4j, above knowledge graph, vectors, and graph data science icons.](https://ai.engineer/api/talk-essay-media/878ecfc651279ca9875e8f44a5d7ff24ed39f3d18a286f6788554c4d99624035)

Graph memory retrieval connects search, Neo4j, and the agent loop.

For short-term use, that context can describe the current conversation. For long-term use, previous conversations can be stored with temporal information and retrieved later. Memory becomes entities and relationships with properties such as text details, headings, time, and location. Embedding selected properties supports semantic search; graph algorithms add other signals, including approximate nearest neighbors, community grouping, and PageRank. The system can therefore use both semantic resemblance and graph structure to select relevant context. Chin’s bullet-time metaphor introduces the practical payoff: recovering connections that a similarity lookup may miss.

### Find the last presentation with Sid

[19:24](https://www.youtube.com/watch?v=LLuKshphGOE&t=1164s)

Consider the request: “Let's update this presentation from the last time I presented with Sid.” Resolving it requires more than finding a document that mentions presentations. The graph connects Chin, the VP of DevRel, with Sid, a community manager in India, and with GIDS, the developer conference in Bangalore where they last presented together. A presentation memory record adds the relevant point in time. The retrieved context can now tell the model who presented, where, and when before it attempts an update.

One way to express that lookup in Cypher is to model each presentation as a memory record linked to its presenters and event. Using illustrative labels `PresentationMemory`, `PRESENTED`, and `AT_EVENT`, the query finds shared presentations and selects the latest:

```cypher
MATCH (stephen:Person {name: 'Stephen Chin'})-[:PRESENTED]->
      (memory:PresentationMemory)<-[:PRESENTED]-(sid:Person {name: 'Sid'})
MATCH (memory)-[:AT_EVENT]->(event:Event)
RETURN stephen.name AS presenter,
       sid.name AS copresenter,
       event.name AS event,
       event.location AS location,
       memory.presentedAt AS presentedAt,
       memory.text AS presentationContext
ORDER BY memory.presentedAt DESC
LIMIT 1;
```

The timestamp determines which shared presentation is last; the event connection supplies the location and event name. The returned record supplies context for a proposed update—it does not itself modify the presentation. This illustrates Chin’s multistage retrieval example rather than reproducing a query shown in the recording.

**Use graph retrieval when the answer depends on connected facts.** Chin explicitly leaves room for standard vector RAG: if a one-shot lookup or single similarity search answers the question, it is sufficient. He locates the additional value of GraphRAG and graph memory in traversals involving two or more relationships, where the needed facts are related but do not arrive together in a single similarity result.

### Let the agent choose the next traversal

[21:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=1261s)

Graph retrieval can give the application different degrees of control over the query:

| Strategy | How it retrieves context |
| --- | --- |
| Explicit queries | Prewritten queries with selected entry points |
| Text-to-Cypher | Schema-informed generation of a question-specific query |
| Agentic traversal | Repeated tool calls that navigate and gather evidence |

Chin describes text-to-Cypher in terms of fine-tuning an LLM with the schema, but the following demonstration shows schema inspection and query generation, not a model-training step. Agentic traversal extends query generation into a loop: inspect what came back, decide what is missing, and query again.

The second demonstration reuses the same vulnerability graph through Claude Code. Chin has preconfigured the Neo4j Labs Cypher MCP server with database settings and supplied keywords such as `graph` and `database` to encourage tool use. He asks **Claude** what it knows about the Jackson vulnerability based on the graph database. This is the Labs tooling used in the recording; the current repository distinguishes it from a separate official product server.

The agent first retrieves the graph schema to learn the available structure and relationships. It then generates multiple Cypher queries for the vulnerability. **Cypher** is Neo4j’s graph query language. Its relationship to ISO GQL is more nuanced than the talk’s subset description: the [current conformance documentation](https://neo4j.com/docs/cypher-manual/current/appendix/gql-conformance/) lists both GQL features missing from Cypher and Cypher features outside GQL.

After finding vulnerability information, the agent retrieves text chunks attached to those nodes. This is a useful division of labor: the graph helps locate and connect the relevant entities, while the attached text supplies further source detail. Each result can reveal what the next query should retrieve, allowing the agent to assemble a fuller answer than the initial lookup alone supplies.

### Trade retrieval work for answer depth

[23:25](https://www.youtube.com/watch?v=LLuKshphGOE&t=1405s)

Chin describes the first retrieval approach as relatively fast but limited in CVE detail, while the agentic approach produces a more detailed answer through repeated graph traversals. This is an observation from the demonstrations; no timing measurements or comparative accuracy benchmark accompany it.

The second response includes the CVE number, the affected vulnerability, attack type, severity, and a technical description. It also gives upgrade versions and advisory information. Those details matter when the task is an organizational vulnerability report: the reader needs to understand the issue and how to address it, not simply identify a matching vulnerability. The agent can return to the graph for additional evidence as it develops that report. Chin calls this the best possible response; the demonstrated mechanism is the ability to keep gathering relevant information before composing the answer.

### Build the next graph application

[24:38](https://www.youtube.com/watch?v=LLuKshphGOE&t=1478s)

Chin closes with paths from these demonstrations to implementation. [GraphAcademy](https://graphacademy.neo4j.com/) offers free, hands-on learning in Cypher and GraphRAG, including Python and TypeScript examples. At recording time, he also describes more advanced GraphRAG courses as forthcoming. The displayed learning pathway progresses from knowledge graph fundamentals and graph construction to applied projects and evaluation.

![Graph Academy slide displays https://dev.neo4j.com/ga-rag, a QR code, and four stages: knowledge graph fundamentals, building knowledge graphs, applied GraphRAG projects, and evaluating GraphRAG.](https://ai.engineer/api/talk-essay-media/9fcfe4d6e1fc90d8ef10b08016237d0d5de1e101464588c41f67fe57671b7a95)

Graph Academy learning pathway with a QR code and resource link.

Chin reports over 13,000 registrants for the preceding NODES conference, which he describes as having taken place the prior week. His invitation to [NODES AI 2026](https://neo4j.com/nodes-ai/) is for a free, day-long online event devoted to AI, with a call for proposals open at recording time. The event has since concluded, and its page now points to recordings.

For deeper work, [GraphRAG.com](https://graphrag.com/) brings together research, conceptual explanations, and implementation guides. Chin presents this Neo4j-supported community resource as a way to explore different retrieval approaches and apply graphs to new problem domains—the next step after understanding how connected evidence improves an application’s context.

## Resources

- [LLM Knowledge Graph Builder](https://github.com/neo4j-labs/llm-graph-builder) — Build Neo4j knowledge graphs from documents, inspect extracted relationships, and query the resulting data.
- [Knowledge Graph Builder feature guide](https://neo4j.com/developer/genai-ecosystem/llm-graph-builder-features/) — Guide to document ingestion, extraction schemas, and Knowledge Graph Builder features.
- [Neo4j Labs MCP Servers](https://github.com/neo4j-contrib/mcp-neo4j) — MCP tools for inspecting graph schemas, executing Cypher queries, and storing graph memory across conversations.
- [Cypher and GQL conformance](https://neo4j.com/docs/cypher-manual/current/appendix/gql-conformance/) — Current documentation of the overlap and differences between Neo4j Cypher and ISO GQL.
- [GraphAcademy](https://graphacademy.neo4j.com/) — Free hands-on courses covering Cypher, graph modeling, application development, and GraphRAG.
- [GraphRAG concepts and pattern catalog](https://graphrag.com/) — Concepts, implementation guides, retrieval patterns, and research links for graph-assisted retrieval.
- [NODES AI 2026 recordings](https://neo4j.com/nodes-ai/) — Conference page linking recordings about GraphRAG, graph memory, agents, and production applications.
- [DSPy documentation](https://dspy.ai/) — Documentation for programming and optimizing language-model workflows with DSPy.
- [BAML documentation](https://docs.boundaryml.com/home) — Documentation for developing typed language-model functions with BAML.

## Slides

### From Prompting to Context Engineering

Chin frames context engineering as designing dynamic, goal-driven inputs for agents: curate relevant information and structure it for signal over noise.

[0:57](https://www.youtube.com/watch?v=LLuKshphGOE&t=57s) [Slide contrasts prompt engineering with dynamic, goal-driven context engineering.](https://assets.ai.engineer/sites/aiecode2025/sha256/3bc50b13e37e513990968d128555ca8a58728bb4c5f4c192a4cf699e12a5d360.webp)

From Prompting to Context Engineering

• Prompt engineering = one-shot, clever phrasing
• Context engineering (evolution)
  - need for context grows with Agents
  - dynamic
  - goal driven
  - selectively curated for relevancy
  - structured inputs
  - signal over noise
• Think like information architects

### Why Context Matters Now

Chin argues that dynamic prompts and reasoning help shape context, while structured, relevant inputs improve reliability and explainability. Bigger context alone is not necessarily better.

[5:51](https://www.youtube.com/watch?v=LLuKshphGOE&t=351s) [Slide lists ways structured, relevant context can improve model responses beside an image of scattered sticky notes.](https://assets.ai.engineer/sites/aiecode2025/sha256/be60a740b2165605a15a75c65fd1b7877a89def9d73dfe74d5abf34900f91a87.webp)

Why Context Matters Now

LLM responses are only as good as the quality of the context they get to complete.

• Right information - Garbage in => out
• Dynamic Prompts - DSPy/BAML
• Reasoning / CoT - internal context engineering
• Human Developer => Agent
• Test Time > Train Time
• Bigger context ≠ better context
• Structured, relevant input => reliability, explainability

Photo text: BRAINSTORRING; [illegible]

### Knowledge Graphs

Chin introduces knowledge graphs as a way to provide structured information for AI.

[6:56](https://www.youtube.com/watch?v=LLuKshphGOE&t=416s) [Knowledge Graphs section title on a cream background with abstract shapes.](https://assets.ai.engineer/sites/aiecode2025/sha256/3e14566cc20f97591ce25a4abd58f0d3678d21efb9b5af82fcb7ec1b305b3815.webp)

Knowledge Graphs

9  Neo4j Inc. All rights reserved 2023

### LLMs and Knowledge Graphs

Knowledge graphs contribute knowledge, context and enrichment; LLMs contribute language, reasoning and creativity. The slide presents them as complementary.

[9:02](https://www.youtube.com/watch?v=LLuKshphGOE&t=542s) [Knowledge graphs contribute knowledge, context and enrichment; LLMs contribute language, reasoning and creativity.](https://assets.ai.engineer/sites/aiecode2025/sha256/cebc9049911ec72e3b181cb7040e4d2af48906494d63e0745b76fdda58ef5e71.webp)

LLMs and Knowledge Graphs

Knowledge
Context
Enrichment

KGs + LLMs

Language
Reasoning
Creativity

BETTER TOGETHER

### Evolving From RAG to GraphRAG

GraphRAG queries a knowledge graph for relevant information, then supplies it as context to the LLM for an enriched answer. The slide highlights relevance, explainability and role-based access.

[9:21](https://www.youtube.com/watch?v=LLuKshphGOE&t=561s) [GraphRAG benefits and a diagram showing retrieval of graph information to enrich an answer.](https://assets.ai.engineer/sites/aiecode2025/sha256/85e710c1ad42ac8b76b673f3bc8895bcacdaa57870511dde00b94a6a7fcf8e6b.webp)

Evolving From RAG to GraphRAG

A Neo4j Knowledge Graph combined with LLM’s obtains some unique improvements:

Relevancy - Obtain more relevant answers compared to just vector searches
Context: includes domain specific, factual, structured knowledge on your subject
Explainability: Provide the user with more reasoning on how the results were obtained.
Security: Role Based Access Control

Graph Retrieval Augmented Generation
User Asks a Question → LLM Smart Search → LLM Question + Relevant Info → Enriched Answer
Query
Relevant Info
Neo4j’s Knowledg[illegible]

### Neo4j Aura Instance

The GraphRAG demo starts with a running AuraDB Free instance containing 135 nodes and 416 relationships. Chin says he used the Knowledge Graph Builder to load the relationships.

[12:12](https://www.youtube.com/watch?v=LLuKshphGOE&t=732s) [The Aura console shows a running database instance with nodes and relationships.](https://assets.ai.engineer/sites/aiecode2025/sha256/6baf2cf2dc17477149264f0f57359b1f7ad7473af53f02eb4172c0722fa0fce4.webp)

Instances
Aura (1)
Self-managed (0)
Search
Create instance

Instance01
RUNNING
ID: e7527da5
Connect
Type: AuraDB Free
Nodes: 135 (0%)
Relationships: 416 (0%)
Monthly usage: $0.00
Upgrade
Metrics

Interface text:
console-preview.neo4j.io/projects/49826257-a8eb-4755-b5b4-a95a203efa8b/instances
neo4j aura
New Organization / New tenant
Feedback
Get started
Developer hub
Data services
Instances
Import
Graph Analytics
Data APIs
Agents Preview
Tools
Query
Explore
Dashboards
Operations
Project
Learning
10:14 PM
1/17/2025

### Knowledge Graph Builder demo

Chin shows two previously loaded supply-chain files with completed processing, then opens the CycloneDX BOM to inspect its metadata and hashes.

[12:23](https://www.youtube.com/watch?v=LLuKshphGOE&t=743s) [The graph builder shows two uploaded files with completed processing.](https://assets.ai.engineer/sites/aiecode2025/sha256/0fa028a3beadac98f489e17eb36b1eb4d7c5df9ec9580e06fcae39c35b5d534a.webp)

Neo4j connection
neo4j+s://e7527da5.databases.neo4j.io:7687 / neo4j
No Graph Schema configured

Name | Status | Upload Status | Size (KB) | Source | Type | Model | Nodes
bom.json.txt | Completed | Uploaded | 8.90 | local file | TXT | Openai gpt 4.1 | 71
vex.json.txt | Completed | Uploaded | 4.27 | local file | TXT | Openai gpt 4.1 | 53

Large files may be partially processed up to 10K characters due to resource limit.

LLM Model for Processing & Chat
Openai gpt 4.1

Interface text:
llm-graph-builder.neo4jlabs.com
neo4j
Graph Enhancement
Disconnect
10:14 PM
1/17/2025

[12:41](https://www.youtube.com/watch?v=LLuKshphGOE&t=761s) [A text editor displays CycloneDX document metadata and artifact hashes.](https://assets.ai.engineer/sites/aiecode2025/sha256/5b329ac9c4747f582e9255230be1ade66bfa24df74edadbbc4bea0f215b36760.webp)

bom.json.txt
{
  "bomFormat" : "CycloneDX",
  "specVersion" : "1.3",
  "serialNumber" : "urn:uuid:5f0f0da9-c03d-47d8-b38d-009e6df67094",
  "version" : 1,
  "metadata" : {
    "timestamp" : "2022-01-11T02:55:27Z",
    "tools" : [
      {
        "vendor" : "CycloneDX",
        "name" : "CycloneDX Maven plugin",
        "version" : "2.5.3",
        "hashes" : [
          {
            "alg" : "MD5",
            "content" : "4f7d894200ad695fc9f0aad66d7da40a"
          },
          {
            "alg" : "SHA-1",
            "content" : "c044d9b726650cbea3adeb5cc1715c67d8356c0a"
          },
          {
            "alg" : "SHA-256",
            "content" : "b9a385e430e1f5efd9b835a084c195dde4d5e1bc79e469a8187ec58275c15313"
          },
          {
            "alg" : "SHA-384",
            "content" :
"d96f68ef4b8830d70dc2eb5f2de5211d96b70dd1169da641f34474265c06a5321b63d2c80fe2d82d74c7673912[illegible]
          },
          {
            "alg" : "SHA-512"

Interface text:
llm-graph-builder.neo4jlabs.com
neo4j
bom.json.txt
vex.json.txt
File  Edit  View
Graph Enhancement
Disconnect
Drag & Dr[illegible]
or browse
Documents, Ima[illegible]
Unstructured te[illegible]
Web Sources
Amazon S3
Source  Type
local file  TXT
local file  TXT
Ln 1, Col 1
8,897 characters
Plain text
100%
Unix (LF)
UTF-[illegible]
LLM Model for Processing & Chat
Openai gpt 4.1
10:15 PM
1/17/2025

### Vulnerability document

The VEX document identifies a Jackson vulnerability, CVE-2020-25649, and includes an NVD rating of 7.5, marked high.

[12:56](https://www.youtube.com/watch?v=LLuKshphGOE&t=776s) [A text editor displays a CycloneDX vulnerability record and severity rating.](https://assets.ai.engineer/sites/aiecode2025/sha256/496eb2d59c5d1ce67572e0f152184e54a2e1f289454c74bb1e5fe06a5d22098f.webp)

{
  "bomFormat": "CycloneDX",
  "specVersion": "1.4",
  "version": 1,
  "vulnerabilities": [
    {
      "id": "CVE-2020-25649",
      "source": {
        "name": "NVD",
        "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-25649"
      },
      "references": [
        {
          "id": "SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302",
          "source": {
            "name": "SNYK",
            "url": "https://security.snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302"
          }
        }
      ],
      "ratings": [
        {
          "source": {
            "name": "NVD",
            "url": "https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N&version=3.1"
          },
          "score": 7.5,
          "severity": "high",
          "method": "CVSSv31",
          "vector": "AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
        }

Interface text:
llm-graph-builder.neo4jlabs.com
neo4j
bom.json.txt
vex.json.txt
File  Edit  View
Graph Enhancement  Disconnect
Source  Type
local file  TXT
local file  TXT
Web Sources
Amazon S3
Ln 14, Col 55  4,271 characters  Plain text  100%  Unix (LF)
LLM Model for Processing & Chat
Openai gpt 4.1

### Vulnerability details

The VEX record describes unsecured entity expansion in Jackson Databind that can expose local files. It recommends upgrading to version 2.6.7.4, 2.9.10.7, 2.10.5.1 or higher.

[13:08](https://www.youtube.com/watch?v=LLuKshphGOE&t=788s) [The vulnerability document describes an XML external entity issue and an upgrade recommendation.](https://assets.ai.engineer/sites/aiecode2025/sha256/48be6a31638c2864c6c2ee5c9a5da1353455aacf83d39a88275e06d5d90801fa.webp)

"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N/CR:X/IR:X/AR:X/MAV:X/MAC:X/MPR:X/MUI:X/MS:X/MC:N/MI:N/MA:N"
        }
    ],
    "cwes": [
        611
    ],
    "description": "com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\n\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.",
    "detail": "XXE Injection is a type of attack against an application that parses XML input. XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. By default, many XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing. When an XML document is being parsed, the parser can make a request and include the content at the specified URI inside of the XML document.\n\nAttacks can include disclosing local files, which may contain sensitive data such as passwords or private user data, using file: schemes or relative paths in the system identifier.",
    "recommendation": "Upgrade com.fasterxml.jackson.core:jackson-databind to version 2.6.7.4, 2.9.10.7, 2.10.5.1 or higher.",
    "advisories": [
        {
          "title": "GitHub Commit",
          "url": "https://github.com/FasterXML/jackson-databind/commit/612f971b78c60202e9cd75a299050c8f2d724a59"
        },
        {
          "title": "GitHub Issue",
          "url": "https://github.com/FasterXML/jackson-databind/issues/2589"
        },
        {
          "title": "RedHat Bugzilla Bug",

Interface text:
llm-graph-builder.neo4jlabs.com
neo4j
bom.json.txt
vex.json.txt
File  Edit  View
Graph Enhancement  Disconnect
Drag & Dr[illegible]
or browse
Documents, Ima[illegible]
Unstructured t[illegible]
Web Sources
Amazon S3
Source  Type
local file  TXT
local file  TXT
Ln 14, Col 55  4,271 characters  Plain text  100%  Unix (LF)
LLM Model for Processing & Chat
Openai gpt 4.1
10:30 PM

### Knowledge Graph Chat vulnerability demo

The chat finds no information on Jasper, then answers the mistyped Jackson query: it reports an XXE issue and says vulnerable code in jackson-databind 2.10.0 is not reachable. Chin says the answer comes from the knowledge graph.

[15:06](https://www.youtube.com/watch?v=LLuKshphGOE&t=906s) [The chat reports no information about one library while a follow-up about another is drafted.](https://assets.ai.engineer/sites/aiecode2025/sha256/2908dc5ae6b7dfbcd2ccc7fd81ffca4959f4b17b56750d8c270e612ab0460541.webp)

Welcome to the Neo4j Knowledge Graph Chat. You can ask questions related to documents which have been completely processed.
11/17/2025 9:50:34 PM

What do you know about vulnerabilities in the jasper library?
11/17/2025 10:31:48 PM

I don't have any information about vulnerabilities in the jasper library right now. Is there something else I can help with?
11/17/2025, 10:31:48 PM
Details

What do you know about vulnerabilities in the jacksonlibrary?
Ask

Interface text:
llm-graph-builder.neo4jlabs.com
neo4j
Openai gpt 4.1
10:32 PM
11/17/2025

[15:36](https://www.youtube.com/watch?v=LLuKshphGOE&t=936s) [A Neo4j chat answers a Jackson vulnerability question, describing an XML external entity issue and a reported reachability assessment.](https://assets.ai.engineer/sites/aiecode2025/sha256/9dbe3bf214f62324f52c47b001de7fb05c65c9ebbaddbd33615ae47c78e0b712.webp)

What do you know about vulnerabilities in the jasper library?
11/17/2025 10:31:48 PM

I don't have any information about vulnerabilities in the jasper library right now. Is there something else I can help with?
11/17/2025, 10:31:48 PM
Details

What do you know about vulnerabilities in the jacksonlibrary?
11/17/2025 10:32:04 PM

The jackson-databind library is affected by an XML External Entity (XXE) Injection vulnerability related to XML processing attacks. However, automated dataflow analysis and manual code review indicate that, for version 2.10.0, the vulnerable code is not reachable, either directly or indirectly. As a result, the responses to this issue include "will_not_fix" and "update." There are references to related issues and bug reports, such as a GitHub issue and a RedHat Bugzilla bug.
11/17/2025, 10:32:04 PM
Details
Ask

Interface text:
llm-graph-builder.neo4jlabs.com
neo4j
Openai gpt 4.1
10:32 PM
11/17/2025

### Graph Based Retrieval

Graph memory retrieval tools query Neo4j using knowledge graphs, vectors, and graph data science. They return relevant information to the agent loop as context.

[16:54](https://www.youtube.com/watch?v=LLuKshphGOE&t=1014s) [Diagram connects search to graph memory retrieval tools, an agent loop, and contextual memory. The tools query Neo4j for information using a knowledge graph, vectors, and graph data science.](https://assets.ai.engineer/sites/aiecode2025/sha256/f452289a5d806d55fb24dff7293f5bfa229a4b0491b1bf03f5e989c7f6053de3.webp)

Graph Based Retrieval

Search → Graph Memory Retrieval Tools → Agent Loop → Contextual Memory

Retrieval Query
Relevant Information

neo4j
Knowledge Graph + Vectors + Graph Data Science

2
1

### Graph Memory

Graph memory connects entities through relationships. Some nodes carry searchable properties, including text details, embeddings, time, and location.

[18:06](https://www.youtube.com/watch?v=LLuKshphGOE&t=1086s) [Graph memory stores entities and relationships; nodes can have searchable properties such as text, embeddings, time, and location.](https://assets.ai.engineer/sites/aiecode2025/sha256/2ed70570c09e59265cc0e6cc45d1dba6a24552c62d2edf526e0a9466f1d319eb.webp)

Graph Memory captures knowledge in the form of entities and relationships between them.

Some Nodes in the graph have search relevant properties e.g. text details, embeddings, time, location.

22  Neo4j Inc. All rights reserved 2024

### Vector-Based Semantic Search

Selected graph property values are embedded and indexed, projecting graph memory into vector space for vector-based semantic search.

[18:19](https://www.youtube.com/watch?v=LLuKshphGOE&t=1099s) [A graph above a vector index illustrates embedding node properties for semantic search.](https://assets.ai.engineer/sites/aiecode2025/sha256/f9dbff15b4a991893861725d9c520ef6538c4e46bf4f47341955aea1c2c9fc6e.webp)

Some of these property values get vector embedded and indexed to enable vector-based semantic search.

23   Neo4j Inc. All rights reserved 2024

### Approximate Nearest Neighbors

A semantic search returns k approximate nearest neighbours from the vector index. The highlighted region illustrates a neighbourhood beneath the graph.

[18:33](https://www.youtube.com/watch?v=LLuKshphGOE&t=1113s) [A highlighted region in a vector index represents approximate nearest neighbors returned by a semantic search.](https://assets.ai.engineer/sites/aiecode2025/sha256/8aea8c51d534d13f7618a6ac93980b0077373196c3fdfd1d732121d02706c325.webp)

A semantic search on the vector index returns the k approximate nearest neighbours to the search (word, question, image, etc)

24  Neo4j Inc. All rights reserved 2024

### Neo4j MCP extension settings

The demo connects Claude to the knowledge graph through the installed Neo4j Cypher MCP Server. Stephen Chin says he has already configured the extension with the database settings.

[21:46](https://www.youtube.com/watch?v=LLuKshphGOE&t=1306s) [Claude desktop extension settings showing the installed Neo4j Cypher MCP Server.](https://assets.ai.engineer/sites/aiecode2025/sha256/23d9707c4e399710d4d017a9fa5d9c82d5a0b14ad4f49a7d473d7c206d8b6585.webp)

Extensions
Allow Claude to directly interact with apps, data, and tools on your computer.

Installed on your computer
Neo4j Cypher MCP Server  CUSTOM  Configure

Browse extensions
Advanced settings
Drag .MCPB or .DXT files here to install

Interface text:
Claude — Control+Alt+Space
New chat  Ctrl+K
Settings
General
Account
Privacy
Billing
Usage
Capabilities
Connectors
Claude Code
Desktop app
General
Extensions
Developer
10:38 PM

### Jackson vulnerability investigation using Neo4j

Claude checks the Neo4j schema, runs Cypher queries and retrieves text chunks for context before looking for the CVE connection.

[23:14](https://www.youtube.com/watch?v=LLuKshphGOE&t=1394s) [Claude uses Neo4j schema and Cypher queries to investigate a Jackson vulnerability and retrieve context.](https://assets.ai.engineer/sites/aiecode2025/sha256/bd6979afb9ffd106058611b64630d116aa605b83e5b0b8235c5658e2d9e04d60.webp)

What do you know about the jackson vulnerability based on your graph database?

I'll search my Neo4j database for information about Jackson vulnerabilities.

Get Neo4j Schema

Now let me query for Jackson vulnerability information:
2 steps
Read Neo4j Cypher
Read Neo4j Cypher

Let me look at the text chunks to get more context:
3 steps
Read Neo4j Cypher
Read Neo4j Cypher

Perfect! Now let me get the CVE connection and full details:
Read Neo4j Cypher

Based on my Neo4j database, [illegible]

Interface text:
Claude — Control+Alt+Space
Jackson vulnerability in graph databases
NA
How can I help you today?
Sonn[illegible]
10:40 PM
1/17/2025

[23:47](https://www.youtube.com/watch?v=LLuKshphGOE&t=1427s) [Claude shows a question about a Jackson vulnerability and several Neo4j schema and Cypher queries.](https://assets.ai.engineer/sites/aiecode2025/sha256/f4936fad005b3872f6a0ca0436e5a9f7ce7decc6eac36a082b02bb5b3dca5a6e.webp)

What do you know about the jackson vulnerability based on your graph database?

I'll search my Neo4j database for information about Jackson vulnerabilities.

Get Neo4j Schema

Now let me query for Jackson vulnerability information:
2 steps
Read Neo4j Cypher
Read Neo4j Cypher

Let me look at the text chunks to get more context:
3 steps
Read Neo4j Cypher
Read Neo4j Cypher

Perfect! Now let me get the CVE connection and full details:
Read Neo4j Cypher

Based on my Neo4j database, [illegible]
Vulnerability Details

Interface text:
Claude — Control+Alt+Space
Jackson vulnerability in graph databases
NA
How can I help you today?
Sonn[illegible]
10:40 PM
1/17/2025

### Demo 2

Chin describes an agentic, multi-step MCP retrieval approach that pulls more information from a knowledge graph to help develop a vulnerability report.

[24:30](https://www.youtube.com/watch?v=LLuKshphGOE&t=1470s) [Neo4j Demo 2 title slide displayed in Google Slides, with the presenter overlaid.](https://assets.ai.engineer/sites/aiecode2025/sha256/b2a59882b59b0b000f9239905a7ffb802bcc637e7631f0d7d0fc1d745c1b98fe.webp)

neo4j

Demo 2

Interface text:
Click to add subtitle
Context Engineering: Connecting the Dots with Graphs (AI Engineer Code Summit)
File  Edit  View  Insert  Format  Slide  Arrange  Tools  Extensions  Help
Fit  Background  Layout  Theme  Transition
Slideshow  Share
Click to add speaker notes
10:41 PM
1/17/2025

### GraphAcademy GraphRAG

GraphAcademy offers free, hands-on GraphRAG courses. The learning path moves from knowledge graph fundamentals through building and applying graphs to evaluating GraphRAG applications.

[24:54](https://www.youtube.com/watch?v=LLuKshphGOE&t=1494s) [GraphAcademy GraphRAG resource with a QR code and a four-part learning path covering fundamentals, building graphs, projects, and evaluation.](https://assets.ai.engineer/sites/aiecode2025/sha256/f70ec543b62cb7b406a4256f05eeefbe12b51cfa97f4e32655ffd320a7e69dc1.webp)

Graph Academy
RAG

Learn everything you need to know to combine Generative AI and knowledge graphs to produce highly accurate responses, with rich context and deep explainability.

1
Knowledge graph fundamentals
Knowledge graphs provide the foundation for representing complex relationships that traditional databases can't effectively handle.

2
Building knowledge graphs
Learn how to combine structured and unstructured data to create a knowledge graph.

3
Applied GraphRAG projects
Apply everything you've learned to build production-ready GraphRAG application that deliver more accurate, contextual, and explainable AI results.

4
Evaluating GraphRAG
Learn how to evaluate the performance of your GraphRAG applications and understand the metrics that matter.

https://dev.neo4j.com/ga-rag

### Thank you

Stephen Chin closes by connecting graphs to context engineering for AI applications.

[26:07](https://www.youtube.com/watch?v=LLuKshphGOE&t=1567s) [Neo4j closing slide thanking the audience and naming Stephen Chin, with the presenter overlaid.](https://assets.ai.engineer/sites/aiecode2025/sha256/b1e6c8bf9aa2b872132899fa3e2debe38eff1317d61763341f1ba2a06c059a5a.webp)

neo4j

Thank you!

Stephen Chin (@steveonjava)

## Full transcript

[0:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=1s) Hello everybody, and welcome to my session at AI Engineer Code Summit. And I'm gonna talk a bit about how you can connect the dots with graph technology and solve problems like context engineering, um, improving retrieval patterns, and also agentic memory.

[0:17](https://www.youtube.com/watch?v=LLuKshphGOE&t=17s) So we're gonna have a lot of fun. My name is Stephen Chin. I'm VP of Developer Relations at Neo4j, and you can find me on all the different social media outlets with my handle, [REDACTED:username].

[0:27](https://www.youtube.com/watch?v=LLuKshphGOE&t=27s) So excited you're all here to join for the session today, and I think this is how a lot of us have felt the past couple years as AI technology has basically taken our jobs away.

[0:40](https://www.youtube.com/watch?v=LLuKshphGOE&t=40s) We've become slaves to, um, AI programming, to prompt developments, to building things off AI models. Now, it's not all bad. I mean, we, we have a lot more time to, to play games, to hang out in the matrix.

[0:52](https://www.youtube.com/watch?v=LLuKshphGOE&t=52s) But what we really wanna be doing is we wanna be doing things which are higher value. So this is where context engineering comes in the picture and transforms what we've traditionally been doing with kind of one-shot clever phrasing, prompt engineering to get different results out of the AI, and we're evolving that to have a more dynamic and,

[1:12](https://www.youtube.com/watch?v=LLuKshphGOE&t=72s) and more wider scope of things which we're feeding the AI as context, which gives us much better results. So, um, this allows us to feed the desire of agents to get even more context and information to do things together, um, to have more dynamic models and applications, to make our applications goal-driven, um, selectively curate the information for

[1:36](https://www.youtube.com/watch?v=LLuKshphGOE&t=96s) the relevancy of the particular domain which we're working in. So if you're working in a, um, an enterprise domain, if you're working with a lot of business context, this is particularly important.

[1:45](https://www.youtube.com/watch?v=LLuKshphGOE&t=105s) And then we can structure the input and get a lot more signal over all the noise of what's being entered into the model, which is one of the biggest problems with models today.

[1:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=113s) Um, huge context windows, but very little attention focus, and simply not looking at the right parts of the context to give us good results. And this allows us to think not like prompt engineers, but like information architects, where we're building the model context, which actually gives us superior results coming out of the AI.

[2:14](https://www.youtube.com/watch?v=LLuKshphGOE&t=134s) And this evolves us from being, um, you know, your traditional trapped matrix worker to being superheroes. So this is, this is where we wanna be. We wanna be in control of our destiny.

[2:25](https://www.youtube.com/watch?v=LLuKshphGOE&t=145s) We wanna be able to give the agents all of the information, all the context which they need to perform the task and to do exactly what we wanna get for results out of it.

[2:34](https://www.youtube.com/watch?v=LLuKshphGOE&t=154s) And there's a lot of tools at our disposal now which allow us to manipulate, control the context, and really, um, feed the AIs all the information which they need to be successful.

[2:44](https://www.youtube.com/watch?v=LLuKshphGOE&t=164s) So in the kind of the scope of context engineering, there's a whole bunch of things which are clearly, um, part of the domain that this now encompasses. So one is prompt engineering.

[2:56](https://www.youtube.com/watch?v=LLuKshphGOE&t=176s) Of course, we need to design, engineer good, good prompts, um, make sure that the AI actually has the right instructions, the right information, and the right grounding which it needs to do its job well.

[3:08](https://www.youtube.com/watch?v=LLuKshphGOE&t=188s) But we also need to pull in from different data sources by using things like Retrieval-augmented generation. So, um, RAG is still very relevant for the ability to pull in data from enterprise context, from different business contexts, and then supply that as additional information to the AI that it can use to make decisions.

[3:27](https://www.youtube.com/watch?v=LLuKshphGOE&t=207s) Um, pulling in state and history as well. So now we actually want our models want memory, um, both short-term memory, so they can collaborate with each other, and also long-term memory, so they remember the conversation state, the history, and, um, they can do more effective long-term operations.

[3:45](https://www.youtube.com/watch?v=LLuKshphGOE&t=225s) And we also want to be able to structure the output in a meaningful way, so we can actually feed into not only other applications, but other tools and things which we need to collaborate with and integrate our, um, context with.

[3:58](https://www.youtube.com/watch?v=LLuKshphGOE&t=238s) And when you put this all together, this is kind of the, the scope and domain of context engineering. Now, one of the big focuses of this is all about memory.

[4:08](https://www.youtube.com/watch?v=LLuKshphGOE&t=248s) So it's all about how we capture the AI memory and what we're able to do with it. So, um, there's kind of two main categorizations of memory. One is short-term memory, so this is what the AI is currently working with on the current tasks.

[4:23](https://www.youtube.com/watch?v=LLuKshphGOE&t=263s) Um, we wanna compress as much information as possible into the short-term memory and give it relevant results which are high up in the context window. Um, be able to integrate tool results into this as well, although, you know, not give it too much information from tools, especially from previous exchanges where the tools might have dumped a lot

[4:40](https://www.youtube.com/watch?v=LLuKshphGOE&t=280s) of output or information which will fill our context window. Um, and in addition to this, we also need to mix in long-term memory. So things which you've learned over a long set of conversations, which might be episodic.

[4:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=293s) Um, we need to figure out the s- semantic and the structural meaning of past conversations. Um, kinda pull this out into things which can either be used as instructions for the AI and also for procedures and operations which we can use to, to guide and plan the artificial intelligence.

[5:12](https://www.youtube.com/watch?v=LLuKshphGOE&t=312s) And, um, when we put this together, this helps us pull the more relevant context higher up into the context window, fill in the gaps, and then avoid a lot of the noise which gives us bad results or, um, hallucinations or other problems coming from our AI applications.

[5:30](https://www.youtube.com/watch?v=LLuKshphGOE&t=330s) And, um, memory is really the core of what we need to accomplish. Um, you know, if you're plugging yourself up to the matrix, this is where you sy- synergize all of your memories, all the things which you wanna get into the AI together with, um, your neur- own mind, your own neural network that you want to, um,

[5:49](https://www.youtube.com/watch?v=LLuKshphGOE&t=349s) express. And it's extremely important right now because LLMs are only as good as the quality of the response that they're getting from the data. So if you give them bad data, if you give them garbage, then you are gonna get garbage back out again.

[6:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=361s) So we need to give them the, the right information in the context window and kind of limit and give it, um, move it up as high as possible. Be able to do more dynamic prompting with things like DSPy and BAML.

[6:14](https://www.youtube.com/watch?v=LLuKshphGOE&t=374s) Um, ability to do more reasoning, um, so we can do internal context engineering on top of our data. This will turn us from human developers into agents, where we're actually using more agent technology to fuel our applications to build things.

[6:31](https://www.youtube.com/watch?v=LLuKshphGOE&t=391s) Um, and then this allows us to focus more on the time which we're doing our tests rather than just focusing on the time which we're training our models. Um, so together when we have more context now, it allows us to do better things, but then it's still important that we really have structured inform-information, relevant inputs, and this

[6:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=413s) improves the reliability and explainability of our models that come out of it. Um, so one of the ways which we can do this is by leveraging knowledge graphs. Knowledge graphs are a technology which has been around for a while, but they're very applicable for AI because they fill in that gap between the AI, which is very good

[7:12](https://www.youtube.com/watch?v=LLuKshphGOE&t=432s) at, um, creating things, building things, kind of pulling from different sources it has, but, um, structured information. Knowledge graphs are a structured representation to understand a bit about how a knowledge graph is constructed.

[7:26](https://www.youtube.com/watch?v=LLuKshphGOE&t=446s) It's typically built with facts, which are, are nodes about people, places, events, or things. Those are linked together by relationships or, um, um, lines between them, which reference how those things are related.

[7:40](https://www.youtube.com/watch?v=LLuKshphGOE&t=460s) It's very easy for both humans and LLMs to read knowledge graphs, so s- both acts as a, um, organizing concept, but also a way which you can understand what your AI is doing and actually look at some of the data behind it.

[7:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=473s) And, um, it can be of... also very useful as a digital twin of your organization, of your supply chain, of, um, a whole bunch of different processes in your organization.

[8:04](https://www.youtube.com/watch?v=LLuKshphGOE&t=484s) And the basic construct of a knowledge graph is, um, nodes, which represent different people in the situation, relationships, and then you can attach properties to these nodes. So this is an example of a knowledge graph where you have two people, they know each other, they live with each other.

[8:20](https://www.youtube.com/watch?v=LLuKshphGOE&t=500s) Well, one person lives with the other, so I guess technically it's Anne's house. And they both drive a car. Now, the car is owned by Dan or, or by Anne, but it's driven by Dan as well.

[8:33](https://www.youtube.com/watch?v=LLuKshphGOE&t=513s) So they both have a relationship with the car, and they have a relationship with living with each other, and you can see the, there's attributes on this, how long has Dan lived or driven the car, the type of car, so it's a Volvo, um, it's a, um, model V70, some information about it, and also some embeddings.

[8:52](https://www.youtube.com/watch?v=LLuKshphGOE&t=532s) So we can also encapsulate embeddings on the graph as well, so we can do vector lookups. And this allows us to do fairly complex things as we build larger knowledge graphs to capture all this information.

[9:06](https://www.youtube.com/watch?v=LLuKshphGOE&t=546s) And what knowledge graphs gives the benefit of is all of that knowledge, context, and enrichment that we can build into a representation of knowledge. In addition to LLMs, which have kind of that language, reasoning, and creativity, and when we put them together, we can do really powerful things.

[9:23](https://www.youtube.com/watch?v=LLuKshphGOE&t=563s) Um, so we talked a bit about RAG being an essential part of context engineering, and a even better way of doing RAG is GraphRAG. Now, what is GraphRAG? So GraphRAG is any retrieval pipeline which also uses graphs as part of the retrieval process.

[9:43](https://www.youtube.com/watch?v=LLuKshphGOE&t=583s) And so, um, an example of this is a user asks a question,

[9:48](https://www.youtube.com/watch?v=LLuKshphGOE&t=588s) um, it goes to the LLM, and it does a search, and it asks for if there's any relevant information, which will go a, as a query out to a knowledge graph.

[9:56](https://www.youtube.com/watch?v=LLuKshphGOE&t=596s) This then gets passed in as additional context to the LLM when it's answering the question, and then the LLM gives an enriched answer, which is more relevant. So it's, it's a...

[10:06](https://www.youtube.com/watch?v=LLuKshphGOE&t=606s) will give you more relevant results than just a vector similarity search because you also have information about relationships, about nodes, about community grouping, more context. So you can now get domain information, factual information, structured knowledge on your subject.

[10:23](https://www.youtube.com/watch?v=LLuKshphGOE&t=623s) You can explain what the LLM is actually doing because you can see the part of the knowledge graph which got passed to the LLM, and you can also evolve the knowledge graph over time, and you can now start to i-implement overlays like role-based access.

[10:35](https://www.youtube.com/watch?v=LLuKshphGOE&t=635s) So you can say only these people get access, for example, in a, um, patient i-information system. Only the doctor would have access to the diagnosis, but only the person who, um, handles the administrative information would have access to phone numbers or addresses or other personal information about the patient.

[10:55](https://www.youtube.com/watch?v=LLuKshphGOE&t=655s) So it allows you to kind of overloas- overlay that role-based access directly on the knowledge graph and then instruct the LLM on what information it's allowed to respond with.

[11:05](https://www.youtube.com/watch?v=LLuKshphGOE&t=665s) And, um, knowledge graphs allow this sort of explainable AI. So in a, in a large graph with a lot of nodes and a lot of information, now you can store the learnings from the user and agents into the interactions of the graph context.

[11:18](https://www.youtube.com/watch?v=LLuKshphGOE&t=678s) You can start to visualize conversation flows with the addition of reasoning. You can analyze the context data of agent systems about performance, um, identify opportunities for improvement over time of the, um, either the, um, the quality of the results which are passing in, the relationships, um, removing duplicate nodes so that you get better quality results coming out

[11:41](https://www.youtube.com/watch?v=LLuKshphGOE&t=701s) of it. So it gives you a lot of control over the application and the ability to modify and control what the AI is answering, kind of like you're, you're training in a, in a dojo.

[11:51](https://www.youtube.com/watch?v=LLuKshphGOE&t=711s) So I think, uh, you know, in the, in the film, Neo spends a lot of time doing virtual training, improving his skills with different programs he's loaded up. And, um, this is how we're able to do a lot of amazing things, like this demo which I'm gonna show you.

[12:05](https://www.youtube.com/watch?v=LLuKshphGOE&t=725s) So the first demo we're gonna show is a, um, GraphRAG demo using the LLM Knowledge Graph Builder. So I've already set up a Neo4j Aura instance, this is the, um, um, online free version of Neo4j.

[12:19](https://www.youtube.com/watch?v=LLuKshphGOE&t=739s) You can see I have a, a running instance with a bunch of relationships loaded up. And to load up those relationships, I use the Knowledge Graph Builder. The Knowledge Graph Builder is a very simple web application.

[12:31](https://www.youtube.com/watch?v=LLuKshphGOE&t=751s) It's open source, and it lets you do a couple things. So it lets you upload files, so you can drag and drop different files into the user interface. Before the presentation, I loaded up a couple representative files of a, um, supply chain use case.

[12:45](https://www.youtube.com/watch?v=LLuKshphGOE&t=765s) One is a supply chain document, and as you can see here, it has a whole bunch of information about different artifacts, um, and the digital signatures of them and the relationship in front of them.

[12:57](https://www.youtube.com/watch?v=LLuKshphGOE&t=777s) And the second one is the more interesting one. This is a, a VEX document, which is a security standard, and it talks about some vulnerabilities, um, in this case, inside the Jackson library, and talks a bit about, um, how to remediate with it, which versions are affected, um, which commits fix it, and all that good stuff.

[13:16](https://www.youtube.com/watch?v=LLuKshphGOE&t=796s) So, um, we have quite a bit of information which we loaded up. And then what I've done is I've already dropped those into the knowledge graph, and we can take a look at what got generated by the LLM.

[13:28](https://www.youtube.com/watch?v=LLuKshphGOE&t=808s) So it takes this through an ingest phase, um, where the LLM actually builds out a knowledge graph, and then we can see that the-- some of these nodes represent different parts of the, um, VEX document.

[13:41](https://www.youtube.com/watch?v=LLuKshphGOE&t=821s) Um, here we can see some information about, um, um, who found the vulnerability, information about the, um, vulnerability database URL, and, um, all this stuff is connected with different relationships, and this allows us to query, navigate, and traverse this information to build better responses for the LLM.

[14:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=841s) So what we're gonna do in this demo is we're gonna take this knowledge graph, which we built, and then we're going to run an LLM which does a two-pass process.

[14:12](https://www.youtube.com/watch?v=LLuKshphGOE&t=852s) The first pass, it's going to do a vector lookup and find a similarity search to find related nodes in the knowledge graph. And the second pass, it's going to take those nodes which are related to the result, find related nodes, and then pass those in as context to the LLM.

[14:30](https://www.youtube.com/watch?v=LLuKshphGOE&t=870s) And ideally, what we'd, what we'd like to get from the LLM is that, um, it will answer questions with information it has from the knowledge graph, and then it won't be able to answer questions or refuse to answer questions with things which are outside of that knowledge, um, pool.

[14:45](https://www.youtube.com/watch?v=LLuKshphGOE&t=885s) So let's ask it, um, about vulnerabilities in the, in the Jasper library. So Jasper is another, um, Java library that's very commonly used. It wasn't actually referenced in the VEX document.

[15:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=901s) So we're-- in this case, we're hoping to get a no response. Okay. So that's amazing. I, I made a typo. I should have said Jackson.

[15:12](https://www.youtube.com/watch?v=LLuKshphGOE&t=912s) Let's see what we get when we, um, ask about the Jackson library, even with the typo, because LLMs know that humans aren't perfect, and they're very good at fixing our mistakes.

[15:21](https://www.youtube.com/watch?v=LLuKshphGOE&t=921s) And, um, here we can see that it actually pulled that information about the Jackson Databind library with an XML injection attack. It knows a bit about the vulnerability, what version it's in, um, whether it's fixed and at which version it's fixed.

[15:37](https://www.youtube.com/watch?v=LLuKshphGOE&t=937s) And, um, all this information is, is pulled from and aggregated off the knowledge graph. So, um, it gives us quite a lot of information, um, very detailed and, and very focused because it's grounded in a, um, data which is, um, very, um, uh, complete.

[15:55](https://www.youtube.com/watch?v=LLuKshphGOE&t=955s) Um, it's finite, and it's something we can edit, modify, and change the response over time. So knowledge graphs are a very powerful tool. It allows us to do things like this where we can, um, get better responses and better answers.

[16:09](https://www.youtube.com/watch?v=LLuKshphGOE&t=969s) And now with knowledge graphs at our disposal, now we can, we can go and we can fight the, um, the evil agents. Actually, it's kind of ironic that the, um, the agents of the Matrix film were, um, the bad guys, but actually they operated and acted a lot like modern agents, where we're having LLMs collaborate, pool together,

[16:31](https://www.youtube.com/watch?v=LLuKshphGOE&t=991s) and, um, cooperate on different algorithms. And even the agents of the film had different personalities and, um, different types, um, kinda like individual agents. So, um, we need to power up and, and get our, um, Matrix and graph skills up to a level where we can go tackle the agents with new tools like memory retrieval.

[16:51](https://www.youtube.com/watch?v=LLuKshphGOE&t=1011s) So we, we talked a bit about graph retrieval and, um, graphs are also a great tool and mechanism which you can use to do, um, memory retrieval as well.

[17:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=1021s) So we can do search, um, in, in memory, use graph memory retrieval tools. We have an open source MCP server which does a lot of this for graph retrievals.

[17:11](https://www.youtube.com/watch?v=LLuKshphGOE&t=1031s) And now you can q-query the graph not only for knowledge graphs, but also vectors as we did in the last, um, example. And we can also use graph data science algorithms like, um, community groupings or k-nearest neighbors or different graph algorithms which allow us to get, um, pull some insights out of the relationship and the structure of

[17:31](https://www.youtube.com/watch?v=LLuKshphGOE&t=1051s) the graph, pull back relevant information, and then pass this as additional context, um, either for short-term or long-term memory into the agent loop, um, where now we're feeding the agent with additional information and context from either, um, a short-term memory source about the current conversation or knowledge pulled in, like kind of what we showed in the previous

[17:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=1073s) example from a graph or from a long-term structure of memory where we memorize, um, previous conversations, give them temporal information, and then structure those into a memory that can be retrieved from the graph.

[18:07](https://www.youtube.com/watch?v=LLuKshphGOE&t=1087s) And, um, now we're able to use graph memory to capture knowledge in the form of entities and relationships between them, where some nodes have the relevant properties such as text details and headings, time, and location on top of them.

[18:18](https://www.youtube.com/watch?v=LLuKshphGOE&t=1098s) So this is kind of a, a visual representation of our, of our graph, our memory graph. Some of these properties get vector embedded, and this enables us to do vector-based semantic search.

[18:28](https://www.youtube.com/watch?v=LLuKshphGOE&t=1108s) So now we can do semantic search on the graphs via projections into vector space. But then we can also use algorithms like k-approximate nearest neighbors, community groupings, um, PageRank algorithms on top of the graph to answer different types of questions and to kind of bubble up the most relevant results into the context.

[18:51](https://www.youtube.com/watch?v=LLuKshphGOE&t=1131s) This gives us quite a lot of power 'cause we can do both the vector embeddings, but we can also

[18:57](https://www.youtube.com/watch?v=LLuKshphGOE&t=1137s) do additional graph algorithms on top of it.

[19:02](https://www.youtube.com/watch?v=LLuKshphGOE&t=1142s) Okay, so now we have our, our superpower with our, our graph. We're, we're able to do amazing things which aren't possible just with, um, vector embeddings and similarity searches, kind of like, like the bullet time in the Matrix films.

[19:15](https://www.youtube.com/watch?v=LLuKshphGOE&t=1155s) Um, this will allow us to do amazing stunts and to evade the, um, um, the agents. But let's give a quick example of how this would actually work in practice.

[19:24](https://www.youtube.com/watch?v=LLuKshphGOE&t=1164s) So let's say, uh, my question to the LLM was, "Let's update this presentation from the last time I presented with Sid," who's my colleague in India. Um, so we can now search this information in the graph, and there's two relevant people for this, right?

[19:39](https://www.youtube.com/watch?v=LLuKshphGOE&t=1179s) So it's, it's me, um, VP of DevRel, it's Sid, who's a community manager, and the event, and the last time we presented it was at an event called GIDS, um, which is, uh, an event in Bangalore, awesome developer conference.

[19:54](https://www.youtube.com/watch?v=LLuKshphGOE&t=1194s) So, um, now we have kind of that temporal relationship with the two people and then an event. And we can add to this the, the memory record at a particular time of the presentation.

[20:08](https://www.youtube.com/watch?v=LLuKshphGOE&t=1208s) So now we're pulling back information about this presentation at a specific point in time, and we can pass this in as context to the LLM. So when we ask it to update the presentation, we both have the context of who presented, where they presented, and the time period in which they presented for the LLM to build additional

[20:27](https://www.youtube.com/watch?v=LLuKshphGOE&t=1227s) information on top of it. This is only possible because we can do this, um, multi-stage query with graphs. Graphs excel in use cases where you're able to pull in multiple facts which are related, um, but don't get pulled back in a single query.

[20:43](https://www.youtube.com/watch?v=LLuKshphGOE&t=1243s) If you can do it in a, in a one-shot or you can get a, a single similarity search, um, standard vector RAG is, is fine for those sorts of use cases.

[20:52](https://www.youtube.com/watch?v=LLuKshphGOE&t=1252s) It's where the relationships are two or more where you get the real value from doing, um, graph RAG and graph memory.

[21:01](https://www.youtube.com/watch?v=LLuKshphGOE&t=1261s) And, uh, this allows us to do a whole bunch of different types of graph retrievers. So, um, we could do explicit retrieval queries where we have pre-canned retrieval queries with different entry points and retrieving some context.

[21:11](https://www.youtube.com/watch?v=LLuKshphGOE&t=1271s) So this gives us some great information from the graph, but we can do better by doing text to Cypher, so fine-tuning the LLM with the schema, generating a query for the question.

[21:21](https://www.youtube.com/watch?v=LLuKshphGOE&t=1281s) And then we can kind of take this to the next level with agentic traversal, where we iteratively navigating over the graph, collecting information until we answer it, and using an appropriate set of tools.

[21:30](https://www.youtube.com/watch?v=LLuKshphGOE&t=1290s) And to show an example of this, um, we're gonna use the same knowledge graph which I loaded up again in our demo number two. But this time, we're gonna query that knowledge graph using Claude Code.

[21:44](https://www.youtube.com/watch?v=LLuKshphGOE&t=1304s) So what I've done is I've hooked up Claude Code using the, um, Neo4j MCP Cypher, um, MCP server, which is an open source extension called the Neo4j Cypher MCP server, which I've already configured with the database settings.

[22:00](https://www.youtube.com/watch?v=LLuKshphGOE&t=1320s) And now when we talk to Claude and we ask it a question, it can answer with that additional graph context that it can tell us things. So I put a few keywords into the MCP server like, um, graph and database, and we can ask it, um, "What do you know about the Jackson vulnerability,

[22:18](https://www.youtube.com/watch?v=LLuKshphGOE&t=1338s) uh, based on your graph database?" And so now in addition to, you know, pulling in information from its standard knowledge sources, it's gonna use the Neo4j MCP server and then query it to get additional information.

[22:32](https://www.youtube.com/watch?v=LLuKshphGOE&t=1352s) And you can see that it's doing this multiple step plans, um, search of the graph. So first it gets back the schema of the graph so it can understand the relationships and how the graph is structured.

[22:44](https://www.youtube.com/watch?v=LLuKshphGOE&t=1364s) Now that it understands the schema of the graph, it can go back and it can make a bunch of queries to get information about the particular vulnerability. So it's firing off a bunch of different Cypher queries.

[22:54](https://www.youtube.com/watch?v=LLuKshphGOE&t=1374s) Cypher is the, um, graph query language for Neo4j, and most graph databases support it. It's also now a standard. The GQL standard that's ratified by ISO is, um, basically is a subset of Cypher.

[23:09](https://www.youtube.com/watch?v=LLuKshphGOE&t=1389s) And now that it got back information about the vulnerabilities, it's pulling back some of the text chunks to get additional context which are hanging off of those nodes. And this way it can give us a, a very complete answer with as much information and context as possible from the graph.

[23:25](https://www.youtube.com/watch?v=LLuKshphGOE&t=1405s) And the, the main difference between this approach w- compared to the previous one is the previous approach was relatively fast, but you-- the level of detail it gave us on the CVE was limited.

[23:40](https://www.youtube.com/watch?v=LLuKshphGOE&t=1420s) When we give a, an, an agent, in this case we're giving the Claude agent the ability to kind of have at it for the graph, do traversals, get information, do more traversals, you can see that it gives us back very detailed information about the vulnerability.

[23:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=1433s) So it figured out the CVE number, the affected vulnerability, the type of attack, the severity, and a technical description of the attack, so it's a lot more detailed than what we got before.

[24:04](https://www.youtube.com/watch?v=LLuKshphGOE&t=1444s) And it tells us specifically what versions we need to upgrade to remediate the attack, um, and gives us some advisory information as well about this. So, um, if we were trying to develop a, um, vulnerability report or something to kind of explain w- how we should as an organization, um, address this vulnerability, um, using this sort of

[24:23](https://www.youtube.com/watch?v=LLuKshphGOE&t=1463s) agentic multi-step, um, MCP retrieval approach is quite powerful because you can see that it gives us, um, the best possible response since it's able to go back and keep pulling additional information from the knowledge graph that it needs.

[24:38](https://www.youtube.com/watch?v=LLuKshphGOE&t=1478s) Okay, so we've seen a few different ways which we can apply knowledge graphs to solve and improve the context of our AI applications. So now that we know that we need graphs, we need, we need a lot of graphs, and the best place to find information about graph technology and getting a lot of different use cases for

[24:56](https://www.youtube.com/watch?v=LLuKshphGOE&t=1496s) graphs is GraphAcademy. It's a entirely free resource to learn about, um, both Cypher queries. It has courses on Cypher queries, has courses on GraphRAG with examples in both Python and TypeScript.

[25:09](https://www.youtube.com/watch?v=LLuKshphGOE&t=1509s) Um, we have some more advanced, um, GraphRAG courses coming up as well. So, um, a lot of information which is all free and very hands-on for you to get started and actually build your first application, kind of like the ones which I showed here in the presentation.

[25:21](https://www.youtube.com/watch?v=LLuKshphGOE&t=1521s) Um, now, if we want even more knowledge, kind of a wider span, we can then go to Nodes AI 2026, which is our free online virtual conference. Um, this is following up the amazing Nodes conference we had last week with, um, over 13,000 registrants, so it was a huge event.

[25:41](https://www.youtube.com/watch?v=LLuKshphGOE&t=1541s) And Nodes AI is all about AI for, um, an entire day with AI-focused sessions. The CFP is open right now if you'd like to submit, and it's free to attend and watch all the sessions.

[25:53](https://www.youtube.com/watch?v=LLuKshphGOE&t=1553s) And if we wanna really get down and, you know, beat the architect at his own game, then we need a lot of deep research and information, and the best place for that is Graphrag.com, which is a community site which we support, um, where it has all the latest research on different GraphRAG approaches, um, how-to guides and conceptual

[26:17](https://www.youtube.com/watch?v=LLuKshphGOE&t=1577s) information about how to implement GraphRAG, and just a general resource which will help you to up-level your ability to apply graphs to different problem domains, um, with a whole bunch of, of the cutting-edge latest research which is coming out.

[26:33](https://www.youtube.com/watch?v=LLuKshphGOE&t=1593s) So, um, exciting stuff. Thank you very much for joining me for the session today, and I hope you learned a little bit more about how you can use graphs to connect the dots and improve your context engineering for your AI applications.
