LangChain Memory

LangChain Memory is a standard interface for persisting state between calls of a chain or agent, enabling large language models to have memory and context. By default, LLMs are stateless, meaning each incoming query is processed independently of other interactions, but LangChain memory solves this limitation by maintaining conversation history. It enables coherent conversations, and without it, every query would be treated as an entirely independent input without considering past interactions. Up to version 0.3 the framework shipped a family of memory classes: ConversationBufferMemory for storing complete message histories, ConversationBufferWindowMemory for keeping only the last K interactions in a sliding window, ConversationSummaryMemory for summarizing conversations to reduce token usage, and ConversationSummaryBufferMemory, which combined both approaches and used token length rather than interaction count to decide when to flush old interactions. Those classes were deprecated in 0.3 and removed from the main package in LangChain 1.0 (October 2025); they now live in langchain-classic. In current versions, state between turns is persisted by a LangGraph checkpointer, which keeps the message history per conversation thread, while a LangGraph store holds long-term memory across sessions. Keeping the context small is a separate step: the message list is trimmed or summarized before it is sent to the model.

Work with us

Ready to put agentic AI to work?

Book a free 45-minute consultation. We'll map one real process worth automating with production-grade AI.