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.

refine prompt of graph memory extract entities for search (#2013)

Xiang Wangb9e22beecb38
diff --git a/mem0/memory/graph_memory.py b/mem0/memory/graph_memory.py
index 55d644c90..7fcfdd7b0 100644
--- a/mem0/memory/graph_memory.py
+++ b/mem0/memory/graph_memory.py
@@ -175,7 +175,7 @@ class MemoryGraph:
messages=[
{
"role": "system",
- "content": f"You are a smart assistant who understands the entities, their types, and relations in a given text. If user message contains self reference such as 'I', 'me', 'my' etc. then use {filters['user_id']} as the source node. Extract the entities.",
+ "content": f"You are a smart assistant who understands the entities, their types, and relations in a given text. If user message contains self reference such as 'I', 'me', 'my' etc. then use {filters['user_id']} as the source node. Extract the entities. ***DO NOT*** answer the question itself if the given text is a question.",
},
{"role": "user", "content": query},
],