fix(mem0-plugin): store assistant-authored summaries with role="assistant" (#6316)

This commit is contained in:
Kartik
2026-07-14 20:03:36 +05:30
committed by GitHub
parent 6c1741e3a4
commit d6d2588ef5
14 changed files with 197 additions and 19 deletions
@@ -175,8 +175,12 @@ def store_summary(
if files:
metadata["files_touched"] = files[:20]
# summary_prompt wraps the assistant's own last message. Mem0 extracts "facts
# about the user" from each message and role is the only signal telling it who
# spoke, so role="user" here turns Claude's opinions into the human's stated
# preferences ("User prefers dropping Redis...").
body = {
"messages": [{"role": "user", "content": summary_prompt}],
"messages": [{"role": "assistant", "content": summary_prompt}],
"user_id": user_id,
"app_id": project_id,
"run_id": session_id,