Managing Memory in LangGraph: From RAM to Postgres to Smarter Context Windows
Towards AI
•
Generative AI
A practical look at short-term memory, persistence, and the two techniques that keep your AI agents from forgetting everything on restart. TL;DR InMemorySaver s state in RAM - gone on restart. Use PostgresSaver for persistence. Context windows can overflow as conversations grow - trimming and summarization are the two main fixes. Trimming is simpler but lossy. Summarization preserves context using a second LLM pass. The problem with InMemory Saver When you build an agent with LangGraph, the Checkpointer component is responsible for saving state between steps.