Agentic GraphRAG: AI’s Logical Edge — Stephen Chin, Neo4j

Introduction and Context 00:03

  • Stephen Chin introduces himself as head of developer relations at Neo4j and mentions writing a new book on graph RAG with O'Reilly.
  • The talk will cover agentic GraphRAG and how to leverage it.
  • Attendees are polled about their experience with graph databases and graph RAG.

Challenges with Standard LLM and Agentic Systems 01:08

  • Current agentic systems often fail to meet use cases and are prone to hallucinations and biases.
  • An example shows an LLM making incorrect assumptions and gender-biased decisions when reasoning about a classroom scenario.
  • Such issues can lead to incorrect business outcomes, especially in high-stakes domains like life sciences or supply chain management.
  • LLMs provide surface-level intelligence but lack true reasoning capabilities.

Introducing Knowledge Graphs and Agentic Architectures 03:35

  • Knowledge graphs can provide deeper reasoning and structure lacking in standard LLM responses.
  • Agentic systems improve result quality by using multiple agents (LLMs) in orchestrated workflows.
  • However, traditional agentic architectures are monolithic, difficult to maintain, and hard to secure.

Using MCP and Neo4j Tools for Agentic Systems 04:40

  • MCP (Multi-Channel Platform) serves as a tool orchestration layer, with agents interacting through data sources and servers.
  • Neo4j has developed tools on MCP, including:
    • A Cypher tool to generate queries from prompts.
    • A memory module for agent memory integration.
    • Cloud API connectors for database provisioning.
  • Tools can be plugged into agent architectures for enhanced memory and logic.
  • Many agent frameworks (e.g., Zep, Cognney, Memz) run on top of Neo4j and use it to provide graph-based memory.

Advantages of GraphRAG and Pattern Overview 06:47

  • Systems using GraphRAG show lower hallucination rates and provide more relevant, structured answers than vector-only RAGs or direct LLM outputs.
  • Vector similarity-based RAG improves over direct LLM, but relevance and actual understanding are still limited.
  • GraphRAG pattern involves:
    • Initial vector search to map questions to relevant nodes.
    • Retrieval of connected nodes (context) from the knowledge graph.
    • Effective for combining structured and unstructured data in responses.

Architecture and Practical Implementation 08:00

  • Typical GraphRAG pipeline uses both traversal (graph) and vector similarity.
  • Input questions undergo vector or graph search; graph analytics can further enhance results.
  • Context derived from graph is provided to LLM to improve answer quality.
  • Neo4j’s MCP server provides text-to-Cypher functionality, although generated queries from LLMs can sometimes be inaccurate.
  • Best pattern is performing a vector search, mapping results to graph nodes, and re-ranking for context relevance.

Real-world Adoption and Results 09:27

  • Example: CLA replaced SaaS systems with a GraphRAG solution, using enterprise wikis, HR systems, and documentation.
  • Processed 250,000 employee questions in the first year, serving 2,000 daily queries, with 85% employee adoption.

Resources and Learning Opportunities 10:04

  • Neo4j Certified Developer Program is recommended for hands-on learning; it offers certification and community support.
  • Neo4j’s free annual Nodes Conference provides global, 24-hour content on graph technology and applications.

Q&A: Implementation Details and Integrations 11:17

  • Standard pattern: LLM translates user queries to vector search; top results are mapped to graph nodes to provide context.
  • When importing unstructured data, Neo4j creates nodes and attaches embeddings as node properties.
  • Various plugins and integrations exist, including Neo4j Python library, LangChain, LlamaIndex, and Haystack, supporting flexible associations and workflows.
  • MCP's memory functionality specifics are developed by Michael Hunger's team (more details in a subsequent session).

Q&A: Frameworks Comparison 14:30

  • Neo4j integrates with multiple agent and memory frameworks.
  • On LangChain vs. LangGraph: LangGraph is seen as an agent extension built by the LangChain team.
  • Recommended to use whichever framework best suits needs, as Neo4j supports broad integration.