Update graph doc for installation (#1959)

This commit is contained in:
Dev Khant
2024-10-15 20:43:41 +05:30
committed by GitHub
parent bd5ce7c6d2
commit 2b262a65b2
2 changed files with 19 additions and 2 deletions

View File

@@ -7,6 +7,16 @@ Mem0 now supports **Graph Memory**.
With Graph Memory, users can now create and utilize complex relationships between pieces of information, allowing for more nuanced and context-aware responses.
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.
## Installation
To use Mem0 with Graph Memory support, install it using pip:
```bash
pip install mem0ai[graph]
```
This command installs Mem0 along with the necessary dependencies for graph functionality.
Try Graph Memory on Google Colab.
<a target="_blank" href="https://colab.research.google.com/drive/1PfIGVHnliIlG2v8cx0g45TF0US-jRPZ1?usp=sharing">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>

View File

@@ -1,7 +1,14 @@
import logging
try:
from langchain_community.graphs import Neo4jGraph
except ImportError:
raise ImportError("langchain_community is not installed. Please install it using pip install langchain-community")
try:
from rank_bm25 import BM25Okapi
except ImportError:
raise ImportError("rank_bm25 is not installed. Please install it using pip install rank-bm25")
from mem0.graphs.tools import (
ADD_MEMORY_STRUCT_TOOL_GRAPH,