Skip to content

Commit c173ec3

Browse files
authored
Improve Docs: Agent Id - Mem0 OSS Graph Memory (mem0ai#2969)
1 parent dd6f6f7 commit c173ec3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

docs/open-source/graph_memory/overview.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ The Mem0's graph supports the following operations:
238238
### Add Memories
239239

240240
<Note>
241-
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.
241+
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.
242242
</Note>
243243

244244
<CodeGroup>
@@ -552,7 +552,9 @@ memory.search("Who is spiderman?", { userId: "alice123" });
552552
553553
## Using Multiple Agents with Graph Memory
554554

555-
When working with multiple agents, you can use the `agent_id` parameter to organize memories by both user and agent. This allows you to:
555+
556+
When working with multiple agents, you can use the "agent_id" parameter to organize memories by both user and agent. This allows you to:
557+
556558

557559
1. Create agent-specific knowledge graphs
558560
2. Share common knowledge between agents

mem0/memory/graph_memory.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ def delete_all(self, filters):
138138

139139

140140
def get_all(self, filters, limit=100):
141+
"""
142+
Retrieves all nodes and relationships from the graph database based on optional filtering criteria.
143+
Args:
144+
filters (dict): A dictionary containing filters to be applied during the retrieval.
145+
limit (int): The maximum number of nodes and relationships to retrieve. Defaults to 100.
146+
Returns:
147+
list: A list of dictionaries, each containing:
148+
- 'contexts': The base data store response for each memory.
149+
- 'entities': A list of strings representing the nodes and relationships
150+
"""
141151
agent_filter = ""
142152
params = {"user_id": filters["user_id"], "limit": limit}
143153
if filters.get("agent_id"):

0 commit comments

Comments
 (0)