# Long Term Memory

**URL:** <https://community.crewai.com/t/long-term-memory/126>\
**Category:** CrewAI Community Support\
**Tags:** crewai\
**Created:** [September 9, 2024, 8:20am UTC](https://community.crewai.com/t/long-term-memory/126 "2024-09-09T08:20:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![developerbob](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@developerbob](https://community.crewai.com/u/developerbob)\
**Post date:** [September 9, 2024, 8:20am UTC](https://community.crewai.com/t/long-term-memory/126/1 "2024-09-09T08:20:10Z")

</div>

Hi,

I’m trying to equip my Crew with Long Term memory with the goal of improving results. It’s a crew that finds leads by browsing online and I want to make sure the lead quality is high.

The docs on [crewAI Memory Systems - crewAI](https://docs.crewai.com/core-concepts/Memory/) only describe a general switch to turn on memory (`memory=True`), but not how to differentiate between short and long term memory. Also, I don’t see any resources on inspecting the data storage of the stored memory.

Are there any resources for this that dive deeper?

---

<div class="post-metadata">

**Author:** ![ScarletAI](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/scarletai/32/47_2.png) [@ScarletAI](https://community.crewai.com/u/ScarletAI)\
**Post date:** [September 9, 2024, 11:36pm UTC](https://community.crewai.com/t/long-term-memory/126/2 "2024-09-09T23:36:58Z")

</div>

Hey there!

That’s a great question! You’re right that in CrewAI, turning on memory with `memory=True` enables an agent to remember things within a session. But when it comes to differentiating between short-term and long-term memory, or checking the memory data, there are a few extra steps involved that aren’t directly mentioned in the basic docs.

In terms of long term memory you can actually load a doc to your agent before it begins a task, then it can use the information in that document to stick to a predefined outcome.

I use this method for memory in text format.

 ![Screenshot 2024-09-09 203535](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/9e3d1e82a6a2734bfd36d22c88f5928765389857.png)

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [September 10, 2024, 1:31am UTC](https://community.crewai.com/t/long-term-memory/126/3 "2024-09-10T01:31:41Z")

</div>

Memory=True enables a lot of things. Short term, long term, contextual, and entity memory. All in the docs. If you’d like to retain long term memory, but delete short term, etc, you can reset memories individually. The docs tell you how to do it at the cli level. You can do it also by looking at the code and going to the individual methods that reset specific memories( maybe not sanctioned).

---

<div class="post-metadata">

**Author:** ![developerbob](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@developerbob](https://community.crewai.com/u/developerbob)\
**Post date:** [September 10, 2024, 7:19am UTC](https://community.crewai.com/t/long-term-memory/126/4 "2024-09-10T07:19:31Z")

</div>

Thank you, @ScarletAI That is super helpful. I’ll give it a try. Seems straightforward to just read from a file, as it’s not more complex as adding a long Backstory perhaps. I wonder if I should be using other techniques as well to get more specific outcomes.

---

<div class="post-metadata">

**Author:** ![developerbob](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@developerbob](https://community.crewai.com/u/developerbob)\
**Post date:** [September 10, 2024, 7:20am UTC](https://community.crewai.com/t/long-term-memory/126/5 "2024-09-10T07:20:37Z")

</div>

Thanks @moto Sounds like looking at the source code is the way to go here. I was hoping for some docs that lay out how to interact with the memory, i.e. read write to it.

---

<div class="post-metadata">

**Author:** ![matt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/matt/32/3_2.png) [@matt](https://community.crewai.com/u/matt)\
**Post date:** [September 10, 2024, 7:23am UTC](https://community.crewai.com/t/long-term-memory/126/6 "2024-09-10T07:23:02Z")

</div>

#crewAI Wiki has a memory page you should check out.

Let me know if there is still something missing

---

<div class="post-metadata">

**Author:** ![ScarletAI](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/scarletai/32/47_2.png) [@ScarletAI](https://community.crewai.com/u/ScarletAI)\
**Post date:** [September 10, 2024, 9:38am UTC](https://community.crewai.com/t/long-term-memory/126/7 "2024-09-10T09:38:10Z")

</div>

Hey Bob, I’m glad you found it helpful.

feel free to reach out personally to have a chat if you would like. I am always open for talking about crews.

But I would also recommend building projects using Crew GPT as you can have conversations with the documentation. That has been my main form of troubleshooting in real time while I am building.

---

<div class="post-metadata">

**Author:** ![developerbob](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@developerbob](https://community.crewai.com/u/developerbob)\
**Post date:** [September 10, 2024, 12:48pm UTC](https://community.crewai.com/t/long-term-memory/126/8 "2024-09-10T12:48:22Z")

</div>

Hi Raphael,

I appreciate that. I’ll DM you and will also check out the Crew GPT feature.
