---
hide_table_of_contents: true
sidebar_label: Conversation summary buffer memory
---

# ConversationSummaryBufferMemory

`ConversationSummaryBufferMemory` combines the ideas behind [BufferMemory](/docs/modules/memory/how_to/buffer) and [ConversationSummaryMemory](/docs/modules/memory/how_to/summary).
It keeps a buffer of recent interactions in memory, but rather than just completely flushing old interactions it compiles them into a summary and uses both. Unlike the previous implementation though, it uses token length rather than number of interactions to determine when to flush interactions.

Let's first walk through how to use it:

import CodeBlock from "@theme/CodeBlock";
import TextExample from "@examples/memory/summary_buffer.ts";

<CodeBlock language="typescript">{TextExample}</CodeBlock>
