# How to Add Conversational Memory to Open Source LLMs?

**URL:** <https://discuss.huggingface.co/t/how-to-add-conversational-memory-to-open-source-llms/70516>\
**Category:** Beginners\
**Created:** [January 25, 2024, 3:55am UTC](https://discuss.huggingface.co/t/how-to-add-conversational-memory-to-open-source-llms/70516 "2024-01-25T03:55:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flops2081](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@flops2081](https://discuss.huggingface.co/u/flops2081)\
**Post date:** [January 25, 2024, 3:55am UTC](https://discuss.huggingface.co/t/how-to-add-conversational-memory-to-open-source-llms/70516/1 "2024-01-25T03:55:42Z")

</div>

I’m working with open-source Large Language Models and need advice on adding conversational memory to them. I want the model to remember past conversations better.

I followed this document but it only works for OpenAI models.

> **[Conversation Buffer | 🦜️🔗 Langchain](https://python.langchain.com/docs/modules/memory/types/buffer)**
>
> This notebook shows how to use ConversationBufferMemory. This memory allows for storing messages and then extracts the messages in a variable.
