mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Wrong Memgraph import in mem0/memory/memgraph_memory.py

Open Paddy420 opened this issue 7 months ago • 3 comments

🐛 Describe the bug

When trying to setup mem0 with Memgraph i stumbled upon this issue:

langchain_memgraph is not installed. Please install it using pip install langchain-memgraph 

I tracked this down to mem0/memory/memgraph_memory.py


try:
    from langchain_memgraph import Memgraph
except ImportError:
    raise ImportError(
        "langchain_memgraph is not installed. Please install it using pip install langchain-memgraph"
    )

The import is wrong according to the docs https://python.langchain.com/docs/integrations/graphs/memgraph/

correct would be

from langchain_memgraph.graphs.memgraph import Memgraph

Also I noticed in 7117a94fbf5013f0414c550f64df436afcc6479d there was the dependency for langchain_memgraph removed.

Paddy420 avatar May 18 '25 21:05 Paddy420

temporary fix: use 0.1.1 version

MisileLab avatar May 19 '25 16:05 MisileLab

temporary fix: use 0.1.1 version

This leads to dependency conflicts with other packages

aryanranderiya avatar May 27 '25 04:05 aryanranderiya

any update on this?

pavanjava avatar May 27 '25 16:05 pavanjava

Got this issue as well.

ImportError: cannot import name 'Memgraph' from 'langchain_memgraph' (crewai_play/venv/lib/python3.11/site-packages/langchain_memgraph/__init__.py)

anton-b avatar Jul 04 '25 12:07 anton-b

Closing as it's fixed.

parshvadaftari avatar Aug 16 '25 21:08 parshvadaftari