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
Improve Docs: Agent Id - Mem0 OSS Graph Memory (#2969)
Akshat Jainc173ec32d0d9
diff --git a/docs/open-source/graph_memory/overview.mdx b/docs/open-source/graph_memory/overview.mdxindex d1bb47128..850abe4b7 100644--- a/docs/open-source/graph_memory/overview.mdx+++ b/docs/open-source/graph_memory/overview.mdx@@ -238,7 +238,7 @@ The Mem0's graph supports the following operations:### Add Memories<Note>-Mem0 with Graph Memory supports both `user_id` and `agent_id` parameters. You can use either or both to organize your memories. Use `userId` and `agentId` in NodeSDK.+Mem0 with Graph Memory supports both "user_id" and "agent_id" parameters. You can use either or both to organize your memories. Use "userId" and "agentId" in NodeSDK.</Note><CodeGroup>@@ -552,7 +552,9 @@ memory.search("Who is spiderman?", { userId: "alice123" });## Using Multiple Agents with Graph Memory-When working with multiple agents, you can use the `agent_id` parameter to organize memories by both user and agent. This allows you to:++When working with multiple agents, you can use the "agent_id" parameter to organize memories by both user and agent. This allows you to:+1. Create agent-specific knowledge graphs2. Share common knowledge between agentsdiff --git a/mem0/memory/graph_memory.py b/mem0/memory/graph_memory.pyindex 5156668a5..95e5077bb 100644--- a/mem0/memory/graph_memory.py+++ b/mem0/memory/graph_memory.py@@ -138,6 +138,16 @@ class MemoryGraph:def get_all(self, filters, limit=100):+ """+ Retrieves all nodes and relationships from the graph database based on optional filtering criteria.+ Args:+ filters (dict): A dictionary containing filters to be applied during the retrieval.+ limit (int): The maximum number of nodes and relationships to retrieve. Defaults to 100.+ Returns:+ list: A list of dictionaries, each containing:+ - 'contexts': The base data store response for each memory.+ - 'entities': A list of strings representing the nodes and relationships+ """agent_filter = ""params = {"user_id": filters["user_id"], "limit": limit}if filters.get("agent_id"):