In this lecture, we explore how to build robust Agentic AI systems by solving the problem of memory within LangGraph. Because Large Language Models (LLMs) are inherently memoryless, creating a truly "intelligent agent" requires a specific architecture to retain information across multiple turns.
What You Will Learn:
The Agentic Memory Gap: Why LLMs treat every prompt as a brand-new event and how this affects agent behavior.
The Context Window Trick: A deep dive into the mechanical process of feeding history back into the model to simulate memory.
Persistence in LangGraph: How Checkpointers and Thread IDs allow your Agentic AI to recognize specific users and sessions.
Short-Term Memory in RAM: Utilizing the InmemorySaver class to manage agent states during a live session.
Technical Constraints: Understanding context window limits (from Llama 3.1 to Gemini) and how they impact the "brain capacity" of your AI agent.
Timestamps
00:00 – Introduction and series overview
00:33 – Recap: Why LLMs and LangGraph (without persistence) are memoryless
01:07 – Distinguishing between Short-term memory (conversation) and Long-term memory (user identity)
02:02 – The Context Window Trick: Simulating memory by changing context
03:44 – Code Walkthrough: Manually appending messages to a list to provide context
06:51 – How LangGraph automates this "trick" using persistence
09:04 – Implementing Short-term memory with Checkpointers, Thread IDs, and State
10:14 – Using the InmemorySaver class to manage memory in RAM
12:35 – Deep dive into Checkpointers: Snapshots of state at every step
14:12 – Responsibilities of InmemorySaver: Put, Get, Delete, and Update functions
16:21 – Context Window Limits: Comparing Llama 3.1 (8K/128K), Gemini (1M), and GPT-4 (128K)
17:42 – Summary and preview of the next session: The problems with RAM persistence