Memory Masterclass: Make Your AI Agents Remember What They Do!

Thumbnail for Memory Masterclass: Make Your AI Agents Remember What They Do! Watch on YouTube
TL;DR
  1. 1

    Mark Bain argues that memory includes data in any format, including code, algorithms, hardware, and causal changes that affect them.

  2. 2

    Graph memory preserves relationships and causal links, which the speakers connect to better recall, fewer hallucinations, and more useful reasoning.

  3. 3

    Daniel Chalef argues that memory should be modeled around a business domain because semantically similar facts can still be irrelevant to an agent's task.

Summary

Mark Bain frames AI memory as more than a store of retrieved text. He defines it as data in any format, including code, algorithms, hardware, and causal changes. His main argument is that relationships preserve causality, so graph structures can give agents context that vector similarity alone cannot provide. The workshop then demonstrates several approaches. Vasilia Marovitz shows Cognee turning GitHub data into a semantic graph that agents can search and update. Alex Gilmore demonstrates a Neo4j MCP memory server that records entities, observations, and relationships across conversations. Daniel Chalef presents Zep and Graphiti's domain-aware temporal memory, where developers define business objects and filter retrieval by type. Bain closes with a graph chat arena built with Google ADK, where different memory systems can operate against a shared graph. He also proposes an agentic firewall for code-executing agents, based on episodic memory of commands and sessions.

Key ideas
05:16

AI memory includes data, code, hardware, and causal changes

Mark Bain defines AI memory broadly as "any data in any format," including code, algorithms, and hardware. He also includes causal changes that affect those things. This definition gives the workshop a wider scope than chat history or a vector database. Bain connects the idea to biological systems, cosmological structures, and quantum structures, which he says also preserve information through relationships and change. His focus is on how systems retain the structure of what happened, rather than only storing isolated facts.

12:17

Relationships preserve causality in graph memory

Bain argues that relationships are what preserve causal links in memory. He distinguishes graph-based retrieval from simpler and hybrid retrieval approaches because graphs can retain how pieces of information connect. He says this can help reduce hallucinations and improve hypothesis generation and testing. His explanation links memory to asymmetries, curvature, and temporal change, although he presents the broader physics claims as work that will require future papers. The practical takeaway is direct: agent memory needs relationships when the order and causes of events matter.

14:36

Hallucinations can result from too little memory and compute

Bain describes hallucinations as a consequence of trying to solve problems with too little memory or compute for the full combinatorial space. An agent takes a hypothesis from its history and projects it into the future, but the result is limited by the resources available. In this view, more memory and compute give the system more information with which to constrain those projections. Bain connects reasoning to reading asymmetries and causal links, then argues that agentic systems need graph databases to recover those links from otherwise fuzzy model behavior.

17:39

Cognee turns source data into a searchable semantic graph

Vasilia Marovitz demonstrates Cognee with GitHub repositories from two developers. The system ingests GitHub data, builds a semantic graph, and lets a crew of agents search the graph and compare the developers for a hiring task. The graph is updated as data is ingested, enriched, and analyzed. Marovitz says Cognee supports more than 30 data sources, can build graphs from relational and semi-structured data, and includes memory association layers inspired by cognitive science. The agents can read and write the graph, then produce a report from the accumulated information.

23:14

A Neo4j MCP server records entities, observations, and relationships

Alex Gilmore demonstrates a Neo4j memory MCP server through Claude Desktop. At the start of a conversation, the memory store is empty. After each interaction, the system recalls related memories and then creates or updates entities and relationships. An entity has a name, a type, and observations, which are facts learned about it. The graph can later be read back as context, summarized, and visualized in Neo4j Browser. Gilmore also shows that the same graph can be used in later conversations and with clients such as Cursor and Windsurf.

28:24

Memory should follow the business domain

Daniel Chalef argues that there is no one-size-fits-all memory. Developers should model memory around the objects and relationships in their business domain. He gives a media assistant as an example: facts about jazz, podcasts, and listening preferences belong to the application, while facts such as the user's dog's name or wake-up time may be irrelevant. A vector search can retrieve those facts because they are semantically similar to a request about tunes. Chalef's point is that semantic similarity does not equal business relevance.

32:41

Typed business objects make temporal memory easier to control

Chalef demonstrates a finance coach built with Zep. The application defines objects such as financial goals, debts, and income sources, along with fields and business rules. Developers can describe entity types and filter searches by node type. When the user adds a monthly rent amount, Zep extracts it and places it into the appropriate graph structure. This gives the application a more controlled memory model than dumping arbitrary facts into a vector store. The graph shows the user's entities and the fields defined by the developer.

36:09

An agentic firewall could use episodic memory of code execution

Bain proposes an agentic firewall for systems where agents execute code across terminals, shells, and machines. He describes his previous security work, where one project involved moving among many terminals and learning the different languages and commands used by operating systems, firewalls, and network devices. A natural-language shell could translate user requests, but Bain says it would need episodic memory of what happened over time. That history could cover commands, machines, users, and sessions, giving the system context for controlling code execution.

41:03

The GraphRAG chat arena compares memory systems through shared experiments

Bain presents a prototype he calls an agentic memory arena, similar in concept to WebArena but focused on memory. The repository includes integrations for Mem0, Graphiti, and Cognee, with both library and MCP approaches under consideration. The demo uses Google ADK to provide a chat interface where users switch between agents, including a Neo4j agent and a Cypher graph agent. These agents write and search a shared Neo4j graph, allowing different memory solutions to be tested on how they create and retrieve graph data.

"AI memory in fact is any data in any format including code algorithms and hardware and any causal changes that affect them."05:16
Who should watch
  • You are building an agent that needs to remember facts across conversations and want examples using graph databases and MCP.
  • Your application retrieves plausible but irrelevant facts because vector similarity does not capture business meaning.
  • You are evaluating Cognee, Neo4j, Graphiti, Zep, or Mem0 and want to compare their memory models through a shared agent experiment.