# Conversation Summary Buffer Memory

Use Flowise database table `chat_message` as the storage mechanism for storing/retrieving conversations.

This memory keeps a buffer of recent interactions and compiles old ones into a summary, using both in its storage. Instead of flushing old interactions based solely on their number, it now considers the total length of tokens to decide when to clear them out.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-54e7a64e1291fcd50fe56bc319ae54125b4ffa4b%2Fimage%20(4)%20(1)%20(2).png?alt=media" alt="" width="297"><figcaption></figcaption></figure>

## Input

| Parameter       | Description                                                                   | Default       |
| --------------- | ----------------------------------------------------------------------------- | ------------- |
| Chat Model      | LLM used to perform summarization                                             |               |
| Max Token Limit | Summarize conversations once token limit is reached                           | 2000          |
| Session Id      | An ID to retrieve/store messages. If not specified, a random ID will be used. |               |
| Memory Key      | A key used to format messages in prompt template                              | chat\_history |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowiseai.com/integrations/langchain/memory/conversation-summary-buffer-memory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
