The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
Docs update (#1875)
Prateek Chhikara8c3c9e1520c1
diff --git a/docs/open-source/graph_memory/overview.mdx b/docs/open-source/graph_memory/overview.mdxindex 75bf94bf4..a65938610 100644--- a/docs/open-source/graph_memory/overview.mdx+++ b/docs/open-source/graph_memory/overview.mdx@@ -3,11 +3,11 @@ title: Overviewdescription: 'Enhance your memory system with graph-based knowledge representation and retrieval'----Mem0 now supports **Graph Memory**.+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.-Try Graph Memory on Google Colab.+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"/></a>@@ -27,7 +27,10 @@ allowfullscreenTo initialize Graph Memory you'll need to set up your configuration with graph store providers.Currently, we support Neo4j as a graph store provider. You can setup [Neo4j](https://neo4j.com/) locally or use the hosted [Neo4j AuraDB](https://neo4j.com/product/auradb/).-Moreover, you also need to set the version to `v1.1` (*prior versions are not supported*).+Moreover, you also need to set the version to `v1.1` (*prior versions are not supported*).++<Note>If you are using Neo4j locally, then you need to install [APOC plugins](https://neo4j.com/labs/apoc/4.1/installation/).</Note>+User can also customize the LLM for Graph Memory from the [Supported LLM list](https://docs.mem0.ai/components/llms/overview) with three levels of configuration:diff --git a/mem0/configs/vector_stores/chroma.py b/mem0/configs/vector_stores/chroma.pyindex 1b0ef4e39..afff8a8f7 100644--- a/mem0/configs/vector_stores/chroma.py+++ b/mem0/configs/vector_stores/chroma.py@@ -9,7 +9,7 @@ class ChromaDbConfig(BaseModel):try:from chromadb.api.client import Clientexcept ImportError:- raise ImportError("The 'chromadb' library is required. Please install it using 'pip install chromadb'.")+ raise ImportError("The 'chromadb' library is required. Please install it using 'pip install chromadb'.")Client: ClassVar[type] = Clientcollection_name: str = Field("mem0", description="Default name for the collection")diff --git a/mem0/memory/graph_memory.py b/mem0/memory/graph_memory.pyindex 13020f076..c14db70b0 100644--- a/mem0/memory/graph_memory.py+++ b/mem0/memory/graph_memory.py@@ -3,14 +3,19 @@ import loggingfrom langchain_community.graphs import Neo4jGraphfrom rank_bm25 import BM25Okapi-from mem0.graphs.tools import (ADD_MEMORY_STRUCT_TOOL_GRAPH,- ADD_MEMORY_TOOL_GRAPH, ADD_MESSAGE_STRUCT_TOOL,- ADD_MESSAGE_TOOL, NOOP_STRUCT_TOOL, NOOP_TOOL,- SEARCH_STRUCT_TOOL, SEARCH_TOOL,- UPDATE_MEMORY_STRUCT_TOOL_GRAPH,- UPDATE_MEMORY_TOOL_GRAPH)-from mem0.graphs.utils import (EXTRACT_ENTITIES_PROMPT,- get_update_memory_messages)+from mem0.graphs.tools import (+ ADD_MEMORY_STRUCT_TOOL_GRAPH,+ ADD_MEMORY_TOOL_GRAPH,+ ADD_MESSAGE_STRUCT_TOOL,+ ADD_MESSAGE_TOOL,+ NOOP_STRUCT_TOOL,+ NOOP_TOOL,+ SEARCH_STRUCT_TOOL,+ SEARCH_TOOL,+ UPDATE_MEMORY_STRUCT_TOOL_GRAPH,+ UPDATE_MEMORY_TOOL_GRAPH,+)+from mem0.graphs.utils import EXTRACT_ENTITIES_PROMPT, get_update_memory_messagesfrom mem0.utils.factory import EmbedderFactory, LlmFactorylogger = logging.getLogger(__name__)diff --git a/mem0/memory/telemetry.py b/mem0/memory/telemetry.pyindex 5cab2b1f2..6865b2fee 100644--- a/mem0/memory/telemetry.py+++ b/mem0/memory/telemetry.py@@ -63,7 +63,9 @@ def capture_event(event_name, memory_instance, additional_data=None):"collection": memory_instance.collection_name,"vector_size": memory_instance.embedding_model.config.embedding_dims,"history_store": "sqlite",- "graph_store": f"{memory_instance.graph.__class__.__module__}.{memory_instance.graph.__class__.__name__}" if memory_instance.config.graph_store.config else None,+ "graph_store": f"{memory_instance.graph.__class__.__module__}.{memory_instance.graph.__class__.__name__}"+ if memory_instance.config.graph_store.config+ else None,"vector_store": f"{memory_instance.vector_store.__class__.__module__}.{memory_instance.vector_store.__class__.__name__}","llm": f"{memory_instance.llm.__class__.__module__}.{memory_instance.llm.__class__.__name__}","embedding_model": f"{memory_instance.embedding_model.__class__.__module__}.{memory_instance.embedding_model.__class__.__name__}",diff --git a/mem0/vector_stores/qdrant.py b/mem0/vector_stores/qdrant.pyindex 0afcb6c41..708bf4fb4 100644--- a/mem0/vector_stores/qdrant.py+++ b/mem0/vector_stores/qdrant.py@@ -3,9 +3,16 @@ import osimport shutilfrom qdrant_client import QdrantClient-from qdrant_client.models import (Distance, FieldCondition, Filter, MatchValue,- PointIdsList, PointStruct, Range,- VectorParams)+from qdrant_client.models import (+ Distance,+ FieldCondition,+ Filter,+ MatchValue,+ PointIdsList,+ PointStruct,+ Range,+ VectorParams,+)from mem0.vector_stores.base import VectorStoreBase