# Was getting error while importing memory using the same method displayed in docs

**URL:** <https://community.crewai.com/t/was-getting-error-while-importing-memory-using-the-same-method-displayed-in-docs/7344>\
**Category:** CrewAI Community Support\
**Tags:** memory\
**Created:** [February 18, 2026, 1:14pm UTC](https://community.crewai.com/t/was-getting-error-while-importing-memory-using-the-same-method-displayed-in-docs/7344 "2026-02-18T13:14:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yug\_Jain](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yug_jain/32/4855_2.png) [@Yug\_Jain](https://community.crewai.com/u/Yug_Jain)\
**Post date:** [February 18, 2026, 1:14pm UTC](https://community.crewai.com/t/was-getting-error-while-importing-memory-using-the-same-method-displayed-in-docs/7344/1 "2026-02-18T13:14:12Z")

</div>

I was trying to import memory using the method displayed in docs  
`from crewai import Memory`

I got this error

`Traceback (most recent call last):File “C:\Users\yugni\Desktop\Stratzi Chatbot\Crewai_implementation\flow_with_memory.py”, line 10, in from crewai import MemoryImportError: cannot import name ‘Memory’ from ‘crewai’ (C:\Users\yugni\Desktop\Stratzi Chatbot\chatbot\Lib\site-packages\crewai_init_.py). Did you mean: ‘memory’?`

I tried importing using  
`from crewai import memory`  
But I was unable to create an object using it

Then I checked the class inside my vs code and found a complete different implementation with distinct types of memories instead of an unified memory

```auto
from crewai.memory.entity.entity_memory import EntityMemory
from crewai.memory.external.external_memory import ExternalMemory
from crewai.memory.long_term.long_term_memory import LongTermMemory
from crewai.memory.short_term.short_term_memory import ShortTermMemory

__all__ = [
    "EntityMemory",
    "ExternalMemory",
    "LongTermMemory",
    "ShortTermMemory",
]

```

And there was a complete different import statement/ implementation in the current repo

```auto
"""Memory module: unified Memory with LLM analysis and pluggable storage."""

from crewai.memory.encoding_flow import EncodingFlow
from crewai.memory.memory_scope import MemoryScope, MemorySlice
from crewai.memory.types import (
    MemoryMatch,
    MemoryRecord,
    ScopeInfo,
    compute_composite_score,
    embed_text,
    embed_texts,
)
from crewai.memory.unified_memory import Memory

__all__ = [
    "EncodingFlow",
    "Memory",
    "MemoryMatch",
    "MemoryRecord",
    "MemoryScope",
    "MemorySlice",
    "ScopeInfo",
    "compute_composite_score",
    "embed_text",
    "embed_texts",
]

```

I also updated the crewai version, but am still getting the same issues

---

<div class="post-metadata">

**Author:** ![Yug\_Jain](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yug_jain/32/4855_2.png) [@Yug\_Jain](https://community.crewai.com/u/Yug_Jain)\
**Post date:** [February 18, 2026, 2:29pm UTC](https://community.crewai.com/t/was-getting-error-while-importing-memory-using-the-same-method-displayed-in-docs/7344/2 "2026-02-18T14:29:09Z")

</div>

I got the solution

We need to import like this:  
`from crewai.memory.memory import Memory`

---

<div class="post-metadata">

**Author:** ![victoria](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/victoria/32/4899_2.png) [@victoria](https://community.crewai.com/u/victoria)\
**Post date:** [February 23, 2026, 9:31pm UTC](https://community.crewai.com/t/was-getting-error-while-importing-memory-using-the-same-method-displayed-in-docs/7344/3 "2026-02-23T21:31:09Z")

</div>

But why? I’m having the exact same issue. Everything about memory is different than the documentation. even the boilerplate code is different than the code in the getting started. print(memory.tree()) doesn’t work because tree doesn’t exist. Even trying to create a memory object fails, its asking for a storage argument. It’s like the whole memory system is different even though we have the same version.

This: [New Unified Memory System by joaomdmoura · Pull Request #4420 · crewAIInc/crewAI · GitHub](https://github.com/crewAIInc/crewAI/pull/4420) seems relevant, but its in 1.10.0a1 pre release. its almost like the documentation got updated before the tool?

Python 3.12.3 (main, Jan 22 2026, 20:57:42) [GCC 13.3.0] on linux  
Type “help”, “copyright”, “credits” or “license” for more information.

> > > from crewai import Memory  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > ImportError: cannot import name ‘Memory’ from ‘crewai’ (/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/crewai/ **init**.py). Did you mean: ‘memory’?

Traceback (most recent call last):  
File “/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/crewai/telemetry/telemetry.py”, line 210, in handler  
original\_handler(signum, frame)  
KeyboardInterrupt

> > > from crewai.memory.memory import Memory  
> > > memory = Memory()  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > TypeError: Memory. **init** () missing 1 required positional argument: ‘storage’  
> > > memory = Memory(recency\_weight=0.5, recency\_half\_life\_days=7)  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > TypeError: Memory. **init** () missing 1 required positional argument: ‘storage’  
> > > memory = Memory(embedder={“provider”: “openai”, “config”: {“model\_name”: “text-embedding-3-small”}})  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > TypeError: Memory. **init** () missing 1 required positional argument: ‘storage’  
> > > memory = Memory(‘test.db’)  
> > > print(memory.tree())  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > File “/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/pydantic/main.py”, line 991, in **getattr**  
> > > raise AttributeError(f’{type(self). **name**!r} object has no attribute {item!r}‘)  
> > > AttributeError: ‘Memory’ object has no attribute ‘tree’  
> > > print(memory.tree())  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > File “/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/pydantic/main.py”, line 991, in **getattr**  
> > > raise AttributeError(f’{type(self). **name**!r} object has no attribute {item!r}‘)  
> > > AttributeError: ‘Memory’ object has no attribute ‘tree’  
> > > print(memory.info(“/”))  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > File “/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/pydantic/main.py”, line 991, in **getattr**  
> > > raise AttributeError(f’{type(self). **name**!r} object has no attribute {item!r}‘)  
> > > AttributeError: ‘Memory’ object has no attribute ‘info’  
> > > memory.remember(“The API rate limit is 1000 requests per minute.”)  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > File “/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/pydantic/main.py”, line 991, in **getattr**  
> > > raise AttributeError(f’{type(self). **name**!r} object has no attribute {item!r}‘)  
> > > AttributeError: ‘Memory’ object has no attribute ‘remember’  
> > > memory.remember(“Our staging environment uses port 8080.”)  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in  
> > > File “/home/victoria/projects/crewtest/latest\_ai\_development/.venv/lib/python3.12/site-packages/pydantic/main.py”, line 991, in **getattr**  
> > > raise AttributeError(f’{type(self). **name**!r} object has no attribute {item!r}')  
> > > AttributeError: ‘Memory’ object has no attribute ‘remember’
> > > 
> > > from crewai import memory  
> > > memory.  
> > > memory.EntityMemory( memory.ShortTermMemory( memory.external memory.short\_term  
> > > memory.ExternalMemory( memory.contextual memory.long\_term memory.storage  
> > > memory.LongTermMemory( memory.entity memory.memory

---

<div class="post-metadata">

**Author:** ![Yug\_Jain](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yug_jain/32/4855_2.png) [@Yug\_Jain](https://community.crewai.com/u/Yug_Jain)\
**Post date:** [February 24, 2026, 1:48am UTC](https://community.crewai.com/t/was-getting-error-while-importing-memory-using-the-same-method-displayed-in-docs/7344/4 "2026-02-24T01:48:27Z")

</div>

Yes we do need to pass a storage parameter, I passed lancedb, which is by default used by CrewAI as far as I know

Also if you aren’t using OpenAI you need to pass the provider information too

See this:

```auto
custom_memory = Memory(

  storage= "lancedb",

  embedder={"provider": "google-generativeai", "config": {"model_name": "gemini-embedding-001"}},

)

```

Though you can successfully create the object, but still the methods like save, search (which I found by checking the Memory class inside my IDE) don’t work. They throw weird errors. Also they are different from the remember and recall methods in their docs

See I tried this:  
`print(type(custom_memory))`  
`custom_memory.save(placeAndDays)`

Output was this:  
**Output:**  
`<class 'crewai.memory.memory.Memory'>`

`AttributeError: 'str' object has no attribute 'save'`

So even though the type of object is Memory class, still it throws this weird error

If you find any solution for this, please let everyone know
