Skip to content
Back to full roadmap
topiccore

Summary Buffer Memory

Periodically summarize old messages, keep the summary, drop the detail. Prevent context blow-up.

2 hours1 resources1 prereqs

LangChain's classic ConversationSummaryBufferMemory pattern:

  • Last N messages kept raw
  • Older than N compressed into one summary
  • The summary evolves as the conversation grows

Trade-off: detail loss vs context savings. Practical: summarize every 10 turns in active chats, summary 200-500 tokens.

LangGraph approach: MessagesState + post-processing node auto-updates summary every N steps.

Prerequisites

Resources(1)