Skip to content

Commit 2b262a6

Browse files
authored
Update graph doc for installation (mem0ai#1959)
1 parent bd5ce7c commit 2b262a6

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

docs/open-source/graph_memory/overview.mdx

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ Mem0 now supports **Graph Memory**.
77
With Graph Memory, users can now create and utilize complex relationships between pieces of information, allowing for more nuanced and context-aware responses.
88
This integration enables users to leverage the strengths of both vector-based and graph-based approaches, resulting in more accurate and comprehensive information retrieval and generation.
99

10+
## Installation
11+
12+
To use Mem0 with Graph Memory support, install it using pip:
13+
14+
```bash
15+
pip install mem0ai[graph]
16+
```
17+
18+
This command installs Mem0 along with the necessary dependencies for graph functionality.
19+
1020
Try Graph Memory on Google Colab.
1121
<a target="_blank" href="https://colab.research.google.com/drive/1PfIGVHnliIlG2v8cx0g45TF0US-jRPZ1?usp=sharing">
1222
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>

mem0/memory/graph_memory.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import logging
22

3-
from langchain_community.graphs import Neo4jGraph
4-
from rank_bm25 import BM25Okapi
3+
try:
4+
from langchain_community.graphs import Neo4jGraph
5+
except ImportError:
6+
raise ImportError("langchain_community is not installed. Please install it using pip install langchain-community")
7+
8+
try:
9+
from rank_bm25 import BM25Okapi
10+
except ImportError:
11+
raise ImportError("rank_bm25 is not installed. Please install it using pip install rank-bm25")
512

613
from mem0.graphs.tools import (
714
ADD_MEMORY_STRUCT_TOOL_GRAPH,

0 commit comments

Comments
 (0)