AI · AIC-92

GraphRAG and Agent Memory

GraphRAG and Agent Memory is an advanced follow-on to basic RAG, covering how to build knowledge graphs in Neo4j from documents with LLMs, use graph and Text2Cypher retrievers, and design long-term memory for AI agents with LangGraph and Graphiti. It suits AI engineers and Python developers who already run RAG systems and have hit the limits of vector search.

Updated
From 7,110 THB / person 7,900 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration12 hours · 2 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

RAG systems built on vector search alone answer well when the answer sits in a single passage, but they often miss when a question has to connect several documents, such as which product models a customer uses that are affected by the latest notice, or when it asks about the whole dataset. At the same time, AI agents that work with users over time need to remember who said what and know which facts are out of date. Knowledge graphs have become an important data layer for both RAG and agent memory.

This course is the second step after RAG & Knowledge Base and shows learners how to build GraphRAG and agent memory with Neo4j and Python. Learners write Cypher, design a graph schema and build a knowledge graph from documents with an LLM using the neo4j-graphrag package, compare vector, vector plus graph and Text2Cypher retrievers, and learn the community summary approach of GraphRAG. They then move on to short-term and long-term agent memory with LangGraph and temporal knowledge graphs with Graphiti, measure the results against vector RAG, and put security and PDPA controls in place. It closes with a capstone GraphRAG agent. (2 days, 6 hours per day, 12 hours in total, Advanced level.)

What you’ll gain

  • Explain when GraphRAG is worth it compared with vector RAG, and when it is not needed
  • Write Cypher to create and query data in Neo4j, including vector indexes
  • Design a graph schema and build a knowledge graph from documents with an LLM
  • Use vector, vector plus graph and Text2Cypher retrievers to suit each question
  • Understand community summaries and the local and global search modes of GraphRAG
  • Design short-term and long-term agent memory with LangGraph
  • Build temporal memory that knows which facts have changed, using Graphiti
  • Measure GraphRAG against vector RAG and put security and PDPA controls in place

Who this course is for

  • AI engineers and Python developers who have built RAG systems and hit the limits of vector search
  • People who have completed RAG & Knowledge Base and want to take the next step
  • AI agent developers who want agents to remember users and context across sessions
  • Data engineers who need to connect several data sources for AI to use
  • Solution architects who must choose RAG and memory architectures for their organisation

Prerequisites

  • Working Python skills such as functions, classes and installing packages
  • An understanding of RAG, embeddings and vector search, or completion of RAG & Knowledge Base
  • Basic Docker, command-line and REST API skills
  • A laptop that can run Docker Desktop, Python and VS Code, with permission to install software

Curriculum

Course Details

The course runs for 2 days, 6 hours per day (12 hours in total, 09:00-16:00), as lectures with labs built on a single sample dataset throughout. Advanced level. It is the second step after RAG & Knowledge Base, which covers vector RAG, and adds a knowledge graph in Neo4j to answer questions that span several documents, plus memory for AI agents with LangGraph

and Graphiti. Every lab runs Neo4j Community Edition on Docker or the free tier of Neo4j Aura. Learners use their own or company Gemini API or OpenAI API accounts, which are billed by usage (the Gemini API has a free tier). Learners take home a lab guide, Python and Cypher code for every lab, a docker-compose file for Neo4j and a set of test questions.

Day 1 Knowledge Graphs and GraphRAG

Section 1: Why Vector RAG Alone Is Not Enough

  • Questions vector RAG misses: spanning documents, multi-level relationships and whole-dataset questions
  • What a knowledge graph is: nodes, relationships and properties
  • GraphRAG patterns: graph-enhanced vector search, Text2Cypher and community summaries
  • When a graph is worth it, and when vector RAG is enough
  • Lab: install Neo4j with Docker or use the free tier of Neo4j Aura

Section 2: Lab: Cypher for RAG

  • Create nodes and relationships with CREATE and MERGE
  • Query with MATCH, WHERE and multi-hop paths
  • Constraints, indexes and vector indexes in Neo4j
  • Common GraphRAG queries and reading results in Neo4j Browser

Section 3: Designing a Graph Schema from Documents

  • Define entities and relationships from the questions the business needs answered
  • Lexical graph: link documents and chunks to entities
  • Entity resolution: merge names written differently, including Thai and English names
  • Lab: design a schema for a sample product manual and company policies

Section 4: Lab: Building a Knowledge Graph with an LLM

  • Use SimpleKGPipeline from the neo4j-graphrag package to extract entities from text and PDFs
  • Give the LLM a schema so it extracts only what you need
  • Check the quality of the resulting graph and fix duplicate entities
  • Cost and time when building a graph from large document sets

