From 470cef6ba6ae94190ab36f87b1883e023a7b1050 Mon Sep 17 00:00:00 2001 From: kartik-mem0 Date: Thu, 21 May 2026 18:14:19 +0530 Subject: [PATCH] fix(mem0-plugin): upgrade REST endpoints to v3, fix dream scheduling docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - All add_memory REST calls now use /v3/memories/add/ (was /v1/memories/) - Session start search uses /v3/memories/search/ (was /v2/memories/search/) - Dream skill: removed reference to nonexistent /schedule skill (Claude Code has no native scheduling — recommend external cron instead) --- mem0-plugin/scripts/auto_import.py | 2 +- .../scripts/capture_compact_summary.py | 2 +- mem0-plugin/scripts/import_competing_tools.py | 2 +- mem0-plugin/scripts/on_pre_compact.py | 2 +- mem0-plugin/skills/mem0-dream/SKILL.md | 30 ++++++------------- 5 files changed, 13 insertions(+), 25 deletions(-) diff --git a/mem0-plugin/scripts/auto_import.py b/mem0-plugin/scripts/auto_import.py index ae74ca1bb..d96e50698 100644 --- a/mem0-plugin/scripts/auto_import.py +++ b/mem0-plugin/scripts/auto_import.py @@ -101,7 +101,7 @@ def post_memory(api_key: str, content: str, user_id: str, filename: str, project data = json.dumps(body).encode("utf-8") req = urllib.request.Request( - f"{API_URL}/v1/memories/", + f"{API_URL}/v3/memories/add/", data=data, headers={ "Content-Type": "application/json", diff --git a/mem0-plugin/scripts/capture_compact_summary.py b/mem0-plugin/scripts/capture_compact_summary.py index f9218eec9..1f9fdcb66 100644 --- a/mem0-plugin/scripts/capture_compact_summary.py +++ b/mem0-plugin/scripts/capture_compact_summary.py @@ -115,7 +115,7 @@ def store_summary(api_key: str, summary: str, user_id: str, session_id: str, pro data = json.dumps(body).encode("utf-8") req = urllib.request.Request( - f"{API_URL}/v1/memories/", + f"{API_URL}/v3/memories/add/", data=data, headers={ "Content-Type": "application/json", diff --git a/mem0-plugin/scripts/import_competing_tools.py b/mem0-plugin/scripts/import_competing_tools.py index 89bdce4ae..2c8f54673 100644 --- a/mem0-plugin/scripts/import_competing_tools.py +++ b/mem0-plugin/scripts/import_competing_tools.py @@ -129,7 +129,7 @@ def post_memory(api_key: str, content: str, user_id: str, project_id: str, branc } data = json.dumps(body).encode("utf-8") req = urllib.request.Request( - f"{API_URL}/v1/memories/", + f"{API_URL}/v3/memories/add/", data=data, headers={ "Content-Type": "application/json", diff --git a/mem0-plugin/scripts/on_pre_compact.py b/mem0-plugin/scripts/on_pre_compact.py index 3160ef3ed..85f50bb55 100755 --- a/mem0-plugin/scripts/on_pre_compact.py +++ b/mem0-plugin/scripts/on_pre_compact.py @@ -190,7 +190,7 @@ def store_memory(api_key: str, content: str, user_id: str, source: str, session_ data = json.dumps(body).encode("utf-8") req = urllib.request.Request( - f"{API_URL}/v1/memories/", + f"{API_URL}/v3/memories/add/", data=data, headers={ "Content-Type": "application/json", diff --git a/mem0-plugin/skills/mem0-dream/SKILL.md b/mem0-plugin/skills/mem0-dream/SKILL.md index 5238af6eb..24f4e1a7e 100644 --- a/mem0-plugin/skills/mem0-dream/SKILL.md +++ b/mem0-plugin/skills/mem0-dream/SKILL.md @@ -207,34 +207,18 @@ Dream complete. --- -## Scheduling (Claude Code only) +## Auto mode -### Running dream on a schedule - -**Note**: Scheduled dream is only available in Claude Code, which natively supports -the `schedule` skill. Codex and Cursor do not have a scheduling primitive — users -on those platforms should run `/mem0:dream` manually. - -When the user runs `/mem0:dream --schedule weekly` (or similar), register a -recurring scheduled task using the Claude Code `schedule` skill. - -Use `--auto` flag to enable non-interactive mode, which skips the interactive -contradiction resolution UI and applies only safe operations automatically: +When invoked with `--auto` (e.g., `/mem0:dream --auto`), run non-interactively: - **Merges**: applied automatically (no contradiction, both are compatible). - **Prunes**: applied automatically (age/confidence-based, no ambiguity). -- **Contradictions**: skipped in `--auto` mode; they require human judgment. +- **Contradictions**: skipped — they require human judgment. -Example scheduling invocation: - -``` -/schedule weekly mem0:dream --auto -``` - -When running with `--auto`: +In auto mode: 1. Load policies and fetch memories (Steps 1–3) as normal. 2. Apply merges and prunes silently without printing the diff or prompting. -3. Log a compact summary to stdout (suitable for a cron log): +3. Print a compact summary: ``` [mem0-dream --auto] project= merged= pruned= conflicts_skipped= ``` @@ -248,3 +232,7 @@ When running with `--auto`: infer=False, ) ``` + +**Note**: Claude Code does not have native cron/scheduling. To run dream periodically, +use an external scheduler (cron, launchd) calling `claude -p "/mem0:dream --auto"`, +or run it manually at the start of each week.