Connecting the Dots with Context Graphs — Stephen Chin, Neo4j

By AI Engineer

Share:

Key Concepts

  • Context Graphs: A framework for connecting disparate enterprise data sources, decision traces, and reasoning tool calls to provide a consolidated, grounded view for AI agents.
  • Knowledge Graphs: Databases that store data as nodes (entities) and relationships, allowing for complex, performant traversals and semantic connections.
  • GraphRAG (Retrieval-Augmented Generation): An advanced RAG technique that uses knowledge graphs to provide grounded, context-rich information to LLMs, moving beyond simple vector similarity.
  • Agentic Memory: The integration of short-term, long-term, and reasoning memory into a graph structure to enable persistent, explainable AI decision-making.
  • Cypher: The query language used for interacting with Neo4j graph databases.
  • Embeddings: Vector representations of data that allow for similarity searches within the graph.

1. The Problem: The "Matrix" of Siloed Data

Stephen Chin argues that engineers are currently "trapped" in a matrix of disparate, siloed enterprise systems (Slack, CRM, support tickets, etc.). When AI agents make decisions based on fragmented data, they lack the necessary context, leading to generic or inaccurate outcomes. The goal is to move from this "blue pill" state of confusion to a "red pill" state of reasoning, where all enterprise data and decision history are connected.

2. Knowledge Graphs vs. Baseline LLMs

Chin illustrates the evolution of retrieval accuracy through a healthcare case study:

  • Baseline LLM: Provides generic, broad knowledge (e.g., "prevent damage to lungs").
  • Vector-based RAG: Provides slightly better context (e.g., "respiratory therapy"), but still lacks specific patient history.
  • GraphRAG: Provides grounded, complete information by pulling in specific patient history, previous diagnoses, and operations. This allows the agent to recommend highly specific actions like "pulmonary rehabilitation" based on the patient's actual smoking history and surgical background.

3. The Three Pillars of Agentic Memory

To build robust, repeatable AI systems, Chin proposes storing three types of memory in a knowledge graph:

  1. Short-term Memory: Current pipeline state, active conversations, and immediate task status.
  2. Long-term Memory: Aggregated domain models, business processes, and historical interactions across multiple users/tasks.
  3. Reasoning Traces: The "why" behind decisions. By storing the reasoning process, developers can create audit trails, improve future decision-making, and ensure compliance.

4. Technical Framework and Methodology

The architecture for a context graph system involves:

  • Data Ingestion: Connecting to various sources (CRM, support tickets, business data) via MCP (Model Context Protocol) tools.
  • Graph Construction: Using LLMs to generate Cypher queries and structure unstructured data into nodes and relationships.
  • Algorithms: Utilizing graph algorithms like Louvain (for community grouping) and FastRP (for graph embeddings) to navigate complex structures efficiently.
  • The Loop: The agent searches the graph, performs reasoning, and pushes the resulting decision back into the graph as a new "memory" for future use.

5. Real-World Application: Financial Services

Chin demonstrated a financial application for loan approval:

  • Process: The system pulls data from support tickets, CRMs, and internal systems.
  • Explainability: When the AI recommends rejecting a loan for "Jessica Norris," it provides the specific reasoning: previous rejections, margin trade risks, and fraud patterns.
  • Outcome: The human user receives a transparent, auditable decision backed by data, rather than a "black box" output.

6. Notable Quotes

  • "Rather than us controlling [AI tools], they are controlling us."
  • "Knowledge graphs are a very powerful tool for us to aggregate all this information, create the connections, create the relationships."
  • "Graphs are a great use case for memory because relationships are first class within knowledge graphs."

7. Synthesis and Conclusion

The transition to context graphs represents a shift from simple AI chatbots to agentic applications that possess institutional memory. By leveraging Neo4j’s graph architecture, developers can build systems that are not only more accurate and grounded but also fully auditable and explainable.

Actionable Resources:

  • Neo4j Agent Memory Package: An open-source GitHub repository for implementing short-term, long-term, and reasoning memory.
  • GraphAcademy: Offers a free "Context Graph" course and free Aura instances for hands-on experimentation.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Related Videos

Ready to summarize another video?

Summarize YouTube Video