Section 5: Lab: Different Retrievers

  • Vector and hybrid retrievers on Neo4j
  • VectorCypherRetriever: find chunks, then expand the context along relationships
  • Text2CypherRetriever: turn questions into Cypher, and what to watch out for
  • Lab: a Q&A system that picks a retriever by question type

Section 6: Whole-dataset Questions and Community Summaries

  • The Microsoft GraphRAG approach: community detection and per-community summaries
  • How local search, global search and DRIFT search differ
  • Lower-cost indexing approaches such as LazyGraphRAG and LightRAG
  • Lab: answer whole-dataset questions with community summaries
Day 2 Agent Memory and Production Use

Section 7: Agent Memory Fundamentals

  • Short-term and long-term memory, and semantic, episodic and procedural memory
  • What to remember, what not to remember, and when to forget
  • Vector memory compared with graph memory
  • A tool overview: the LangGraph store, Mem0 and Graphiti

Section 8: Lab: A LangGraph Agent That Uses the Graph as a Tool

  • An agent that chooses vector search, graph queries or Text2Cypher as tools
  • A checkpointer to remember the conversation within a thread
  • Long-term memory in a store, separated by user
  • Test the agent with questions that need several retrieval steps

Section 9: Lab: Temporal Memory with Graphiti

  • Store facts with the period they are valid and know which facts have been superseded
  • Add episodes from conversations and business events
  • Hybrid search across semantic, keyword and graph traversal
  • An agent that remembers customer needs and history across sessions

Section 10: Lab: Evaluating GraphRAG and Memory

  • Test question sets with single-hop, multi-hop and whole-dataset questions
  • Measure correctness, completeness and source citation
  • Compare vector RAG and GraphRAG on the same question set
  • Check for wrong or stale memories and how to correct them

Section 11: Security and Production Use

  • Prevent Cypher injection with read-only access and checking queries before they run
  • Per-user access control in both the graph and memory
  • PDPA: personal data in memory, the right to erasure and retention periods
  • Incremental graph updates when documents change, with latency and cost in mind

Section 12: Workshop: GraphRAG Agent Capstone

  • Choose a brief: a technical manual assistant, a policy assistant or a customer assistant that remembers history
  • Build the graph, retrievers and memory for the system
  • Measure it against vector RAG on the same questions
  • Present the work and a plan for next steps

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

How does GraphRAG differ from vector RAG, and when should you use it?

Vector RAG retrieves text chunks close in meaning to the question, so it works well when the answer sits in one passage but struggles with questions that link several documents or ask for an overview. GraphRAG stores entities and relationships as a knowledge graph, so it can follow connections across documents and answer overview questions with community summaries. Building and maintaining the graph costs more, so use it when such questions are common.

How do you build a knowledge graph from documents with an LLM?

Start by designing a graph schema that sets the node and relationship types, such as people, companies and contracts. Split the documents into chunks, have the LLM extract entities and relationships that fit the schema, merge duplicate entities, and write the results to Neo4j with Cypher, adding a vector index for semantic search. Finally, spot-check the graph to confirm the relationships are correct.

How do short-term and long-term agent memory differ?

Short-term memory is the context of the current conversation, such as earlier messages in the same thread, which LangGraph keeps with a checkpointer. Long-term memory is information the agent remembers across sessions, such as a user's preferences, which is stored separately and retrieved when relevant. Temporal memory, as in Graphiti, also records when facts were true, so the agent knows which information has been superseded.

Who is the GraphRAG and Agent Memory course for, and what should I know beforehand?

It suits AI engineers and Python developers who run RAG systems and have hit the limits of vector search, AI agent developers who want agents to remember users across sessions, and solution architects choosing RAG architectures. You should write working Python, understand RAG, embeddings and vector search or have completed the RAG & Knowledge Base course, and use Docker and the command line at a basic level.

What will I be able to do after the GraphRAG and Agent Memory course?

You will be able to write Cypher to build and query data in Neo4j, design graph schemas and build knowledge graphs from documents with an LLM, choose vector, graph and Text2Cypher retrievers to suit each question, design agent memory with LangGraph and Graphiti, and evaluate GraphRAG against vector RAG. Participants who complete the training receive a Certificate of Completion with its own number, which can be verified online.

What do I need to bring for GraphRAG and Agent Memory?

Bring a laptop that can run Docker Desktop, Python and VS Code, with permission to install software. Every lab runs Neo4j Community Edition in Docker or uses the free Neo4j Aura tier, together with your own or your company's Gemini API or OpenAI API account, which is charged by usage (the Gemini API has a free tier).