# ConversationBufferWindowMemory

> **Class** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/memory/buffer_window/ConversationBufferWindowMemory)

Use to keep track of the last k turns of a conversation.

If the number of messages in the conversation is more than the maximum number
of messages to keep, the oldest messages are dropped.

## Signature

```python
ConversationBufferWindowMemory()
```

## Extends

- `BaseChatMemory`

## Properties

- `human_prefix`
- `ai_prefix`
- `memory_key`
- `k`
- `buffer`
- `buffer_as_str`
- `buffer_as_messages`
- `memory_variables`

## Methods

- [`load_memory_variables()`](https://reference.langchain.com/python/langchain-classic/memory/buffer_window/ConversationBufferWindowMemory/load_memory_variables)

## ⚠️ Deprecated

Deprecated since version 0.3.1.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/f0c5a28fa05adcda89aebcb449d897245ab21fa4/libs/langchain/langchain_classic/memory/buffer_window.py#L10)