Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

fix: fix sample code on README.md (#2312)

Mini25680b7202db6f4
diff --git a/README.md b/README.md
index 2863e0c53..4f2e1891c 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ memory = Memory()
def chat_with_memories(message: str, user_id: str = "default_user") -> str:
# Retrieve relevant memories
relevant_memories = memory.search(query=message, user_id=user_id, limit=3)
- memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories)
+ memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories["results"])
# Generate Assistant response
system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"