docs(changelog): consolidate per-package changelogs into the SDK changelog page (#6007)

This commit is contained in:
Kartik
2026-06-30 14:09:41 +05:30
committed by GitHub
parent 2add7fd57d
commit c325bd3b8e
10 changed files with 755 additions and 1055 deletions
-60
View File
@@ -1,60 +0,0 @@
# Changelog
All notable changes to `@mem0/cli` are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.2.9] — 2026-06-19
### Security
- Telemetry no longer passes the Mem0 API key to its child process via
command-line arguments. The context is now sent over stdin, so the key is no
longer visible in the process list (`ps`, `/proc/<pid>/cmdline`, Activity
Monitor). Fixes #4862.
## [0.2.8] — 2026-06-01
### Security
- Pinned transitive dependencies via pnpm overrides to remediate high-severity CVEs:
- `jws` → 4.0.1 (CVE-2025-65945)
- `langsmith` → ^0.6.0 (CVE-2026-45134)
- `tar-fs` → ^2.1.4 (CVE-2025-48387, CVE-2025-59343)
- `picomatch` → ^2.3.2 (CVE-2026-33671)
- `minimatch` → ^3.1.3 / ^5.1.8 / ^9.0.7 (CVE-2026-27903, CVE-2026-27904, CVE-2026-26996)
- `path-to-regexp` → ^8.4.0 (CVE-2026-4926)
- `rollup` → ^4.59.0 (CVE-2026-27606)
- `glob` → ^10.5.0 (CVE-2025-64756)
- `@modelcontextprotocol/sdk` → ^1.25.4 (CVE-2025-66414, CVE-2026-0621)
## [0.2.7] — 2026-05-20
### Added
- `mem0 whoami` — print the active agent's `default_user_id` (the AGENTRUSH
leaderboard identifier). Reads from local config, no network call.
- `mem0 agent-rush <add | search>` — subcommand group that wraps the new
`/v1/agent-rush/` platform endpoints for the 7-day AGENTRUSH game. Project
routing is implicit (resolved server-side); no flags exposed. Pretty-prints
platform error codes into actionable hints (e.g. `agentrush_search_first`
→ "Run 3 'mem0 agent-rush search' commands before adding.").
- PII safety prompt on first `mem0 agent-rush add`. Interactive runs require
explicit `y` to acknowledge that AGENTRUSH memories are public; the
acknowledgement is persisted in `~/.mem0/config.json` under
`agent_rush.acknowledged_at` so the prompt only appears once per machine.
Non-interactive (agent) invocations surface the warning to stderr without
blocking.
- New config schema field: `agent_rush.acknowledged_at` (ISO timestamp,
empty until first interactive acknowledgement).
### Changed
- HTTP requests from the new agent-rush commands send `X-Mem0-Mode: agent-rush`
in addition to the existing source headers, so platform telemetry can split
game traffic from regular CLI usage.
## [0.2.6] and earlier
Unlogged historical releases. See git history under `cli/node/`.
-49
View File
@@ -1,49 +0,0 @@
# Changelog
All notable changes to `mem0-cli` (Python) are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.2.8] — 2026-06-19
### Security
- Telemetry no longer passes the Mem0 API key to its child process via
command-line arguments. The context is now sent over stdin, so the key is no
longer visible in the process list (`ps`, `/proc/<pid>/cmdline`, Activity
Monitor). Fixes #4862.
### Fixed
- `__version__` now matches the packaged version (was stale at 0.2.4).
## [0.2.7] — 2026-05-20
### Added
- `mem0 whoami` — print the active agent's `default_user_id` (the AGENTRUSH
leaderboard identifier). Reads from local config, no network call.
- `mem0 agent-rush <add | search>` — subcommand group that wraps the new
`/v1/agent-rush/` platform endpoints for the 7-day AGENTRUSH game. Project
routing is implicit (resolved server-side); no flags exposed. Pretty-prints
platform error codes into actionable hints (e.g. `agentrush_search_first`
→ "Run 3 'mem0 agent-rush search' commands before adding.").
- PII safety prompt on first `mem0 agent-rush add`. Interactive runs require
explicit `y` to acknowledge that AGENTRUSH memories are public; the
acknowledgement is persisted in `~/.mem0/config.json` under
`agent_rush.acknowledged_at` so the prompt only appears once per machine.
Non-interactive (agent) invocations surface the warning to stderr without
blocking.
- New config schema field: `agent_rush.acknowledged_at` (ISO timestamp,
empty until first interactive acknowledgement).
### Changed
- HTTP requests from the new agent-rush commands send `X-Mem0-Mode: agent-rush`
in addition to the existing source headers, so platform telemetry can split
game traffic from regular CLI usage.
## [0.2.6] and earlier
Unlogged historical releases. See git history under `cli/python/`.
+91 -29
View File
@@ -4,7 +4,7 @@ description: "Major product launches, headline features, and milestones for Mem0
mode: "wide"
---
<Update label="2026-06-27" description="SDK memory expiration and TypeScript provider updates">
<Update label="2026-06-27" description="SDK memory expiration">
**SDK Memory Expiration: Expiring Memories Across Python and TypeScript**
@@ -19,6 +19,96 @@ See [SDK & Tools](/changelog/sdk) for version details and PR links.
</Update>
<Update label="2026-06-25" description="Mem0 Plugin v0.2.11">
**Mem0 Plugin: Shared Memory for Claude Code, Cursor, Codex, and Antigravity**
The shared Mem0 editor plugin is current through v0.2.11:
- **Automatic context injection:** File reads, bash errors, session resume prompts, and startup timelines can retrieve relevant memories automatically.
- **Project and global scopes:** Project-scoped memories remain the default, while `global_search` supports team-wide recall across users and app scopes.
- **Coding categories:** A 17-category coding taxonomy installs in the background and is cached per Mem0 account.
- **Reliable capture:** Auto-capture, compaction summaries, session summaries, and metadata defaults keep memories scoped and readable.
- **Editor correctness:** Telemetry now reports Claude Code, Cursor, Codex, and Antigravity separately with each editor's real plugin version.
</Update>
<Update label="2026-06-25" description="Antigravity Plugin v0.1.3">
**Antigravity Plugin: Mem0 for Google Antigravity**
Antigravity support in the shared Mem0 editor plugin family is current through v0.1.3:
- **Self-contained plugin:** Includes its own plugin manifest, MCP config, hooks, shared scripts, and skills.
- **AGENTS.md convention:** Uses Antigravity's `contextFileName: "AGENTS.md"` convention.
- **Lifecycle hooks:** Wires session start, prompt recall, file-read context, memory-tool metadata enforcement, bash-error lookup, post-tool tracking, and stop summaries.
- **Shared memory layer:** Reuses the Mem0 Platform MCP tools and the shared 16-skill command bundle.
- **Better automatic recall:** v0.1.3 adds reranked injected context and clean `files_touched` metadata in session summaries.
- **Telemetry correctness:** v0.1.2 reports Antigravity as `antigravity` with the plugin's own version.
</Update>
<Update label="2026-06-22" description="OpenCode Plugin v0.2.0">
**OpenCode Plugin: Native SDK Memory Tools for OpenCode**
`@mem0/opencode-plugin` adds memory to OpenCode and is current through v0.2.0:
- **Native SDK tools:** Memory tools register through `@opencode-ai/plugin` and call the `mem0ai` SDK directly, so the plugin no longer depends on `mcp.mem0.ai`.
- **Memory scopes:** Operations support `project`, `session`, and `global` scope, with `/mem0-scope` to change the default.
- **Automatic context:** File-context injection, structured compaction summaries, and a recent-activity timeline surface relevant memories without manual recall.
- **Auto-dream consolidation:** Gated consolidation merges duplicates, drops stale or sensitive entries, and rewrites vague memories.
- **Skills load in place:** The `config` hook adds bundled skills to `skills.paths` instead of copying them into user config directories.
- **Safety controls:** Blocks `MEMORY.md` writes and redacts secrets before storing memories.
</Update>
<Update label="2026-06-12" description="Pi Agent Plugin v0.1.2">
**Pi Agent Plugin: Persistent Memory for Pi Agent**
`@mem0/pi-agent-plugin` adds semantic memory to Pi Agent and has been updated through v0.1.2:
- **Agent memory tool:** Registers `mem0_memory` for scoped search, add, get, delete, and delete-all operations.
- **Slash commands:** Adds `/mem0-remember`, `/mem0-search`, `/mem0-forget`, `/mem0-tour`, `/mem0-dream`, `/mem0-pin`, `/mem0-scope`, and `/mem0-status`.
- **Auto-capture:** Stores user and assistant memories after agent turns.
- **Dream consolidation:** Merges duplicates, resolves contradictions, and prunes stale memories behind session, time, and memory-count gates.
- **Project scoping:** Uses git-root detection for stable `app_id` values across monorepos.
- **Relevant command results:** v0.1.2 adds visible command feedback and thresholded, reranked search for search, forget, and pin commands.
</Update>
<Update label="2026-06-12" description="OpenClaw v1.0.13">
**OpenClaw Plugin: Current Memory Backend for OpenClaw**
`@mem0/openclaw-mem0` is current through v1.0.13, with the original production-ready memory backend plus newer setup, security, and runtime work:
- **Skills-based memory architecture:** Triage, recall, and dream skills handle extraction, recall, consolidation, and tool guidance.
- **Chat and CLI setup:** Supports chat-based platform setup, `openclaw mem0 init`, direct API keys, email OTP, autonomous agent setup, and OSS onboarding.
- **Platform and OSS modes:** Works with Mem0 Platform or self-hosted OSS providers including OpenAI, Anthropic, Ollama, Qdrant, and PGVector.
- **Agent-friendly CLI:** All 16 CLI commands support `--json` for machine-driven setup and diagnostics.
- **Runtime integration:** Exposes OpenClaw memory capability APIs for search manager and backend config status.
- **Security and compliance:** Added path containment checks, sensitive config metadata, dependency overrides, telemetry hashing, and metadata-only registration safety.
</Update>
<Update label="2026-06-10" description="Vercel AI SDK Provider v3.0.0">
**Vercel AI SDK Provider: Memory-Augmented Generation for AI SDK v6**
The Vercel AI SDK provider moved to the v6 provider contract and Mem0 v3 APIs:
- **AI SDK v6 support:** Migrated to `LanguageModelV3` / `ProviderV3`, including v3 stream lifecycle events and content arrays.
- **Mem0 v3 API support:** Memory writes and searches now use `/v3/memories/add/` and `/v3/memories/search/`.
- **Mem0 sources in responses:** `generateText` and `streamText` responses include memories as sources with `providerMetadata.mem0.memories`.
- **Safer prompt handling:** Prompts are cloned before memory injection, avoiding caller-side mutation.
- **Async storage fix:** `addMemories` is awaited so generated memories are not silently dropped.
- **Raw memory utilities:** Exports `searchMemories`, `retrieveMemories`, `getMemories`, and `addMemories` for apps that need direct memory control.
- **Deployment controls:** Per-request `mem0ApiKey` and `host` support Mem0 Platform, custom API keys, and self-hosted API endpoints.
</Update>
<Update label="2026-05-13" description="Temporal Reasoning for Mem0 Platform v3">
**Temporal Reasoning: Time-Aware Retrieval for Platform v3**
@@ -94,34 +184,6 @@ A full-featured command-line interface for Mem0, available in both Python and No
</Update>
<Update label="2026-04-06" description="OpenClaw v1.0.4">
**OpenClaw Plugin: Production-Ready**
The OpenClaw Mem0 plugin went from initial release to production-ready in one week (v1.0.0 → v1.0.4):
- **Skills-based memory architecture:** New extraction pipeline with skill-loader, batched extraction, and domain-aware memory triage.
- **Dream gate:** Automatic memory consolidation during idle periods for higher-quality long-term recall.
- **Interactive CLI:** `openclaw mem0 init`, `status`, `config`, `import`, and `event` commands.
- **Unified tool naming:** `memory_add` and `memory_delete` replace four legacy tools and match the platform API.
- **Security hardened:** Path traversal protection, pinned dependencies, and 329 tests across 10 files.
</Update>
<Update label="2026-04-02" description="Mem0 Plugin for AI Editors">
**Mem0 Plugin for Claude Code, Cursor, and Codex**
Launched a unified Mem0 plugin across three major AI development environments: Claude Code and Cursor first (March 25), then Codex (April 2).
- **9 MCP memory tools:** Add, search, get, update, delete, bulk delete, and entity management via `mcp.mem0.ai`.
- **Lifecycle hooks:** Automatic memory capture at session start, context compaction, task completion, and session end.
- **Cloud MCP server:** Managed endpoint replaces local MCP and Smithery setup.
- **Streamable HTTP transport:** New MCP transport protocol for real-time streaming.
- **Codex-specific skill:** Dedicated skill in `mem0-plugin/skills/mem0-codex` for Codex workflows.
</Update>
<Update label="2026-03-21" description="New Providers">
**Apache AGE, Turbopuffer, MiniMax, and pgvector for Node.js**
-336
View File
@@ -1,336 +0,0 @@
---
title: "OpenClaw"
description: "Release notes for the OpenClaw plugin and agent harness."
mode: "wide"
---
<Update label="2026-06-12" description="v1.0.13">
**Fixes:**
- **Custom categories payload:** `customCategories` (a `Record<string, string>` map) is now converted via the new `customCategoryMapToList()` helper into the `Array<Record<string, string>>` shape the Mem0 SDK expects on `add` calls: previously the raw object was passed as `custom_categories` and silently ignored ([#5345](https://github.com/mem0ai/mem0/pull/5345))
- **Skip runtime setup during metadata registration:** `register()` now detects `registrationMode === "cli-metadata"`, registers only the CLI commands, and returns early: avoiding backend initialization, service/tool registration, and hook installation during OpenClaw's metadata-only registration pass ([#5383](https://github.com/mem0ai/mem0/pull/5383))
**Security:**
- Bumped `mem0ai` from `3.0.3` to `3.0.7` (latest Node SDK): includes the transitive axios CVE remediation shipped in `3.0.6` ([#5460](https://github.com/mem0ai/mem0/pull/5460))
- Added pnpm override `uuid@<11.1.1` → `>=11.1.1` to resolve an open MEDIUM Dependabot alert ([#5489](https://github.com/mem0ai/mem0/pull/5489))
**Improvements:**
- **Repo consolidation:** Plugin moved from repo-root `openclaw/` to `integrations/openclaw/`; `package.json` `repository.directory` updated to match so npm provenance links to the correct subdirectory ([#5491](https://github.com/mem0ai/mem0/pull/5491))
**Tests:**
- Added `customCategoryMapToList` unit tests and a `PlatformProvider` test asserting `custom_categories` is passed to the Mem0 SDK as a list ([#5345](https://github.com/mem0ai/mem0/pull/5345))
- Added a regression test asserting `cli-metadata` registration registers only CLI commands and triggers no runtime side effects ([#5383](https://github.com/mem0ai/mem0/pull/5383))
</Update>
<Update label="2026-06-02" description="v1.0.12">
**Docs:**
- **Agent Mode onboarding:** README now documents an autonomous setup path for AI agents: `mem0 init --agent --json` mints an evaluation Mem0 API key with no email, OTP, or browser and exports it as `MEM0_API_KEY` for `openclaw mem0 init`; a human owner can later run `mem0 init --email <email>` to claim ownership without disrupting the agent ([#5123](https://github.com/mem0ai/mem0/pull/5123))
**Security:**
- Added pnpm overrides to remediate advisories in transitive dependencies: `langsmith@<0.6.0` → `^0.6.0`, `picomatch@<2.3.2` → `^2.3.2`, `vite` → `^8.0.5`, and `@qdrant/js-client-rest` → `^1.18.0` ([#5294](https://github.com/mem0ai/mem0/pull/5294))
**Dependencies:**
- Bumped `mem0ai` from `3.0.2` to `3.0.3` ([#5212](https://github.com/mem0ai/mem0/pull/5212))
- Bumped dev dependencies `@vitest/coverage-v8` and `vitest` from `^4.0.18` to `^4.1.7`; added `vite@^8.0.5` and `@qdrant/js-client-rest@^1.18.0` ([#5294](https://github.com/mem0ai/mem0/pull/5294))
</Update>
<Update label="2026-04-29" description="v1.0.11">
**New Features:**
- **Skills-mode auto-setup:** `enableSkillsConfig()` now runs automatically after onboarding: enables triage, recall (with reranking + keyword search), and dream consolidation with `tools.profile = "full"` and disables the built-in session-memory hook to avoid conflicts
- **Memory runtime capability:** Plugin now exposes `runtime.getMemorySearchManager()` and `resolveMemoryBackendConfig()` on the registered memory capability, enabling OpenClaw gateway to query memory status and backend config directly
- **Dimension-aware collections:** OSS wizard detects embedder dimension changes and creates a new collection (`mem0_<dims>d`) automatically, with a warning about old memories being inaccessible under the new embedder
- **Tool documentation in skills:** Both `memory-triage` and `memory-dream` SKILL.md files now include full tool reference sections listing all available tools with parameters
**Improvements:**
- **Auto-capture and auto-recall default to enabled:** `autoCapture` and `autoRecall` now default to `true` (was `false`). Manifest descriptions updated accordingly. Ignored in skills mode
- **`memory_update` over delete+add:** Skills now prefer `memory_update` for in-place edits: atomic and preserves edit history. Consolidation pattern updated: update best memory, delete redundant ones
- **Search threshold lowered:** Default `searchThreshold` reduced from `0.5` to `0.1` for broader recall. Removed hardcoded `0.6` recall-specific override: all searches now use the configured threshold
- **Embedder dimension propagation:** Vector store config auto-resolves dimensions from embedder config when not explicitly set. Syncs `dimension` and `embeddingModelDims` fields for Qdrant/PGVector compatibility
- **Config file write safety:** `writeFullConfig()` now re-reads and deep-merges the `plugins` section before writing, preserving `installs` and `slots` written by the OpenClaw gateway
- **Additional embedder models:** Added `mxbai-embed-large` (1024), `all-minilm` (384), and `snowflake-arctic-embed` (1024) to known embedder dimensions
**Security:**
- Bumped `protobufjs` to `>=7.5.5` via pnpm overrides (GHSA-xq3m-2v4x-88gg) ([#5012](https://github.com/mem0ai/mem0/pull/5012))
**Fixes:**
- Moved `bootstrapTelemetryFlag()` and removed `ensureInstallRecord()` from module-level side effects: both now run inside `register()` to avoid crashes when loaded outside OpenClaw gateway
- Fixed OSS history DB path resolution: absolute paths no longer passed through `resolvePath()`, preventing double-prefix bugs
- Manifest `providerAuthEnvVars` replaced with spec-compliant `setup.providers` format using `id` + `envVars`
**Dependencies:**
- Bumped `mem0ai` from `3.0.1` to `3.0.2`
- Bumped `pluginApi` and `minGatewayVersion` compat to `>=2026.4.24`
</Update>
<Update label="2026-04-23" description="v1.0.10">
**Security:**
- Telemetry `distinct_id` now uses SHA-256 instead of MD5: prevents rainbow-table reversal of API key hashes
- User email is now SHA-256 hashed before sending as `distinct_id`: no PII in telemetry payloads
- Declared PostHog telemetry endpoint (`us.i.posthog.com`) in `providerEndpoints`
**Fixes:**
- Fixed version-pinned install records preventing plugin updates. `ensureInstallRecord()` now detects semver-pinned specs (e.g. `@mem0/openclaw-mem0@1.0.7`) and rewrites them to `@latest` or `clawhub:` prefix so `openclaw plugins update` resolves to the newest release
- Fixed `searchThreshold` default inconsistency: standardized to `0.3` across docs, README, and manifest
- `PLUGIN_VERSION` now injected at build time via tsup `define` from `package.json`: no more hardcoded version strings
**Manifest Compliance:**
- Removed non-spec fields: `requiredEnvVars`, `dataLocations`, `privacy`, `setup` (with `externalEndpoints`, `providers`, `requiresRuntime`, `postInstallHint`)
- Replaced `setup.externalEndpoints` with spec-compliant `providerEndpoints` using `endpointClass` + `hosts` format
- Env var declarations now rely solely on `providerAuthEnvVars` (already spec-compliant)
**Docs:**
- Fixed `openclaw plugins update` command: uses plugin ID (`openclaw-mem0`), not npm package name (`@mem0/openclaw-mem0`)
- Added update section to README
- Removed redundant "Key Features" and "Conclusion" sections from integration docs
</Update>
<Update label="2026-04-22" description="v1.0.9">
**Security & Compliance:**
- Added top-level `requiredEnvVars` to plugin manifest, declaring env vars per mode (platform, OSS OpenAI, OSS Anthropic, OSS Ollama). Fixes ClaHub scanner "required env vars: none" mismatch
- Added `sensitive: true` and descriptions to `apiKey` and `userEmail` in `configSchema`: previously only declared in `uiHints`
- Added `default: false` with descriptions to `autoCapture` and `autoRecall` in `configSchema` so scanner can confirm opt-in defaults
- Added `dataLocations` field to manifest declaring all persistence paths (config, vectorStore, historyDb, dreamState)
- Added `privacy` field to manifest documenting data flow for platform vs open-source mode and credential storage guidance
- Added `externalEndpoints` to `setup` section declaring api.mem0.ai and app.mem0.ai with purpose and requirement context
**Tests:**
- Replaced direct `process.env` access in `tests/cli-commands.test.ts` and `tests/fs-safe.test.ts` with `vi.stubEnv`/`vi.unstubAllEnvs`. Fixes ClaHub static analysis flag for "environment variable access combined with network send"
- 421 tests across 15 test files
</Update>
<Update label="2026-04-21" description="v1.0.8">
**New Features:**
- **OSS Onboarding Wizard:** New guided 4-step interactive setup for open-source mode: walks through LLM provider, embedding provider, vector store, and user ID selection with prefilled defaults
- **Agent-Friendly CLI:** Added `--json` flag to all 16 CLI commands for machine-readable output. Agents can call `openclaw mem0 help --json` to discover every command and flag
- **Non-Interactive OSS Setup:** Added `--mode open-source` with `--oss-llm`, `--oss-embedder`, `--oss-vector` flags for fully automated OSS configuration without prompts
- **JSON Helpers Module:** New `cli/json-helpers.ts` with `jsonOut`, `jsonErr`, and `redactSecrets` utilities for consistent structured output
**Improvements:**
- **Init Flow Redesigned:** Replaced 3-option flat menu with 2-level structure: Platform (email login or API key) and Open Source (guided wizard)
- **Provider Selection:** LLM providers: OpenAI, Ollama, Anthropic. Embedding providers: OpenAI, Ollama. Vector stores: Qdrant, PGVector
- **Input Prefill:** All prompts with defaults (base URL, user ID) now prefill the input field instead of showing defaults in brackets
- **Smart Reuse:** When LLM and embedder use the same provider, API key and base URL are automatically reused from the LLM step
- **Default Model:** Updated default LLM model to `gpt-5-mini`
- **Manifest Compliance:** Removed undocumented fields, aligned env var declarations between SKILL.md and manifest, fixed `configSchema.required` for clean installs
**Tests:**
- 404 tests across 15 test files (+3 new: `json-helpers.test.ts`, `oss-wizard.test.ts`, `cli-commands.test.ts`)
</Update>
<Update label="2026-04-20" description="v1.0.7">
**New Features:**
- **Chat-Based Setup:** Added chat-based Platform setup flow: users can now configure the plugin conversationally instead of editing config files manually
- **Installation Docs Rewrite:** Rewrote README and integration docs with chat-first setup, numbered manual steps.
**Improvements:**
- **SDK Upgrade:** Bumped `mem0ai` dependency to 3.0.1 for V3 API compatibility
- **Config Cleanup:** Dropped deprecated `orgId`, `projectId`, `enableGraph` config options; updated CLI prompts ([#4734](https://github.com/mem0ai/mem0/pull/4734), [#4764](https://github.com/mem0ai/mem0/pull/4764))
- **Noise Filtering:** Expanded noise patterns in memory add tool; handle leading text in JSON extraction
</Update>
<Update label="2026-04-11" description="v1.0.6">
**Bug Fixes:**
- **Telemetry:** Replaced shared `"anonymous-openclaw"` fallback with a persistent per-machine random hash (`openclaw-anon-<uuid>`), so anonymous plugin users are counted individually in PostHog ([#4790](https://github.com/mem0ai/mem0/pull/4790))
- **Telemetry:** Added PostHog `$identify` event on first authenticated run to stitch anonymous history onto the authenticated profile ([#4790](https://github.com/mem0ai/mem0/pull/4790))
- **Telemetry:** Fixed event loss on short-lived CLI invocations: added `beforeExit` handler to flush queued events before the process exits ([#4790](https://github.com/mem0ai/mem0/pull/4790))
- **Telemetry:** Added lazy `/v1/ping/` email resolution so users who configure API key outside `mem0 init` show as their email in PostHog, not an md5 hash ([#4790](https://github.com/mem0ai/mem0/pull/4790))
- **Telemetry:** Unified CLI event prefix from `openclaw.<cmd>` to `openclaw.cli.<cmd>` on the needsSetup branch to match the authenticated branch ([#4790](https://github.com/mem0ai/mem0/pull/4790))
**Improvements:**
- **API:** Added `source: "OPENCLAW"` to all provider calls (`add`, `search`, `getAll`) across tools, CLI commands, recall, and the OSS backend adapter ([#4790](https://github.com/mem0ai/mem0/pull/4790))
</Update>
<Update label="2026-04-07" description="v1.0.5">
**Bug Fixes:**
- **Init interactive choice bug**: Fixed number selection in `openclaw mem0 init`: entering 1/2/3 now correctly selects the corresponding option (was broken by readline prefill concatenating with user input)
- **OSS pgvector crash** ([#4727](https://github.com/mem0ai/mem0/issues/4727)): Fixed "Client has already been connected" cascade when using pgvector in OSS mode. The warmup call swallowed errors leaving a half-initialized pg client; concurrent recall/capture then all hit `client.connect()` on the same client. Fix: let warmup errors propagate (so `initPromise` resets and retries with a fresh Memory + fresh pg client) and build fresh config objects per attempt instead of mutating shared state.
**Removed:**
- **`orgId` / `projectId` config parameters**: Removed from config schema, CLI (`config show/get/set`), init display, and providers. The API key is project-scoped, so separate org/project IDs are unnecessary and could cause access errors if mismatched.
- **`enableGraph` config parameter**: Removed from all config surfaces, providers, backend, and tools. Graph memory is being deprecated: removing the flag avoids unnecessary exposure.
</Update>
<Update label="2026-04-04" description="v1.0.4">
**New Features:**
- **Interactive init flow**: `openclaw mem0 init` with interactive menu (email verification or direct API key). Non-interactive modes: `--api-key`, `--email`, `--email --code`
- **`memory_add` tool**: Replaces `memory_store`: name now matches `mem0` CLI and platform API
- **`memory_delete` tool**: Unified delete: single ID, search-then-delete, bulk, entity cascade. Replaces `memory_forget` and `memory_delete_all`
- **CLI subcommands**: `openclaw mem0 init`, `openclaw mem0 status`, `openclaw mem0 config show`, `openclaw mem0 config set`
- **`import` CLI command**: Bulk-import memories from a JSON file with `--user-id` and `--agent-id` overrides
- **`event list` / `event status` CLI commands**: Monitor background processing events
- **`fs-safe.ts` module**: Isolated filesystem wrappers in a separate entry point
- **`backend/` module**: `PlatformBackend` with direct HTTP API access for CLI commands
- **Plugin manifest**: Added `contracts.tools`, `configSchema`, and `uiHints` to `openclaw.plugin.json`
- **Test suite**: 329 tests across 10 test files
**Changes:**
- **Modular architecture**: Extracted tools into `tools/` directory (6 files) and CLI into `cli/commands.ts`
- **Code splitting**: tsup builds with `splitting: true` and two entry points
- **Skills updated**: All SKILL.md files reference new tool names (`memory_add`, `memory_delete`)
- **Auto-recall timeout**: Recall wrapped in 8-second `Promise.race`
- **Auto-capture fire-and-forget**: `provider.add()` runs in background via `.then()/.catch()`
- **Auto-capture minimum content gate**: Skips extraction when total user content is fewer than 50 chars
**Removed:**
- `memory_store` tool: replaced by `memory_add`
- `memory_forget` tool: replaced by `memory_delete`
- `memory_delete_all` tool: merged into `memory_delete`
- `memory_history` tool and `history` CLI command: deprecated
</Update>
<Update label="2026-04-03" description="v1.0.3">
**Bug Fixes:**
- **Security**: Added `safePath()` containment helper to `readSkillFile` and `readDomainOverlay` in `skill-loader.ts`: prevents directory traversal
- **Noise filter**: Reverted incorrect `After-Compaction` regex rename back to `Post-Compaction`
**Changes:**
- **Supply-chain hardening**: Pinned `mem0ai` dependency to exact `2.3.0` (was `^2.3.0`)
**Tests:**
- 12 new tests covering `safePath`, `readSkillFile`, `readDomainOverlay`, and `loadSkill` with traversal inputs
</Update>
<Update label="2026-04-02" description="v1.0.2">
**Bug Fixes:**
- **Security**: Removed `resolveEnvVars()` and `resolveEnvVarsDeep()` from `config.ts`: plugin-side env resolution was redundant and triggered static analysis warnings ([#4676](https://github.com/mem0ai/mem0/pull/4676))
</Update>
<Update label="2026-04-02" description="v1.0.1">
**New Features:**
- **CD workflow**: Added continuous deployment workflow with OIDC trusted publishing ([#4672](https://github.com/mem0ai/mem0/pull/4672))
- **Plugin configuration manifest**: Added `compat` and `build` metadata to `package.json` ([#4667](https://github.com/mem0ai/mem0/pull/4667))
- **LICENSE**: Added Apache-2.0 license file ([#4667](https://github.com/mem0ai/mem0/pull/4667))
**Bug Fixes:**
- **Dream gate**: Fixed cheap-first ordering, session isolation, and verified completion ([#4666](https://github.com/mem0ai/mem0/pull/4666))
- **Graceful startup**: Plugin now starts gracefully when no API key is configured ([#4669](https://github.com/mem0ai/mem0/pull/4669))
</Update>
<Update label="2026-04-01" description="v1.0.0">
**New Features:**
- **Skills-based memory architecture**: New skill-loader and skill-based extraction pipeline with batched extraction ([#4624](https://github.com/mem0ai/mem0/pull/4624))
- **Dream gate**: Memory consolidation and dream-cycle processing during idle periods
- **Enhanced recall**: New `recall.ts` module with improved recall logic and skill-aware retrieval
- **Memory triage skill**: Domain-aware memory triage with companion domain support and recall protocol
- **Memory dream skill**: Skill for memory consolidation during idle periods
- **Plugin configuration**: Added `openclaw.plugin.json` manifest and `scripts/configure.py` setup helper
**Changes:**
- Extraction pipeline refactored to use skills-based architecture for more contextual and higher quality memory capture
</Update>
<Update label="2026-03-26" description="v0.4.1">
**New Features:**
- **Improved extraction quality**: Enhanced noise filtering, deduplication, and better extraction instructions
**Bug Fixes:**
- **Credential detection**: Improved detection of credentials, API keys, and secrets in extraction instructions (#4552)
- **Standalone timestamps**: Prevented extraction of standalone timestamps as memories (#4550)
</Update>
<Update label="2026-03-16" description="v0.4.0">
**New Features:**
- **Non-interactive trigger filtering**: Skips recall and capture for `cron`, `heartbeat`, `automation`, and `schedule` triggers
- **Subagent hallucination prevention**: Detects ephemeral subagent sessions and routes recall to parent namespace
- **Dynamic recall thresholding**: Memories scoring less than 50% of top result are dropped
- **SQLite resilience**: Init error recovery with automatic retry for OSS mode
- **`disableHistory` config option**: New `oss.disableHistory` flag
- 78 unit tests covering filtering, isolation, trigger filtering, subagent detection, and SQLite resilience
**Changes:**
- Auto-recall threshold raised from 0.5 to 0.6 for stricter precision
- Recall candidate pool increased to `topK * 2` for better filtering headroom
- Relaxed extraction instructions: related facts kept together to preserve context
**Bug Fixes:**
- **Concurrent session race condition**: Lifecycle hooks now use `ctx.sessionKey` directly instead of a shared mutable variable
</Update>
<Update label="2026-03-12" description="v0.3.1">
**New Features:**
- **Message filtering pipeline**: Multi-stage noise removal before extraction
- **Broad recall for new sessions**: Short or new-session prompts trigger secondary broad search
- **Client-side threshold filtering**: Safety net that drops low-relevance results
- **Temporal anchoring**: Extraction instructions now include current date
- 55 unit tests covering filtering and isolation helpers
**Changes:**
- Extraction window expanded from last 10 to last 20 messages
- Rewritten custom extraction instructions for conciseness and deduplication
- Refactored monolithic `index.ts` (1772 lines) into 6 focused modules
</Update>
<Update label="2026-03-10" description="v0.3.0">
**Bug Fixes:**
- Updated `mem0ai` dependency with sqlite3 to better-sqlite3 migration (#4270)
</Update>
<Update label="2026-03-09" description="v0.2.0">
**New Features:**
- Per-agent memory isolation for multi-agent setups via `agentId`
- "Understanding userId" section in docs
**Changes:**
- Updated config examples to use concrete `userId` values instead of placeholders
**Bug Fixes:**
- Migrated platform search to Mem0 v2 API
</Update>
<Update label="2026-02-19" description="v0.1.2">
**New Features:**
- Source field for openclaw memory entries
**Bug Fixes:**
- Auto-recall injection and auto-capture message drop
</Update>
<Update label="2026-02-02" description="v0.1.0">
**New Features:**
- Initial release of the OpenClaw Mem0 plugin
- Platform mode (Mem0 Cloud) and open-source mode support
- Auto-recall: inject relevant memories before each turn
- Auto-capture: store facts after each turn
- Configurable `topK`, `threshold`, and `apiVersion` options
</Update>
+659 -18
View File
@@ -1583,6 +1583,16 @@ See the [TypeScript SDK migration guide](https://docs.mem0.ai/migration/ts-v2-to
<Tab title="CLI">
<Update label="2026-06-19" description="Python v0.2.8 / Node v0.2.9">
**Security:**
- **Telemetry key handling:** CLI telemetry no longer passes the Mem0 API key to a child process through command-line arguments. The context is sent over stdin, so the key is not visible in `ps`, `/proc/<pid>/cmdline`, or Activity Monitor. Fixes #4862.
**Bug Fixes:**
- **Python package version:** `__version__` now matches the packaged `mem0-cli` version.
</Update>
<Update label="2026-06-01" description="Node v0.2.8">
**Security:**
@@ -1590,6 +1600,19 @@ See the [TypeScript SDK migration guide](https://docs.mem0.ai/migration/ts-v2-to
</Update>
<Update label="2026-05-20" description="Python v0.2.7 / Node v0.2.7">
**New Features:**
- **`mem0 whoami`:** Prints the active agent's `default_user_id` from local config without a network call.
- **`mem0 agent-rush <add | search>`:** Wraps the `/v1/agent-rush/` platform endpoints for the AGENTRUSH game. Project routing is resolved server-side, and platform error codes are shown as actionable hints.
- **PII safety prompt:** The first interactive `mem0 agent-rush add` asks users to acknowledge that AGENTRUSH memories are public. The acknowledgement is stored in `~/.mem0/config.json` under `agent_rush.acknowledged_at`.
- **Config schema:** Added `agent_rush.acknowledged_at` for the local acknowledgement timestamp.
**Changes:**
- **Agent Rush telemetry:** Agent Rush commands send `X-Mem0-Mode: agent-rush` so platform telemetry can split game traffic from regular CLI usage.
</Update>
<Update label="2026-05-16" description="Python v0.2.6 / Node v0.2.6">
**Bug Fixes:**
@@ -1706,13 +1729,639 @@ A full-featured command-line interface for Mem0, available in both Python and No
<Tab title="Plugins">
<Update label="2026-06-01" description="openclaw-mem0 v1.0.12">
<Tabs>
<Tab title="Mem0 Plugin">
**Security:**
- **Dependencies:** Pinned transitive dependencies via pnpm overrides to remediate high-severity CVEs: `protobufjs` → ^7.5.5, `vite` → ^8.0.5, `langsmith` → ^0.6.0 (CVE-2026-45134), `picomatch` → ^2.3.2 (CVE-2026-33671), `@qdrant/js-client-rest` → ^1.18.0
<Update label="2026-06-25" description="mem0-plugin v0.2.11">
**Fixes:**
- **Session summary metadata:** `files_touched` now stores a real list instead of a double-encoded JSON string, so returned memories render readable file paths across Claude Code, Cursor, Codex, and Antigravity.
**Improvements:**
- **Reranked auto-injected context:** File-context, bash-error lookup, and session-resume prefetch now rerank by default. Disable with `MEM0_RERANK=0`, `false`, `no`, or `off`.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.10">
**Fixes:**
- **Editor telemetry attribution:** Antigravity is no longer counted as Claude Code, Codex no longer falls back to the generic `plugin` bucket, and Cursor wrappers now pin their platform before delegating to shared hook scripts.
- **Per-editor plugin version:** Telemetry reads the manifest for the detected platform instead of always reading the Claude plugin manifest.
**New Features:**
- **`MEM0_PLATFORM` override:** Explicit platform markers now win over env-var auto-detection for reliable telemetry labels.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.9">
**New Features:**
- **File-context injection:** Before supported editors read a file, Mem0 searches for memories that reference that path and injects a compact prior-work timeline.
- **Stop hook session summaries:** Session-end hooks store structured summaries with request, decisions, learnings, next steps, and files touched.
- **SessionStart activity timeline:** Sessions with existing memories show recent decisions, bug fixes, and session summaries on startup.
**Changes:**
- Added shared `file_context.py`, `capture_session_summary.py`, and `session_timeline.py` helpers for the hook pipeline.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.8">
**New Features:**
- **Global search mode:** `global_search` lets reads search all users and projects in the platform project while writes stay scoped to the current `user_id` and `app_id`.
- **Automatic coding categories:** The coding taxonomy is installed in the background on session start and gated by an API-key and taxonomy fingerprint.
- **Global scope controls:** `/mem0:switch-project --global` and `/mem0:switch-project --no-global` persist global-search behavior in `~/.mem0/settings.json`.
- **Scope-aware startup:** Session banners show `scope=global` when global search is active, and startup memory counts use the same global filter.
- **Category setup state:** `~/.mem0/categories_setup.json` caches setup per Mem0 account and taxonomy fingerprint, so categories are applied once and re-applied only when the taxonomy changes.
- **Tests:** Added coverage for category fingerprints, state-file gating, state save/load, and idempotent category application.
**Changes:**
- Session start spawns `auto_setup_categories.py` in the background alongside project-file auto-import.
- Onboarding no longer asks users to install coding categories manually; it verifies status and applies categories only if the background run has not finished.
- New-project startup copy now tells users that coding categories install automatically.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.7">
**Fixes:**
- **First-install auth:** Removed `authorizationUrl` from `.mcp.json` so Claude Code uses the `MEM0_API_KEY` header instead of falling into a broken OAuth reconnect flow.
- **Onboarding auth copy:** `/mem0:onboard` no longer tells users to complete browser OAuth.
- **Invalid configure command:** Removed `claude plugin configure mem0` references and clarified that Claude Code stores the plugin API key through the enable UI prompt.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.6">
**Fixes:**
- **Memory count and stats:** Removed the `run_id: "*"` filter from read paths so memories written without `run_id` are visible again.
- **Write scoping:** `add_memory` moved session tracking from top-level `run_id` to `metadata.session_id`, keeping new memories in the default query partition.
- **Session stats:** Memory add/search tracking moved into `enforce_metadata_defaults.sh`, because plugin MCP tools do not trigger PostToolUse hooks.
- **Auto-capture reliability:** Added direct API auto-capture every third message plus a proportional prompt nudge when few memories have been stored.
- **Desktop API keys:** `_identity.sh` and `_identity.py` can read `MEM0_API_KEY` from common shell profiles when Claude Code Desktop does not inherit shell env vars.
- **Import cleanup:** Stale auto-import chunks now delete through the v1 delete endpoint, matching Mem0 v3 add behavior.
**Removed:**
- Removed Stop and SessionEnd hook capture paths, redundant post-commit/task/subagent scripts, dead settings, and the deleted file-read test.
**Changes:**
- Stats and tour now query with `user_id` + `app_id` filters only.
- Session banners now tell agents to store learnings incrementally instead of waiting until session end.
- Session-start resets per-user message counters so nudges begin cleanly.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.5">
**Fixes:**
- **Hook schema:** PostToolUse scripts now read `tool_response`, Stop hook output is schema-compliant, and SessionStart uses visible raw stdout.
- **Tool coverage:** Memory write blocking includes `MultiEdit`, and metadata enforcement covers add, search, get, update, and delete-all variants.
- **Identity injection:** `add_memory`, `search_memories`, `get_memories`, and `delete_all_memories` receive safe default `user_id` and `app_id` values when the agent omits them.
- **Skill API calls:** Export, stats, pin, health, memory-reviewer, dream, tour, onboard, context-loader, and weekly stats examples now use the correct filter and `top_k` shapes.
- **Compact summary capture:** `capture_compact_summary.py` is spawned correctly after compaction and guarded against unset identity variables.
**New Features:**
- **Stop hook analyzer:** Added `stop_hook_check.py` to detect meaningful work before prompting memory capture.
- **Skill checklists:** Added progress checklists to `/mem0:dream` and `/mem0:onboard`.
**Changes:**
- `enforce_metadata_defaults.sh` was rewritten around handler-based dispatch and never overrides explicitly provided identity.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.4">
**Fixes:**
- **PostToolUse matcher:** Supports both `mcp__mem0__` and `mcp__plugin_mem0_mem0__` names so session stats record memory operations again.
- **File-read noise:** File-read recall now prefers `metadata.files` plus score threshold before falling back to basename search.
- **Pinning:** `/mem0:pin` no longer uses removed `immutable=True`; it relies on pinned metadata/text conventions.
- **Project listing:** `/mem0:list-projects` merges null-scoped and app-scoped memories so legacy records are counted.
- **ID lookup:** `/mem0:peek` routes memory-id references to `get_memory` instead of semantic search.
**New Features:**
- **Session ID capture:** SessionStart persists the Claude session ID for session-scoped memory operations.
- **Search controls:** `_search.py` gained `min_score`, metadata filters, rerank, and threshold support.
- **Reranked tour and peek:** `/mem0:tour` and `/mem0:peek` use reranking for better precision.
**Removed:**
- Removed the nonexistent `PostToolUseFailure` hook and the superseded `/mem0:protocol` skill.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.3">
**New Features:**
- **Read hook:** Added `PreToolUse(Read)` file recall with skip rules for non-code files, lockfiles, and `node_modules`.
- **Shared search module:** Added `_search.py` for v3 search calls and consistent context formatting.
- **Settings file:** Added `~/.mem0/settings.json` with search, retention, confidence, debug, and capture settings.
- **Memory skills:** Added `/mem0:forget`, `/mem0:peek`, `/mem0:memory-reviewer`, and `/mem0:context-loader`.
- **Compact output style:** Added compact `[type] content [mem0:id]` memory display.
- **Claude userConfig:** Added sensitive `api_key` plugin config support.
**Changes:**
- Skills were renamed to shorter command names, bash-error hooks now run real searches, resume prompts prefetch context, and remember-intent phrases route to `/mem0:remember`.
- API key resolution now checks `CLAUDE_PLUGIN_OPTION_API_KEY`, and hook timeouts increased for prompt and bash-output searches.
**Removed:**
- Removed `/mem0:dream --forget`, `/mem0:dream --schedule`, `/mem0:health --fix`, and CLI config fallback.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.2">
**Fixes:**
- **Compaction writes:** Prevented duplicate pre-compaction captures and shortened session-state content before letting Mem0 infer structured memories.
- **Error detection:** Reduced false positives from routine test and linter output.
- **Git commit noise:** Removed automatic background commit-context writes and gated post-commit prompts behind settings.
- **Project identity:** Added git-remote hash fallback when folders are renamed.
- **Dependency install race:** Added a lock and failure sentinel for `ensure_deps.sh`.
- **Telemetry:** Switched `distinct_id` from MD5 to SHA-256, protected system props, and loaded plugin version from the manifest.
**New Features:**
- **Chunking and import:** Added shared chunking helpers and Markdown chunk imports.
- **Metadata defaults:** Added `enforce_metadata_defaults.sh` for default confidence, source, and type on `add_memory`.
- **Project utilities:** Added list-projects, all-project tour, weekly stats, dream forget mode, and competing-tools import.
**Removed:**
- Removed `on_pre_commit.py` and merged digest, forget, import-tools, and peek flows into existing skills.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.1">
**New Features:**
- **Skill suite:** Added 11 skills for dream, export, import, tool import, forget, health, peek, pin, remember, stats, and digest.
- **Hook suite:** Added bash-error recall, git/commit context hooks, compaction recovery, session-end capture, subagent reminders, tool-failure recovery, and pre-commit capture.
- **Telemetry:** Added sampled PostHog telemetry with no memory content or API keys and `MEM0_TELEMETRY=false` opt-out.
- **Coding categories:** Added 10 more coding categories and dependency-managed SDK install through `ensure_deps.sh`.
- **Project onboarding:** Added auto-onboarding, `mem0.md` config loading, inactive API-key banner, import/export parsers, and competing-tool import.
**Changes:**
- Memory scoping moved from `metadata.project_id` to top-level `app_id`, and write paths moved to `/v3/memories/add/`.
- Session stats gained category counters and recent memory IDs.
- Tour, onboard, prompt hooks, and MCP guidance were updated for project-aware workflows.
**Fixes:**
- Shared scripts now resolve plugin API-key env vars consistently and pass hook CWD into project/branch resolution.
</Update>
<Update label="2026-06-25" description="mem0-plugin v0.2.0">
**New Features:**
- **Project-scoped memories:** Deterministic project IDs from git remotes isolate memories per repo.
- **Branch-aware tagging:** Session-state and compact-summary memories include branch metadata.
- **Project file import:** SessionStart imports `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, `.windsurfrules`, and `mem0.md` as project-profile memories.
- **Active identity banner:** Startup shows user, project, branch, and memory count.
- **Session report:** Stop hook reports memory writes, retrieves, and touched categories.
- **Onboarding, tour, and switch-project skills:** Added first-run setup, proof-of-value browsing, and manual project override.
- **Session stats tracker:** Added local add/search tracking for reports.
</Update>
<Update label="2026-04-02" description="mem0-plugin v0.1.3">
**Fixes:**
- **User ID regression:** `user_id` resolution no longer derives from `MEM0_API_KEY`, restoring `MEM0_USER_ID` to `$USER` to `default` order so older memories remain reachable.
**Upgrade Notes:**
- The `~/.mem0/identity.json` cache is no longer used.
- Users who stored memories under the short-lived API-key hash can recover them by temporarily setting `MEM0_USER_ID` to the old hash.
</Update>
<Update label="2026-04-02" description="mem0-plugin v0.1.2">
**New Features:**
- **Identity resolver:** Added deterministic user-id resolver, later reverted in v0.1.3.
- **Compact summaries:** Added SessionStart compact handler for `compact_summary` memories.
- **Coding taxonomy setup:** Added one-shot coding category setup for architecture, anti-patterns, task learnings, tooling, bug fixes, conventions, and preferences.
- **Debug logging:** Added opt-in hook logs with `MEM0_DEBUG=1`.
- **Shared MCP skill:** Replaced the Claude-Code-specific Codex skill with `mem0-mcp`.
**Fixes:**
- Session IDs are stored in memory metadata, startup exits quietly without an API key, memory-write blocking avoids `docs/memory/*.md`, duplicate compact writes were removed, and hook captures now expire after 90 days.
</Update>
<Update label="2026-04-02" description="mem0-plugin v0.1.1">
**Fixes:**
- Cursor plugin became fully functional.
- Codex plugin support and integration docs were added.
- Codex lifecycle hooks became available through the opt-in installer.
- Invalid Claude plugin config keys were removed.
</Update>
<Update label="2026-04-02" description="mem0-plugin v0.1.0">
**Mem0 Plugin for Claude Code, Cursor, and Codex**
Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex support:
- **9 MCP memory tools:** `add_memory`, `search_memories`, `get_memories`, `get_memory`, `update_memory`, `delete_memory`, `delete_all_memories`, `delete_entities`, `list_entities`: all via `mcp.mem0.ai`.
- **Lifecycle hooks:** Automatic memory capture at session start, context compaction, task completion, and session end.
- **Cloud MCP server:** Managed endpoint replaces local MCP and Smithery setup.
- **Streamable HTTP transport:** New MCP transport protocol for real-time streaming.
- **Codex-specific skill:** Dedicated skill in `mem0-plugin/skills/mem0-codex` for Codex workflows.
</Update>
</Tab>
<Tab title="OpenCode">
<Update label="2026-06-22" description="OpenCode plugin v0.2.0">
**Breaking Changes:**
- **Native SDK tools:** Memory tools are registered through `@opencode-ai/plugin` and backed by the `mem0ai` SDK directly. The plugin no longer registers or depends on `mcp.mem0.ai`.
- **Skills load in place:** The `config` hook adds `opencode-skills/` to `skills.paths`; skills are no longer copied into user config directories.
- **Focused skill set:** Trimmed to 9 skills: `context-loader`, `dream`, `forget`, `status`, `search`, `scope`, `pin`, `remember`, and `tour`.
**New Features:**
- **Memory scopes:** Memory operations support `project`, `session`, and `global` scope, with `/mem0-scope` for changing the default.
- **Auto-dream:** Gated memory consolidation can merge duplicates, drop stale/sensitive entries, and rewrite vague memories.
- **Expanded telemetry:** OpenCode emits the shared `plugin.*` schema, including prompt, bash-error, pre-compact, session-stop, dream-triggered, and dream-completed events.
**Fixes:**
- **Project ID detection:** Git remote parsing now handles HTTPS, SSH, and custom SSH host aliases before falling back to the repo root.
- **Auto-dream visibility:** `/mem0-status` shows which dream gate is blocking consolidation.
- **Delete-all safety:** User-wide deletes require explicit `scope="global"`, regardless of the default scope.
</Update>
<Update label="2026-06-22" description="OpenCode plugin v0.1.3">
**New Features:**
- **File-context injection:** Before a file read, the plugin searches for memories referencing that path and injects prior work as system context.
- **Structured compaction summaries:** Session compaction stores `session_summary` memories with `infer=True`.
- **Recent activity timeline:** Initial memory loading shows typed memories with age labels instead of bare text.
- **PostHog telemetry:** Anonymous plugin telemetry uses the shared `plugin.*` schema and never sends memory content, prompts, or API keys.
</Update>
<Update label="2026-06-22" description="OpenCode plugin v0.1.2">
**New Features:**
- **Automatic coding categories:** Sets up 17 coding categories at startup, idempotently and in the background.
- **Global search mode:** Adds `global_search` support across initial load, per-message recall, resume detection, error lookup, and compaction context.
- **Global search env:** Exports `MEM0_GLOBAL_SEARCH` to child shells via the `shell.env` hook.
**Changes:**
- Search filters now follow the `global_search` setting instead of always using project-scoped filters.
- Resume and error-pattern searches broadened by removing narrow metadata type filters.
</Update>
<Update label="2026-06-22" description="OpenCode plugin v0.1.1">
**Changes:**
- Renamed the package to `@mem0/opencode-plugin` ([#5272](https://github.com/mem0ai/mem0/pull/5272)).
- Added the plugin array to the bundled `opencode.json` ([#5271](https://github.com/mem0ai/mem0/pull/5271)).
- Fixed `tsconfig`, added `publishConfig` and the bun lockfile ([#5273](https://github.com/mem0ai/mem0/pull/5273)).
- Validated the CI/CD publish flow ([#5288](https://github.com/mem0ai/mem0/pull/5288)).
</Update>
<Update label="2026-04-02" description="OpenCode plugin v0.1.0">
**Initial Release:**
- **Native OpenCode plugin:** Added `@mem0/opencode-plugin` with TypeScript hooks for chat messages, tool execution, system-message transforms, session compaction, and shell env injection.
- **Memory tooling:** Added add, search, update, delete, delete-all, entity tools, session-start memory loading, per-prompt semantic search, error-pattern lookup, auto-capture, and compaction capture.
- **Skills and commands:** Bundled 16 OpenCode-native Mem0 skills and slash commands.
- **Safety:** Blocks `MEMORY.md` writes and redacts secrets before memory storage.
</Update>
</Tab>
<Tab title="Antigravity">
<Update label="2026-06-25" description="Antigravity plugin v0.1.3">
**Fixes:**
- **Readable session metadata:** Stop-hook session summaries now store `files_touched` as a real list instead of a double-encoded JSON string, so returned memories show clean file paths.
**Improvements:**
- **Reranked injected context:** File-context, bash-error lookup, and session-resume recall now rerank by default for higher-quality automatic context. Disable with `MEM0_RERANK=0`, `false`, `no`, or `off`.
</Update>
<Update label="2026-06-25" description="Antigravity plugin v0.1.2">
**Fixes:**
- **Telemetry attribution:** Antigravity is now reported as `antigravity` instead of being counted as Claude Code.
- **Per-editor version reporting:** Telemetry reads Antigravity's own `plugin.json`, so events report the Antigravity plugin version instead of the Claude plugin version.
**New Features:**
- **Platform override support:** Shared scripts honor `MEM0_PLATFORM` when an editor needs to pin its telemetry platform explicitly.
</Update>
<Update label="2026-04-02" description="Antigravity plugin v0.1.0">
**Initial Release:**
- **Self-contained plugin:** Added Antigravity plugin packaging with `plugin.json`, `mcp_config.json`, `hooks.json`, lifecycle hooks, shared scripts, and shared Mem0 skills.
- **AGENTS.md support:** Uses Antigravity's `contextFileName: "AGENTS.md"` convention.
- **Shared memory layer:** Reuses the Mem0 Platform MCP server, shared hook scripts, and 16 slash-command skills.
- **Lifecycle hooks:** Wires session start, user prompt, file read, memory-tool metadata enforcement, bash output, post-tool tracking, and stop summaries.
- **Install options:** Supports `degit` installs into `~/.gemini/config/plugins/mem0` and local Antigravity plugin installs.
- **Codex parity:** Added missing Codex Write/Edit/MultiEdit blocking and pre-compaction hooks during the shared-plugin restructure.
</Update>
</Tab>
<Tab title="OpenClaw">
<Update label="2026-06-12" description="openclaw-mem0 v1.0.13">
**Fixes:**
- **Custom categories payload:** `customCategories` is converted into the list shape expected by the Mem0 SDK before add calls ([#5345](https://github.com/mem0ai/mem0/pull/5345)).
- **Metadata registration:** `register()` exits early in `cli-metadata` mode, avoiding backend initialization and hook installation during OpenClaw metadata scans ([#5383](https://github.com/mem0ai/mem0/pull/5383)).
**Security:**
- Bumped `mem0ai` to `3.0.7` and added a `uuid` override to resolve known dependency advisories ([#5460](https://github.com/mem0ai/mem0/pull/5460), [#5489](https://github.com/mem0ai/mem0/pull/5489)).
**Improvements:**
- **Repo consolidation:** OpenClaw moved to `integrations/openclaw/`; npm provenance now points to the correct subdirectory ([#5491](https://github.com/mem0ai/mem0/pull/5491)).
</Update>
<Update label="2026-06-02" description="openclaw-mem0 v1.0.12">
**Docs:**
- **Agent Mode onboarding:** README documents `mem0 init --agent --json` for autonomous setup without email, OTP, or browser.
**Security:**
- Added overrides for `langsmith`, `picomatch`, `vite`, and `@qdrant/js-client-rest`.
**Dependencies:**
- Bumped `mem0ai` to `3.0.3` and refreshed Vitest coverage tooling.
</Update>
<Update label="2026-04-29" description="openclaw-mem0 v1.0.11">
**New Features:**
- **Skills-mode auto-setup:** Onboarding enables triage, recall, dream consolidation, and full tool profile automatically.
- **Memory runtime capability:** Exposes `runtime.getMemorySearchManager()` and `resolveMemoryBackendConfig()`.
- **Dimension-aware collections:** OSS wizard creates a new collection when embedder dimensions change.
- **Tool docs in skills:** Memory triage and dream skills now include full tool reference sections.
**Improvements:**
- Auto-capture and auto-recall default to enabled.
- Skills prefer `memory_update` over delete+add for atomic edits.
- Default search threshold lowered to `0.1` for broader recall.
- Config writes preserve OpenClaw gateway `plugins` state.
</Update>
<Update label="2026-04-23" description="openclaw-mem0 v1.0.10">
**Security:**
- Telemetry identity now uses SHA-256 hashes instead of MD5, and user email is hashed before telemetry submission.
**Fixes:**
- Version-pinned installs are rewritten to updatable specs.
- `searchThreshold` is standardized across docs, README, and manifest.
- `PLUGIN_VERSION` is injected at build time from `package.json`.
**Manifest Compliance:**
- Removed non-spec manifest fields and moved endpoint declarations to spec-compliant `providerEndpoints`.
</Update>
<Update label="2026-04-22" description="openclaw-mem0 v1.0.9">
**Security & Compliance:**
- **Manifest security metadata:** Added required env var declarations, sensitive config schema fields, data locations, privacy notes, and external endpoint declarations for platform and OSS modes.
- **Static-analysis cleanup:** Tests now use `vi.stubEnv` / `vi.unstubAllEnvs` instead of direct environment access in places flagged by plugin scanning.
**Tests:**
- Expanded coverage to 421 tests across 15 files.
</Update>
<Update label="2026-04-21" description="openclaw-mem0 v1.0.8">
**New Features:**
- **OSS onboarding wizard:** Guided setup for LLM provider, embedding provider, vector store, and user ID.
- **Agent-friendly CLI:** `--json` added to all 16 CLI commands.
- **Non-interactive OSS setup:** Added `--mode open-source` with `--oss-llm`, `--oss-embedder`, and `--oss-vector`.
- **JSON helpers:** Added structured `jsonOut`, `jsonErr`, and `redactSecrets` helpers.
</Update>
<Update label="2026-04-20" description="openclaw-mem0 v1.0.7">
**New Features:**
- **Chat-based setup:** Users can configure the Mem0 platform connection inside OpenClaw chat instead of editing config files manually.
**Improvements:**
- **V3 SDK compatibility:** Bumped the `mem0ai` dependency to `3.0.1` for Mem0 v3 API support.
- **Config cleanup:** Removed deprecated `orgId`, `projectId`, and `enableGraph` setup paths from docs and CLI prompts.
- **Noise filtering:** Expanded memory-add filtering and improved JSON extraction when model output includes leading text.
</Update>
<Update label="2026-04-11" description="openclaw-mem0 v1.0.6">
**Fixes:**
- **Telemetry identity:** Anonymous users now get a persistent per-machine hash instead of the shared `anonymous-openclaw` fallback.
- **Telemetry stitching:** First authenticated runs emit `$identify` so anonymous history can attach to the authenticated profile.
- **CLI event flushing:** Short-lived CLI invocations flush queued telemetry before exit.
- **Email resolution:** API-key-only users resolve email lazily through `/v1/ping/`.
**Improvements:**
- **OpenClaw source tag:** Provider calls now send `source: "OPENCLAW"` across add, search, list, recall, CLI, and OSS backend paths.
</Update>
<Update label="2026-04-07" description="openclaw-mem0 v1.0.5">
**Fixes:**
- **Init menu selection:** `openclaw mem0 init` number choices now select the intended option.
- **OSS pgvector recovery:** Warmup errors now reset initialization so failed pgvector clients do not cascade into repeated `client.connect()` failures.
**Removed:**
- Removed `orgId`, `projectId`, and `enableGraph` from config, CLI, providers, backend, and tools because API keys are project-scoped and graph memory moved to platform-level configuration.
</Update>
<Update label="2026-04-04" description="openclaw-mem0 v1.0.4">
**OpenClaw Plugin: Production-Ready**
- **Interactive init flow:** `openclaw mem0 init` supports email verification and direct API key setup.
- **Unified tools:** `memory_add` and `memory_delete` replace legacy memory tools and match Mem0 naming.
- **CLI commands:** Added `init`, `status`, `config`, `import`, `event list`, and `event status`.
- **Modular architecture:** Extracted tools, CLI, filesystem safety, and backend modules.
- **Security and tests:** Added path traversal protection, pinned dependencies, and 329 tests across 10 files.
</Update>
<Update label="2026-04-03" description="openclaw-mem0 v1.0.3">
**Fixes:**
- **Path traversal protection:** Added `safePath()` containment checks for skill and domain-overlay reads.
- **Noise filter correction:** Restored the `Post-Compaction` pattern after an incorrect rename.
**Security:**
- Pinned `mem0ai` to exact `2.3.0`.
</Update>
<Update label="2026-04-02" description="openclaw-mem0 v1.0.2">
**Fixes:**
- **Env resolution:** Removed plugin-side env-var expansion from config because OpenClaw already resolves env references before plugin registration.
</Update>
<Update label="2026-04-02" description="openclaw-mem0 v1.0.1">
**New Features:**
- **CD workflow:** Added trusted-publishing release workflow.
- **Plugin metadata:** Added compatibility and build metadata to `package.json`.
- **License:** Added Apache-2.0 license file.
**Fixes:**
- **Dream gate:** Fixed cheap-first ordering, session isolation, and completion verification.
- **Graceful startup:** Plugin starts cleanly when no API key is configured.
</Update>
<Update label="2026-04-01" description="openclaw-mem0 v1.0.0">
**New Features:**
- **Skills-based memory architecture:** Added the skill loader, memory triage skill, memory dream skill, batched extraction, and skill-aware recall.
- **Dream gate:** Added idle-period memory consolidation.
- **Enhanced recall:** Added `recall.ts` with improved retrieval and injection logic.
- **Plugin manifest:** Added `openclaw.plugin.json` and setup helper scripts.
</Update>
<Update label="2026-03-26" description="openclaw-mem0 v0.4.1">
**New Features:**
- **Extraction quality:** Improved noise filtering, deduplication, and extraction instructions.
**Fixes:**
- Improved credential, API key, and secret detection during extraction.
- Prevented standalone timestamps from being stored as memories.
</Update>
<Update label="2026-03-16" description="openclaw-mem0 v0.4.0">
**New Features:**
- **Trigger filtering:** Skips recall and capture for cron, heartbeat, automation, and schedule triggers.
- **Subagent isolation:** Routes ephemeral subagent sessions back to the parent namespace.
- **Dynamic recall thresholding:** Drops candidates below 50% of the top score.
- **OSS resilience:** Adds SQLite init retry and `oss.disableHistory`.
**Fixes:**
- Lifecycle hooks now use `ctx.sessionKey` directly, removing a concurrent-session race.
</Update>
<Update label="2026-03-12" description="openclaw-mem0 v0.3.1">
**New Features:**
- **Message filtering pipeline:** Multi-stage noise removal before extraction.
- **Broad recall:** Short or new-session prompts trigger secondary broad search.
- **Temporal anchoring:** Extraction instructions include the current date.
**Changes:**
- Extraction now reads the last 20 messages and the monolithic plugin file was split into focused modules.
</Update>
<Update label="2026-03-10" description="openclaw-mem0 v0.3.0">
**Fixes:**
- Updated `mem0ai` for the SQLite to `better-sqlite3` migration.
</Update>
<Update label="2026-03-09" description="openclaw-mem0 v0.2.0">
**New Features:**
- **Multi-agent isolation:** Added per-agent memory isolation via `agentId`.
- **Docs:** Added guidance for understanding `userId`.
**Fixes:**
- Migrated platform search to the Mem0 v2 API.
</Update>
<Update label="2026-02-19" description="openclaw-mem0 v0.1.2">
**New Features:**
- Added a source field for OpenClaw memory entries.
**Fixes:**
- Fixed auto-recall injection and auto-capture message drops.
</Update>
<Update label="2026-02-02" description="openclaw-mem0 v0.1.0">
**Initial Release:**
- **Memory backend:** Added Mem0 Cloud and self-hosted OSS modes for OpenClaw.
- **Auto-recall:** Injects relevant memories before each turn.
- **Auto-capture:** Stores facts after each turn.
- **Config:** Added `topK`, `threshold`, and `apiVersion` options.
</Update>
</Tab>
<Tab title="Pi Agent">
<Update label="2026-06-12" description="Pi Agent plugin v0.1.2">
**Fixes:**
- **Visible command feedback:** `/mem0-remember`, `/mem0-forget`, `/mem0-pin`, and `/mem0-scope` now render persistent message blocks instead of easy-to-miss status notifications.
- **Relevance-filtered search:** Search, forget, and pin commands now pass `threshold`, `top_k`, and `rerank` to avoid weak unrelated matches.
**Improvements:**
- **Richer command output:** Commands show scope, query, match counts, and affected memories.
- **Cleaner dream flow:** `/mem0-dream` keeps the consolidation protocol hidden behind a concise status line.
- **Configurable relevance floor:** `searchThreshold` defaults to `0.3` in `mem0-config.json` and is shown in `/mem0-status`.
</Update>
<Update label="2026-06-10" description="Pi Agent plugin v0.1.1">
**Chores:**
- Version bump to validate the new `pi-agent-plugin-checks.yml` and `pi-agent-plugin-cd.yml` release pipeline.
</Update>
<Update label="2026-06-09" description="Pi Agent plugin v0.1.0">
**Initial Release:**
- **Extension entry point:** Registers the `mem0_memory` tool, 8 slash commands, and auto-capture hooks.
- **Agent tool:** Supports search, add, get-all, delete, and delete-all with scoped filters.
- **Slash commands:** Adds `/mem0-remember`, `/mem0-forget`, `/mem0-search`, `/mem0-tour`, `/mem0-dream`, `/mem0-pin`, `/mem0-scope`, and `/mem0-status`.
- **Auto-capture:** Extracts and stores memories from user and assistant messages on `agent_end`.
- **Dream consolidation:** Merges duplicates, resolves contradictions, and prunes stale entries behind session, time, and memory-count gates.
- **System prompt injection:** Appends `MEMORY_POLICY` before every agent turn.
- **Project scoping:** Uses `git rev-parse --show-toplevel` for stable `app_id` values across monorepos.
- **Scopes and categories:** Supports project, session, and global scopes plus 10 default memory categories.
- **Agent skills:** Bundles `context-loader`, `remember`, `search`, `forget`, `dream`, `tour`, `pin`, and `status` skills.
- **Safety:** Confirmation dialogs protect destructive commands, pins preserve memory IDs, full memory UUIDs stay visible, outputs are truncated, all tool actions respect `AbortSignal`, and shutdown releases dream locks.
- **Telemetry:** Batched PostHog telemetry uses PII-safe error payloads.
</Update>
</Tab>
<Tab title="Vercel AI SDK">
<Update label="2026-06-10" description="Vercel AI SDK v3.0.0">
**Major Release**: Migrated to Vercel AI SDK v6 (`LanguageModelV3` / `ProviderV3`) and Mem0 v3 API.
@@ -1726,6 +2375,10 @@ A full-featured command-line interface for Mem0, available in both Python and No
**New Features:**
- **V3 provider contract:** `specificationVersion: 'v3'`, `supportedUrls` property, V3 content array in `doGenerate`, V3 stream lifecycle events in `doStream` ([#4741](https://github.com/mem0ai/mem0/pull/4741))
- **Mem0 source in responses:** Memories are attached as a `source` in `generateText`/`streamText` responses with `providerMetadata.mem0.memories` for programmatic access ([#4741](https://github.com/mem0ai/mem0/pull/4741))
- **Raw search helper:** `searchMemories()` is exported alongside `addMemories()`, `retrieveMemories()`, and `getMemories()` for callers that need raw semantic search results.
- **Self-hosted API support:** `mem0ApiKey` and `host` can be passed per request, letting apps override the environment API key and point at a custom Mem0 API base URL.
- **Provider coverage:** Built-in provider selection covers OpenAI, Anthropic, Google/Gemini, Groq, and Cohere through the AI SDK provider packages.
- **Multimodal memory input:** File, image, Markdown, and PDF prompt parts are converted into the Mem0-compatible message shape when adding or searching memories.
**Bug Fixes:**
- **Async memory storage:** `addMemories` is now properly `await`ed: memories no longer silently fail to store ([#4741](https://github.com/mem0ai/mem0/pull/4741))
@@ -1743,21 +2396,6 @@ A full-featured command-line interface for Mem0, available in both Python and No
</Update>
<Update label="2026-04-02" description="mem0-plugin v1.0.0">
**Mem0 Plugin for Claude Code, Cursor, and Codex**
The unified Mem0 plugin for AI development environments:
- **9 MCP memory tools:** `add_memory`, `search_memories`, `get_memories`, `get_memory`, `update_memory`, `delete_memory`, `delete_all_memories`, `delete_entities`, `list_entities`: all via `mcp.mem0.ai`
- **Lifecycle hooks:** Automatic memory capture at session start, context compaction, task completion, and session end
- **Cloud MCP server:** Managed endpoint replaces local MCP and Smithery setup
- **Streamable HTTP transport:** New MCP transport protocol for real-time streaming
- **Codex-specific skill:** Dedicated skill in `mem0-plugin/skills/mem0-codex` for Codex workflows
- **Supported editors:** Claude Code, Claude Cowork, Cursor, Codex
</Update>
<Update label="2025-12-26" description="Vercel AI SDK v2.0.5">
**Bug Fix:**
- Removed unnecessary dependencies to make the package lighter.
@@ -1805,6 +2443,9 @@ The unified Mem0 plugin for AI development environments:
- Added support for graph memories.
</Update>
</Tab>
</Tabs>
</Tab>
</Tabs>
+5 -16
View File
@@ -135,20 +135,6 @@
}
]
},
{
"tab": "OpenClaw",
"groups": [
{
"group": "Agent Harness",
"icon": "robot",
"pages": [
"integrations/openclaw",
"integrations/hermes",
"integrations/pi-agent"
]
}
]
},
{
"tab": "Open Source",
"groups": [
@@ -574,8 +560,7 @@
"pages": [
"changelog/highlights",
"changelog/sdk",
"changelog/platform",
"changelog/openclaw"
"changelog/platform"
]
}
]
@@ -629,6 +614,10 @@
]
},
"redirects": [
{
"source": "/changelog/openclaw",
"destination": "/changelog/sdk"
},
{
"source": "/components/rerankers/models/llm",
"destination": "/components/rerankers/models/llm_reranker"
@@ -1,78 +0,0 @@
# Changelog
All notable changes to the `@mem0/opencode-plugin` will be documented in this file.
## 0.2.0 — Native SDK tools, MCP-free, leaner skill set
### Changed (breaking)
- **Memory tools are now native OpenCode tools** registered via the `@opencode-ai/plugin` `tool()` helper and backed by the `mem0ai` SDK directly. The plugin no longer registers or depends on the remote MCP server (`mcp.mem0.ai`); the bundled `opencode.json` and the regex-based MCP call interception have been removed. Tools: `add_memory`, `search_memories`, `get_memories`, `get_memory`, `update_memory`, `delete_memory`, `delete_all_memories`, `delete_entities`, `list_entities`, plus a `get_event_status` helper for async-write status.
- **Skills load via the `config` hook (`skills.paths`)** instead of being copied into the project's `.opencode/` directory on startup. The `installSkills()` filesystem copy and the `cli.ts` installer (`mem0-opencode` bin) have been removed — install with `opencode plugin @mem0/opencode-plugin`.
- **Trimmed to 9 focused skills** (`context-loader`, `dream`, `forget`, `status`, `search`, `scope`, `pin`, `remember`, `tour`). Removed `import`, `export`, `memory-reviewer`, `mem0` (SDK reference), `list-projects`, `stats`, and `onboard`. The old stateful `switch-project` skill is superseded by the project/session/global scope model and the new `/mem0-scope` skill.
### Added
- **Expanded telemetry to the full shared `plugin.*` schema.** In addition to `plugin.session_start` and `plugin.tool_use`, the plugin now emits `plugin.user_prompt`, `plugin.bash_error`, `plugin.pre_compact`, and `plugin.session_stop`. `tool_use` now fires from inside each native tool. Every event also carries `project_hash` (anonymized `sha256(app_id)`) and `os_version`, matching the editor plugin's `telemetry.py`.
- **Auto-dream — gated automatic memory consolidation** (ported from the pi-agent plugin). When the time (`minHours`, default 24), session-count (`minSessions`, default 5), and memory-count (`minMemories`, default 20) gates all pass, the plugin injects a consolidation protocol so the agent merges duplicates, drops stale/sensitive entries, and rewrites vague ones before answering. A filesystem lock (`~/.mem0/mem0-dream.lock`) prevents concurrent sessions from dreaming at once, and completion resets the gates. Tune via the `dream` block in `~/.mem0/settings.json`; disable with `MEM0_DREAM=false`. Emits `plugin.dream_triggered` / `plugin.dream_completed`.
- **Memory `scope` — per-call parameter and a persistent default.** `search_memories`, `get_memories`, `add_memory`, and `delete_all_memories` accept an optional `scope`: `"project"` (this repo, default), `"session"` (this run, adds `run_id`), or `"global"` (across all the user's projects — `app_id: "*"` for reads, user-wide for writes). The new **`/mem0-scope` skill** views and changes the *default* scope (used when no scope is passed), persisted to `~/.mem0/settings.json` (`default_scope`) and read **fresh on each memory operation** so changes apply immediately — no restart. `add_memory` / `search_memories` / `get_memories` honor the default (an explicit `scope`, `filters`, or `agent_id` still wins; a `project` default preserves prior behavior, including `global_search`).
### Changed
- **`/mem0-status` now reports the active default scope and auto-dream readiness.** It reads `default_scope` from `~/.mem0/settings.json` (falling back to `project`) and shows the auto-dream gate progress (sessions / memories / time vs. thresholds) so it's clear *why* a consolidation hasn't run yet.
### Fixed
- **Skills load in place via `skills.paths` — no copying.** The `config` hook adds the plugin's own `opencode-skills/` directory to OpenCode's `skills.paths`, so OpenCode discovers the skills directly from the linked/installed plugin package (recursive `**/SKILL.md` scan). The `installSkills()` step that copied skills into `~/.config/opencode/skills/` (and the legacy `~/.opencode/skills/`) and its version-marker gating are removed — the plugin no longer writes into those directories or creates `~/.opencode`. The `config` hook still registers the `/mem0-*` slash commands via `config.command`: OpenCode's TUI slash menu is built from `config.command`, and skills on `skills.paths` are available to the agent's skill tool but do not appear as slash commands on their own. Skill dir names are `mem0-<skill>` (matching `^[a-z0-9]+(-[a-z0-9]+)*$`); commands are `/mem0-<skill>`.
- **Robust project-id (`app_id`) detection.** Parsed from the git remote's `owner/repo` — handling https, scp-style ssh, and **custom ssh host aliases** like `git@github.com-work:owner/repo.git` — falling back to the git repo's **root directory name** (not the cwd, which may be a sub-directory or your home dir), then the cwd. Fixes the project showing as your username/home when OpenCode was launched outside the repo root.
- **Auto-dream visibility + robustness.** When auto-dream doesn't fire, the plugin logs the blocking gate (e.g. `auto-dream waiting — memories: 3 < 20`), and `/mem0-status` surfaces the same gate progress. The session-start memory count is parsed defensively (handles both paginated `{count}` and bare-array SDK responses) so the memory gate evaluates correctly.
- **Error-pattern lookup** in `tool.execute.after` no longer issues two identical `mem0.search()` calls; it now performs a single `topK: 6` search.
- Corrected the documented system-prompt hook name from `experimental.chat.system.transform` to the actual `experimental.chat.messages.transform`.
### Safety
- **`delete_all_memories` deliberately ignores the default scope.** Deleting user-wide always requires an explicit `scope="global"`, so raising the default to `global` can never turn a routine cleanup into a cross-project wipe.
## 0.1.3 — File-context injection, session summaries & activity timeline, anonymous telemetry
### Added
- **File-context injection (`tool.execute.before` / Read):** Before the agent reads a file, the plugin searches mem0 for memories referencing that file path and injects prior work as system context. Gates on file size (>= 1,500 bytes). Gives the agent "I've worked on this file before" awareness automatically.
- **Stop hook session summary (`experimental.session.compacting`):** Enhanced session compaction to store a structured `session_summary` memory with `infer=True`, letting the mem0 backend AI extract key facts (request, decisions, learnings, next steps). Previously only stored a raw stats string.
- **SessionStart activity timeline:** The initial memory loading now formats recent memories with type icons (⚖️ decision, 🔴 bug_fix, 🔵 task_learning, etc.) and relative age indicators (2h ago, 1d ago) instead of bare text. Provides a visual "Recent Activity" timeline on first message.
- **PostHog telemetry (`telemetry.ts`):** Anonymous, fire-and-forget usage events. Opt out with `MEM0_TELEMETRY=false`. Only fires when an API key is present; never sends memory content, prompts, or the API key — only an anonymized `sha256(apiKey)[:32]` identity plus event type, platform, and plugin version. Emits the same schema as the Mem0 editor plugin (`plugin.*` events, `source: "plugin"`, `platform: "opencode"`) so OpenCode appears as a `platform` in the shared plugin dashboard. Events: `plugin.session_start` (with memory count) and `plugin.tool_use` (`add` / `search` / `update` / `delete`).
### Changed
- **`experimental.session.compacting` handler:** Now stores `metadata.type=session_summary` with `metadata.source=opencode-stop` instead of `metadata.type=session_state` with `metadata.source=pre-compaction`. Includes a structured prompt that instructs mem0's AI to extract request, decisions, learnings, and next steps.
- **Initial context formatting:** Memories shown on first message now include type icons and age labels for quick scanning.
## 0.1.2 — Automatic coding categories & global search
### Added
- **Auto-configured coding categories:** The plugin now automatically sets up 17 coding categories (e.g. `architecture_decisions`, `api_design`, `security`, `debugging_notes`) on the Mem0 project at startup. Runs in the background on every session start via `autoSetupCategories()`, is fully idempotent, and never blocks initialization. Uses SHA-256 fingerprints of the category list and API key — stored in `~/.mem0/categories_setup.json` — to skip redundant API calls on subsequent sessions.
- **Global search mode (`global_search` setting):** New `global_search` toggle in `~/.mem0/settings.json` (default: `false`). When enabled, all `search_memories` and `get_memories` calls use `{"OR": [{"user_id": "*"}]}` instead of the per-user per-project `AND` filter — returning all memories across all users and all `app_id` scopes. Writes (`add_memory`) still tag with the current `user_id` and `app_id`. Applies to all plugin search paths: initial load, per-message recall, resume detection, error-pattern lookup, and compaction context.
- **`/mem0:switch-project --global` / `--no-global`:** Enables or disables global search via the switch-project skill. Persists to `~/.mem0/settings.json`. No manual config editing needed.
- **`MEM0_GLOBAL_SEARCH` environment variable:** Exported to child shells via the `shell.env` hook (`"true"` or `"false"`).
### Changed
- **Search filters are now dynamic:** All search paths throughout the plugin construct filters based on the `global_search` setting instead of always using `AND [user_id, app_id]`.
- **Resume-context searches broadened:** Resume and error-pattern searches no longer include `metadata.type` sub-filters (`session_state`, `decision`, `anti_pattern`, `bug_fix`), broadening recall.
- **System context message updated:** Informs the model when global search is active (`"Global search is ON — searches return all memories across all users and projects. Writes still use user_id=..., app_id=..."`).
- **`/mem0:onboard` Step 5 is no longer interactive:** Removed the manual category installation prompt. Categories now configure automatically in the background; the onboarding step only verifies status and stores a fallback `project_profile` memory if the background run hasn't finished yet.
- **`/mem0:switch-project` skill expanded:** Description and execution updated to document the `--global` and `--no-global` flags alongside the existing project-name argument.
## 0.1.1
- CI/CD publish flow test (`#5288`).
- Fixed tsconfig, added `publishConfig` and bun lockfile (`#5273`).
- Renamed package to `@mem0/opencode-plugin` (`#5272`).
- Added plugin array to bundled `opencode.json` (`#5271`).
## 0.1.0 — Initial release
- **OpenCode plugin** (`@mem0/opencode-plugin` on npm): Pure TypeScript plugin using the `mem0ai` TS SDK — no Python, no shell scripts. Hooks into all 6 OpenCode events (`chat.message`, `tool.execute.before`, `tool.execute.after`, `experimental.chat.system.transform`, `experimental.session.compacting`, `shell.env`). Features: session start memory loading, per-prompt semantic search, error pattern detection with memory lookup, resume/remember intent detection, auto-capture every 3rd message, periodic save nudges, full metadata defaults injection (confidence, source, type, session_id, files, branch), identity injection for search/get/delete filters, type-filtered error pre-fetch (anti_pattern + bug_fix), pre-compaction memory capture, MEMORY.md write blocking, and secret redaction.
- **16 OpenCode-native skills** bundled in `opencode-skills/`: `context-loader`, `dream`, `export`, `forget`, `health`, `import`, `list-projects`, `mem0` (SDK reference), `memory-reviewer`, `onboard`, `peek`, `pin`, `remember`, `stats`, `switch-project`, `tour`. All skills are pure MCP-tool-based — no Python scripts, no shell scripts, no Claude Code dependencies.
- **Auto-install skills and commands (`installSkills()`):** On plugin load, copies all 16 skills to `.opencode/skills/` and creates command wrapper files in `.opencode/commands/` so they appear in the OpenCode `/` palette.
- **CLI installer (`cli.ts`):** `bunx @mem0/opencode-plugin install` auto-configures plugin and MCP server in `~/.config/opencode/opencode.json`.
-397
View File
@@ -1,397 +0,0 @@
# Changelog
All notable changes to the Mem0 plugin will be documented in this file.
## 0.2.11 — Session-summary metadata fix + rerank auto-injected context by default
> Versions: Claude Code / Cursor / Codex `0.2.11`; Antigravity `0.1.3`. All four editors share `scripts/`, so the fix below applies to every editor.
### Fixed
- **`files_touched` was double-JSON-encoded in session summaries (`scripts/capture_session_summary.py`):** the Stop-hook summary set `metadata["files_touched"] = json.dumps(files[:20])` — a pre-serialized JSON string — and then serialized the whole request body again with `json.dumps(body)`. The stored memory therefore carried an escaped string blob (`"[\"mem0/memory/main.py\", \"src/client/index.ts\"]"`) instead of a real array, so file paths surfaced as backslash- and slash-heavy escaped text when those memories were returned by `search_memories`/`get_memories` and shown in Claude Code, Cursor, Codex, and Antigravity. The fix stores the list directly (`metadata["files_touched"] = files[:20]`) so the body is encoded exactly once. New `tests/test_capture_session_summary.py` asserts the posted body contains a JSON array and no escaped-string artifact.
### Changed
- **Auto-injected memory context is now reranked by default (`scripts/_search.py`, `scripts/file_context.py`, `scripts/on_bash_output.sh`, `scripts/on_user_prompt.sh`):** the REST search endpoint does not rerank when `rerank` is omitted, so hook-injected context (file-context, bash-error lookup, session-resume prefetch) was ordered by raw vector similarity and the single most relevant memory could fall outside the injected `top_k` window. A new `should_rerank()` helper turns reranking on for every auto-injection path; the extra ~150–200 ms stays within the hook's curl budget. Opt out with `MEM0_RERANK=0` (also accepts `false`/`no`/`off`). (#5690)
## 0.2.10 — Accurate per-editor telemetry attribution
### Fixed
- **Antigravity counted as Claude Code:** `detect_platform()` (`scripts/telemetry.py`) now checks `ANTIGRAVITY_PLUGIN_ROOT` before the `CLAUDE_PLUGIN_ROOT` branch. Antigravity sets both env vars for compatibility, so every Antigravity session was previously attributed to `claude-code`. Telemetry now reports `platform: "antigravity"`.
- **Codex fell back to the generic `plugin` bucket:** Codex installs standalone hooks with absolute paths via `install_codex_hooks.py`, so `PLUGIN_ROOT` is never set at runtime and platform auto-detection failed. Each command in `hooks/codex-hooks.json` now pins `MEM0_PLATFORM=codex` inline (Codex runs hook commands through a shell). Telemetry now reports `platform: "codex"`.
- **Cursor attribution depended on the host env:** Cursor's `*_cursor.sh` wrappers delegate to the shared hook scripts, whose platform detection relied on Cursor exporting `CURSOR_PLUGIN_ROOT` to the subprocess. All five Cursor wrappers now `export MEM0_PLATFORM=cursor` before delegating.
- **`plugin_version` was identical for every editor:** telemetry read `.claude-plugin/plugin.json` for all bash-hook editors, so Antigravity reported `0.2.10` instead of its real `0.1.2`. `_load_plugin_version()` now reads the manifest matching the detected platform, so each editor reports its own version.
### Added
- **`MEM0_PLATFORM` override in `detect_platform()`:** An explicit platform marker that wins over env-var auto-detection, letting each editor label its telemetry reliably. New tests in `tests/test_telemetry.py` cover the override, Antigravity attribution, and the Cursor/Codex platform-pinning contracts.
> Attribution fixes apply to telemetry emitted after users upgrade to this version; PostHog does not backfill past events.
## 0.2.9 — File-context injection, session summaries & activity timeline
### Added
- **File-context injection (`PreToolUse/Read` hook):** Before Claude reads a file, the new `on_file_read.sh` hook searches mem0 for memories that reference that file path and injects a compact timeline of prior work as `additionalContext`. Gives Claude "I've seen this file before and here's what I remember" context automatically. Gates on file size (>= 1,500 bytes), 5-second hard timeout, silent skip on any failure. Applies to Claude Code, Codex, and Cursor (`on_file_read_cursor.sh`).
- **Stop hook session summary (`on_stop.sh`):** On session end, parses the transcript JSONL, extracts the last assistant message and files touched, builds a structured prompt, and stores it via the mem0 API with `infer=True` — letting the platform's backend AI extract structured facts (request, decisions, learnings, next steps). Memories are stored as `metadata.type=session_summary` with 90-day expiry. Guards: skips subagent sessions (`agent_id` present), dedup via marker file, always exits 0. Applies to Claude Code, Codex, and Cursor (`on_stop_cursor.sh`).
- **SessionStart activity timeline (`session_timeline.py`):** On startup (when project has existing memories), fetches the 10 most recent memories and renders a compact timeline with type icons, age indicators, and short text below the existing banner. Shows recent decisions, bug fixes, and session summaries at a glance. 5-second timeout — if the API is slow, the timeline silently skips while the banner still displays.
- **`scripts/file_context.py`:** Core Python module for file-context injection. Searches mem0 cloud API with both relative and absolute file paths, deduplicates results, formats as compact timeline with type icons and memory age.
- **`scripts/capture_session_summary.py`:** Core Python module for Stop hook. Reads transcript JSONL (tail 3,000 lines), extracts last assistant message, extracts file paths from tool_input fields, strips system tags and `<private>` blocks, stores via mem0 API.
- **`scripts/session_timeline.py`:** Core Python module for SessionStart timeline. Fetches recent memories from mem0 API, formats with type icons, relative age, and short text.
### Changed
- **`on_session_start.sh`:** On startup (when memories > 0), calls `session_timeline.py` to inject a compact recent activity timeline below the existing banner and rubric instructions.
- **`hooks/hooks.json`:** Added `PreToolUse` matcher for `Read` (5s timeout) and `Stop` hook (30s timeout).
- **`hooks/codex-hooks.json`:** Added `PreToolUse` matcher for `Read` (5s timeout) and `Stop` hook (30s timeout).
- **`hooks/cursor-hooks.json`:** Added `preToolUse` matcher for `Read` (5s timeout) and `stop` hook (30s timeout).
## 0.2.8 — Automatic coding categories & global search
### Added
- **Global search mode (`global_search` setting):** New `global_search` toggle in `~/.mem0/settings.json` (default: `false`). When enabled, `search_memories` and `get_memories` calls use `{"OR": [{"user_id": "*"}]}` instead of the per-user per-project `AND` filter — returning all memories across all users and all `app_id` scopes in the platform project. Writes (`add_memory`) still tag with the current `user_id` and `app_id`. Solves the team-shared-memory use case where multiple team members need access to all memories regardless of which repo or user created them. Works on Claude Code, Cursor, and Codex.
- **`/mem0:switch-project --global` / `--no-global`:** Enables or disables global search via the switch-project skill. Persists to `~/.mem0/settings.json`. No manual config editing needed.
- **Session banner scope indicator:** Banner shows `scope=global` when global search is active instead of `project=<app_id>`.
- **Global-aware memory count:** Session start memory count query uses the global filter when `global_search` is enabled.
- **Background coding-category setup (`scripts/auto_setup_categories.py`):** The coding-focused category taxonomy (17 categories tuned for development work) is now installed automatically in the background on session start — the same way `auto_import.py` imports `CLAUDE.md`/`AGENTS.md`. Users are no longer asked to configure it during onboarding. Mirrors the auto-import design: resolves the API key, holds a lock file (`~/.mem0/categories_setup.lock`), reuses the proven `setup_coding_categories.py` taxonomy + `project.update` path via the plugin venv, logs to stderr only, and always exits 0 so it can never block a session.
- **Per-account state gating (`~/.mem0/categories_setup.json`):** Keyed by a hash of the API key → a hash of the taxonomy. Categories are scoped to the mem0 project tied to the API key (not the local repo), so setup runs once per account and skips all network calls thereafter — re-applying only if the taxonomy itself changes.
- **`tests/test_auto_setup_categories.py`:** Covers fingerprint determinism/sensitivity, state-file load/save/gating, and idempotent apply via an injected fake client (no SDK, no network).
### Changed
- **`on_session_start.sh`:** Spawns `auto_setup_categories.py` in the background on `startup` (alongside `auto_import.py`), preferring the venv python so the SDK is available. Covers Claude Code, Cursor, and Codex, which all route SessionStart through this script.
- **`/mem0:onboard` Step 5 is no longer interactive:** Removed the `Install coding categories? [Y/n]` prompt. Categories now configure automatically in the background; the onboarding step only verifies status and applies them if the background run hasn't finished yet — mirroring how Step 4 (project-file import) already works.
- **Session-start "new project" hint** now notes that coding categories install automatically in the background.
## 0.1.0 — Antigravity
### Added
- **Antigravity plugin** (`.antigravity/`): Restructured to follow the same shared-infrastructure pattern as Claude Code, Cursor, and Codex. Self-contained plugin directory with `plugin.json`, `mcp_config.json`, `hooks/hooks.json` (own file), `scripts/` (symlink → `../scripts/`), and `skills/` (symlink → `../skills/`). Installable via `agy plugin install .antigravity` or `npx degit mem0ai/mem0/mem0-plugin/.antigravity ~/.gemini/config/plugins/mem0`. Uses `contextFileName: "AGENTS.md"` per Antigravity convention.
- **Codex hooks parity:** Added missing `PreToolUse` Write/Edit/MultiEdit block and `PreCompact` hook to Codex hooks config, bringing it to full parity with Claude Code.
### Changed
- **Antigravity plugin directory:** Renamed `.antigravity-plugin/` → `.antigravity/` to match the naming convention of `.claude-plugin/`, `.cursor-plugin/`, `.codex-plugin/`. Plugin is now self-contained so `agy plugin install` and `npx degit` both work.
- **Antigravity hooks:** Hooks now live directly in `.antigravity/hooks/hooks.json` as a standalone file — no indirection.
- **Antigravity install command:** Updated from `npx degit mem0ai/mem0/mem0-plugin` to `npx degit mem0ai/mem0/mem0-plugin/.antigravity`. Added `agy plugin install` as alternative for local clones.
### Removed
- **Stale root-level files:** Deleted `mem0-plugin/hooks.json`, `mem0-plugin/mcp_config.json`, `mem0-plugin/plugin.json` — leftover artifacts from before plugin restructuring into per-editor subdirectories. Nothing referenced them; install commands point to `.antigravity/`.
## 0.2.7
### Fixed
- **First-install auth failure (closes #4876):** Removed `authorizationUrl` from `.mcp.json`. When both a static `Authorization` header and `authorizationUrl` were present, Claude Code preferred the OAuth flow, which failed on reconnect — leaving new users stuck with only `authenticate`/`complete_authentication` stub tools. Authentication now uses the `MEM0_API_KEY` header exclusively; no browser OAuth flow is triggered.
- **Onboarding skill removed OAuth step:** `/mem0:onboard` Step 2 no longer guides users through a browser-based OAuth login. The MCP server authenticates via the API key set in Step 1.
- **Removed `claude plugin configure mem0` references:** This CLI command does not exist. The `userConfig` mechanism works through the plugin enable UI prompt — Claude Code prompts for the API key when the plugin is first enabled and stores it securely in the system keychain. Updated session start banner, onboarding skill, identity script comments, and manual testing guide.
## 0.2.6
### Fixed
- **Memory count zero / stats and tour showing 0 memories:** The `run_id: "*"` wildcard filter — added in the initial v0.2.6 fix — returns 0 on both the v3 list endpoint (`/v3/memories/`) and search endpoint (`/v3/memories/search/`) when memories were written without a `run_id` (which is all memories since v0.2.6 stopped setting `run_id` on `add_memory`). Removed `run_id: "*"` from: `on_session_start.sh` count queries, `enforce_metadata_defaults.sh` hook injection (was injecting into every `search_memories` and `get_memories` call), `_search.py` search payload, `/mem0:stats` and `/mem0:tour` skill instructions. All read paths now use simple `user_id` + `app_id` filters without `run_id`, matching how v0.2.3 worked.
- **`add_memory` no longer sets `run_id`:** Session tracking moved from top-level `run_id` (which creates a separate API partition) to `metadata.session_id`. New memories land in the default partition and are visible to all queries.
- **`enforce_metadata_defaults.sh` no longer injects `run_id`:** The hook was appending `{"run_id": "*"}` to every `search_memories` and `get_memories` filter, which broke both endpoints. Removed entirely — identity injection (`user_id`/`app_id`) still works.
- **`_search.py` simplified:** Removed `run_id: "*"` from search payload. Uses plain `user_id` + `app_id` filters.
- **`auto_import.py` delete endpoint 404:** Stale chunk deletion used `DELETE /v3/memories/{id}/` which returns 404 (v3 is ADD-only). Changed to `DELETE /v1/memories/{id}/`.
- **Banner count accurate:** `on_session_start.sh` count query uses `user_id` + `app_id` filters without `run_id`. Shows total count only (removed noisy auto-import breakdown).
- **`quickstart.md` wrong add endpoint:** cURL example used `POST /v1/memories/` (v1 add is removed). Fixed to `POST /v3/memories/add/`.
- **Session stats always 0:** PostToolUse hooks never fire for plugin MCP tools (confirmed via debug logs — only SessionStart, UserPromptSubmit, PreToolUse, and Stop fire). Moved session stats tracking (`session_stats.py add/search`) into `enforce_metadata_defaults.sh` (PreToolUse), which does fire on every MCP tool call.
- **Periodic nudge never firing:** Message count file used session UUID in filename (`/tmp/mem0_msg_count_${SESSION_ID}`) which was cleared on session start. Changed to `$USER`-keyed filename, matching the session stats file convention.
- **`/mem0:stats` session query returning 0:** Stats skill attempted API queries with `run_id` and `metadata.session_id` filters that return empty results. Session stats now come exclusively from the local stats file (which is accurate now that PreToolUse tracks adds).
- **Auto-capture stops working mid-session:** After the initial rubric injection (first message), subsequent messages got zero context from the UserPromptSubmit hook. The banner instruction to "proactively store learnings" fades as conversation grows and Claude forgets. Two-pronged fix: (1) **Direct API auto-capture hook** (`auto_capture.py`): every 3rd message, `on_user_prompt.sh` spawns a background Python script that reads the last 3 exchanges from the transcript JSONL and sends them directly to `POST /v3/memories/add/` with `infer=True`. No reliance on Claude calling `add_memory`. (2) **Proportional prompt nudge** as fallback: starting from 3rd message, if Claude has stored fewer than 1 memory per 3 messages, a brief "store learnings via add_memory" directive is injected.
- **Desktop app: API key not found:** Claude Code Desktop does not inherit shell environment variables — only `PATH` is read from shell profiles. Users who set `export MEM0_API_KEY=m0-...` in `~/.zshrc` or `~/.bashrc` got "Setup Required" on Desktop while CLI worked fine. Added grep-based shell profile extraction as a 4th fallback in both `_identity.sh` (bash) and `_identity.py` (Python). Scans `~/.zshrc`, `~/.bashrc`, `~/.zprofile`, `~/.bash_profile`, `~/.profile` for `MEM0_API_KEY=` assignments. Skips variable references (`$OTHER_VAR`), commented-out lines, and strips quotes/inline comments.
- **Desktop app: zero memories added over multi-day usage:** Agent never proactively called `add_memory` — only `search_memories` and `get_all`. Root cause: session banner instruction was passive ("before finishing a session, store learnings") and easily ignored. No mechanism existed to re-prompt the agent mid-session. Fixed with a periodic nudge in `on_user_prompt.sh`: every 5th substantial message, the hook checks `session_stats` for add count; if fewer than 2 memories stored, injects a directive into Claude's context via `additionalContext` telling it to store learnings immediately. Counter resets on session start.
- **Setup Required banner missing Desktop instructions:** Updated no-API-key banner with Desktop-specific setup paths: `claude plugin configure mem0`, Desktop app environment editor (Settings > Environment), and CLI `export` as fallback.
### Removed
- **Stop hook (all 3 editors):** Removed from `hooks.json`, `cursor-hooks.json`, `codex-hooks.json`. Deleted `on_stop.sh`, `on_stop_cursor.sh`, `on_stop_codex.sh`, `stop_hook_check.py`. The Stop hook could not reliably feed context back to Claude (command-type hooks' `reason` field is user-facing only, not injected into Claude's context). Auto-capture handled by PreCompact hook instead.
- **SessionEnd hook:** Removed from `hooks.json`. Deleted `on_session_end.sh`. Redundant with PreCompact auto-capture.
- **5 redundant hook scripts:** `on_git_commit_capture.sh` (fired on every Bash command containing "git"), `on_post_commit.sh` (fired on every Bash command), `on_task_completed.sh`, `on_post_compact.sh`, `on_subagent_stop.sh`. These were already removed from Claude's `hooks.json` in v0.2.5 but script files remained on disk. Also removed `on_post_commit.sh` references from `cursor-hooks.json` and `codex-hooks.json`.
- **Dead settings:** Removed `output_style`, `skip_tools`, `capture_tools` from `load_settings.py` defaults. The `output-styles/` directory and `on_tool_failure.sh` script were already deleted.
- **`test_on_file_read.py`:** Removed test file for deleted `on_file_read.sh` hook.
### Changed
- **`/mem0:stats` lifetime query:** Single `get_memories` call with `user_id` + `app_id` filters (no `run_id`).
- **`/mem0:tour` full fetch:** Single `get_memories` call with `user_id` + `app_id` filters (no `run_id`).
- **API key resolution order (4 fallbacks):** `MEM0_API_KEY` env var > `CLAUDE_PLUGIN_OPTION_API_KEY` (plugin configure) > `CLAUDE_PLUGIN_OPTION_MEM0_API_KEY` (legacy userConfig) > shell profile extraction. Applies to both `_identity.sh` and `_identity.py`.
- **Session start banner:** Proactive memory instruction changed from passive "before finishing a session" to active "proactively store learnings incrementally as work progresses. Do NOT wait until the session ends."
- **Message counter on session start:** `on_session_start.sh` now resets `/tmp/mem0_msg_count_*` files to ensure nudge counter starts fresh each session.
## 0.2.5
### Fixed
- **PostToolUse field name: `tool_output` → `tool_response`:** All three PostToolUse scripts (`on_bash_output.sh`, `on_post_commit.sh`, `on_post_tool_use.sh`) were reading `.tool_output` from stdin JSON — a field that never existed in the Claude Code hooks spec. The correct field is `.tool_response` (confirmed via official docs at code.claude.com/docs/en/hooks). This was silently `null` on every invocation, meaning bash error detection and post-commit checks never actually fired.
- **Stop hook invalid `hookSpecificOutput`:** `on_stop.sh` returned `hookSpecificOutput` with `hookEventName: "Stop"` — but `Stop` is not a valid `hookEventName` discriminant. Claude Code rejected the JSON with "Hook JSON output validation failed". Replaced with spec-compliant `{ decision: "block", reason: "..." }`.
- **SessionStart banner invisible:** Switched from JSON `hookSpecificOutput.additionalContext` (discrete/hidden system reminder) back to raw text `cat <<BANNER` (shown directly in transcript). Per official docs, raw stdout from SessionStart hooks is visible context; `additionalContext` is not.
- **`Write|Edit` matcher missing `MultiEdit`:** `block_memory_write.sh` could be bypassed via `MultiEdit` tool. Matcher now `Write|Edit|MultiEdit`.
- **PreToolUse MCP matcher coverage gap:** `enforce_metadata_defaults.sh` not triggered for `get_memory` or `update_memory`. Added 4 tool name variants.
- **`capture_compact_summary.py` never called:** `on_session_start.sh` compact branch never spawned it. Post-compaction summaries were not stored. Added background spawn.
- **Unguarded variables under `set -u` in `on_session_start.sh`:** Bare `${MEM0_RESOLVED_USER_ID}` etc. without `:-` fallbacks. Script died silently if `_identity.sh` failed to source. All references now use `${VAR:-default}`.
- **`enforce_metadata_defaults.sh` silent failure on jq error:** Final `jq -n --argjson` had no error guard under `set -euo pipefail`. Added `|| true`.
- **Single-quote injection in `on_git_commit_capture.sh`:** Shell variables interpolated via `'$VAR'` inside `python3 -c`. Filenames with `'` broke Python syntax. Replaced with `os.environ.get()`.
- **Identity injection on `add_memory` (`enforce_metadata_defaults.sh`):** Hook now sources `_identity.sh` and injects `user_id` and `app_id` as top-level params when the agent omits them. Prevents orphaned memories with null scoping that were invisible to filtered queries. Root cause of onboarding writes landing with `user_id=null, app_id=null`.
- **Identity injection on `search_memories` and `get_memories`:** Hook now intercepts these tools and injects `user_id`/`app_id` into `filters.AND[]` when missing. Handles three filter states: no filters (creates from scratch), flat filters (converts to AND format), existing AND array (appends missing clauses). Prevents MCP server from auto-injecting wrong identity.
- **Identity injection on `delete_all_memories`:** Hook injects top-level `user_id`/`app_id` to prevent accidental cross-scope deletion.
- **`/mem0:export` incorrect `get_memories` call:** Was passing `user_id`/`app_id` as top-level params; MCP tool only accepts them inside `filters`. Changed to `filters={"AND": [{"user_id": "..."}, {"app_id": "..."}]}`.
- **`/mem0:stats` same `get_memories` issue:** Fixed both lifetime and session stat queries to use `filters` instead of top-level identity params.
- **`/mem0:pin` passes `metadata` to `update_memory`:** MCP `update_memory` tool only accepts `memory_id`, `text`, `source` — no `metadata` param. Pin/unpin now uses `[PINNED]` text prefix marker instead. Also added explicit `user_id`/`app_id` to `add_memory` for new pinned memories.
- **`/mem0:health --deep` ambiguous `get_memories` call:** Clarified identity goes in `filters`, not as top-level params.
- **`/mem0:memory-reviewer` same ambiguity:** Explicit `filters={"AND": [...]}` for `get_memories`.
- **`/mem0:dream` stale artifact:** Removed `(item 15)` from Step 4 heading.
- **`/mem0:dream` contradiction resolution no-op:** `update_memory` on loser with its own text did nothing. Changed to `delete_memory(memory_id=<loser_id>)` to actually remove the losing memory.
- **`/mem0:health` Check 3 `search_memories` top-level `user_id`:** Removed top-level `user_id` param; identity only in `filters.AND[]`. Changed `limit` to `top_k`.
- **`/mem0:health` Check 4 `add_memory` missing `infer=False`:** Health probe wasted LLM tokens on extraction. Added `infer=False`. Also fixed: was expecting `memory_id` in response but v3 returns `event_id`. Now uses `get_event_status` to get memory ID for cleanup.
- **`/mem0:tour` `get_memories` top-level identity:** Both standard and cross-project modes passed `user_id`/`app_id` as top-level params. Moved to `filters.AND[]`.
- **`/mem0:onboard` `search_memories` top-level `user_id`:** Removed extra top-level `user_id` param from connectivity check.
- **`/mem0:context-loader` incomplete filter table:** Filter examples showed only `metadata.type` without `user_id`/`app_id`. Now shows full `AND` filter structure.
- **7 skills used `limit` instead of `top_k` for `search_memories`:** MCP tool param is `top_k`, not `limit`. Fixed in: health, onboard, tour (3 places), switch-project, stats (weekly mode + latency probe).
- **`/mem0:stats` latency probe missing `filters`:** `search_memories` call had no identity filters. Added `user_id`/`app_id` in `filters.AND[]`.
### Added
- **`stop_hook_check.py`:** Pure-stdlib transcript analyzer for the Stop hook. Reads last 500 lines of transcript JSONL, parses tool calls, file modifications, and git commands. Returns `{"should_block": bool, "context": "..."}`. Trivial sessions (< 3 tool calls, no file edits) skip capture entirely.
- **Checklist for `/mem0:dream`:** 6-step progress tracker per Claude skill best practices for complex multi-step workflows.
- **Checklist for `/mem0:onboard`:** 7-step progress tracker for onboarding wizard.
- **Expanded hook matcher (all 3 configs):** `enforce_metadata_defaults.sh` now triggers on `add_memory`, `search_memories`, `get_memories`, `get_memory`, `update_memory`, and `delete_all_memories` (12 tool name variants covering both MCP naming conventions).
### Changed
- **Stop hook uses MCP-driven capture:** When meaningful work detected and no memories stored, returns `decision: "block"` asking Claude to call `add_memory` via MCP. One-shot flag prevents infinite loops. REST API capture runs in background as fallback.
- **SessionStart banner uses raw text stdout:** Replaced JSON `additionalContext` with `cat <<BANNER` for reliable display per official hooks spec.
- **`enforce_metadata_defaults.sh` rewritten:** Handler-based dispatch for 4 tool types. `add_memory` gets top-level identity + metadata defaults. `search_memories`/`get_memories` get filter identity injection. `delete_all_memories` gets top-level identity. Never overrides explicitly-passed identity.
## 0.2.4
### Fixed
- **PostToolUse matcher mismatch (`hooks.json:81`):** Changed from `mcp__mem0__` to `mcp__mem0__|mcp__plugin_mem0_mem0__`. Root cause of session stats recording nothing — 146 consecutive "no memory operations" entries. Unblocks `/mem0:stats` session line, stop-hook report, and `session_stats.py` tracking.
- **File-read hook noise (`on_file_read.sh`):** Replaced bare-filename semantic search with `metadata.files` filter + score threshold (≥ 0.4). Falls back to basename search if metadata filter returns nothing. Eliminates irrelevant context injection on every Read.
- **`/mem0:pin` uses v3-removed `immutable=True`:** Removed Step 3a entirely. Standardized on `metadata.pinned: true` (which `dream/SKILL.md` already respects during pruning). Fixed unconditional `...` appended to short pin confirmations.
- **`/mem0:list-projects` undercounts (implicit null scoping):** Dual-query approach — runs both null-scoped and app-scoped `get_memories` calls, merges by ID. Handles legacy `metadata.project_id` and `metadata.project` fields.
- **`/mem0:peek` free-text search on memory IDs:** Detects bare hex IDs (`^[a-f0-9]{8}$`) and `[mem0:<hex>]` citation refs, routes to `get_memory` direct lookup instead of semantic search.
- **Dead `PostToolUseFailure` hook block:** Removed entirely — this hook event does not exist in Claude Code.
### Added
- **Session ID capture (`on_session_start.sh`):** Extracts `session_id` from Claude Code stdin JSON, persists to `/tmp/mem0_session_id_$USER`. Falls back to timestamp-based ID. Enables `run_id`-based session scoping.
- **`run_id` injection (`enforce_metadata_defaults.sh`):** Reads session ID from temp file, injects as `run_id` into every `add_memory` call. Tags all memories with session identity for entity-scoped filtering.
- **`min_score`, `metadata_filters`, `rerank`, `threshold` params (`_search.py`):** `search_memories()` now accepts `min_score: float` to filter low-relevance results, `metadata_filters: dict` for field-level filtering, `rerank: bool` for managed reranker, and `threshold: float` (default 0.3, up from platform default 0.1) for server-side relevance gating. Existing callers unaffected (new params have defaults).
- **Rerank on tour/peek:** `/mem0:tour` and `/mem0:peek` search calls now pass `rerank=true` for better result ordering (+150–200ms latency, significantly improved precision).
- **`/mem0:stats` session query via `run_id`:** Queries memories by `run_id` filter for API-backed session counts. Cross-checks against local stats file. Shows truncated session ID in output.
### Removed
- **`/mem0:protocol` skill:** Routing table fully superseded by individual skill descriptions (auto-trigger). Operational guidelines (search patterns, metadata rules) covered by `enforce_metadata_defaults.sh` hook and individual skill bodies.
### Changed
- **All 17 skill descriptions:** Rewritten per Claude skill best practices — each now includes what the skill does AND when to trigger it, with specific keywords for auto-discovery. Average length 200–270 chars (under 1024 max). Third person, action verbs.
- **Onboarding auto-trigger (`on_session_start.sh`):** Replaced 3-state marker-file logic with memory-count detection. New project (0 memories) → prompts Claude to invoke `/mem0:onboard`. No marker files, no OAuth state. Simplified no-API-key path to single inactive banner.
## 0.2.3
### Added
- **Read hook (`on_file_read.sh`):** `PreToolUse(Read)` hook that searches mem0 for memories tagged with the file being opened and injects them as context. Skips non-code files, lockfiles, and `node_modules/`. Deduplicates repeated reads within a session.
- **Shared search module (`_search.py`):** Wraps `POST /v3/memories/search/` into a reusable `search_memories()` call with `format_results_for_context()` for consistent `[type] content [mem0:id]` display. Used by all pre-fetch hooks.
- **User settings (`load_settings.py`):** Loads config from `~/.mem0/settings.json` with 9 keys: `auto_save`, `auto_search`, `search_limit`, `retention_session_days`, `confidence_threshold`, `output_style`, `debug`, `skip_tools`, `capture_tools`. Supports `init` subcommand for first-run creation.
- **`/mem0:forget` skill:** Standalone skill for deleting memories by search query or UUID with confirmation. Supports undo-last-N via `session_stats.py peek`.
- **`/mem0:peek` skill:** Compact quick-search with one-liner output. Runs 2 parallel searches (broad + `decision`-filtered), deduplicates by ID.
- **`/mem0:memory-reviewer` skill:** Read-only memory quality audit. Scans for near-duplicates (>60% noun overlap), contradictions, low-confidence entries, untagged memories, and stale entries (>180 days). Refers to `/mem0:dream` for remediation.
- **`/mem0:context-loader` skill:** Pre-fetch agent that runs 2–4 parallel `search_memories` calls across query angles and type filters, deduplicates, outputs up to 10 memories. Silent on empty results.
- **Compact memory output style (`output-styles/compact-memory.md`):** `[<type>] <content, max 80 chars> [mem0:<short_id>]` format used by `peek`, `tour`, and inline search display.
- **`userConfig` in `.claude-plugin/plugin.json`:** `api_key` field (`sensitive: true`) enables key storage via `claude plugin configure mem0`.
- **OAuth support:** `authorizationUrl` added to `.mcp.json` for OAuth flow alongside token-based auth.
- **Tests:** `test_search.py`, `test_rubric_dedup.py`, `test_on_file_read.py`.
### Changed
- **Skills renamed:** All `mem0-*` prefixed skill directories renamed to shorter forms (e.g., `mem0-dream` → `dream`, `mem0-mcp` → `protocol`, `mem0-tour` → `tour`). 12 skills renamed total.
- **Pre-fetch on bash errors:** `on_bash_output.sh` now performs actual `search_memories` calls via `_search.py` instead of emitting search query templates as text.
- **Session-resume pre-fetch:** `on_user_prompt.sh` detects resume phrases ("where did we leave off", "continue from where") and pre-fetches `session_state` + `decision` memories.
- **Remember-intent routing:** `on_user_prompt.sh` detects save phrases ("remember this", "don't forget that") and routes to `/mem0:remember` skill instead of raw `add_memory`.
- **Rubric deduplication:** Search guidance rubric injected only on first user prompt per session via flag file.
- **Namespace-agnostic tool matching:** `on_post_tool_use.sh` and `on_tool_failure.sh` now use wildcard suffix matching (`*__add_memory`) instead of hardcoded `mcp__mem0__` prefix.
- **API key resolution:** `_identity.sh`/`_identity.py` now check `CLAUDE_PLUGIN_OPTION_API_KEY` (from `userConfig`) before legacy `CLAUDE_PLUGIN_OPTION_MEM0_API_KEY`.
- **Session start:** Three-state no-key handling (first run → auto-onboard, OAuth mode → proceed, neither → inactive banner). Banner now shows `auth=api_key|oauth`.
- **Hook timeouts:** `on_user_prompt.sh` and `on_bash_output.sh` raised from 5s to 12s.
- **Compact prompts:** `on_task_completed.sh` and `on_stop.sh` replaced multi-step checklists with single-line directives (0–2 durable facts max).
- **`/mem0:dream`:** Removed `--forget` (now standalone `forget` skill) and `--schedule` flags.
- **`/mem0:health`:** Removed `--fix` auto-fix mode; output condensed to `PASS/FAIL CheckName Detail` one-liners.
- **`/mem0:protocol` (was `mem0-mcp`):** Added 14-entry natural-language-to-skill routing table. _(Removed in 0.2.4 — superseded by skill descriptions.)_
- **CLI config fallback removed:** `_identity.sh`/`_identity.py` no longer read `~/.mem0/config.json`; API key resolution is env-var-only.
- **`auto_import.py`:** Added content-hash deduplication to skip files with identical content within a single import run.
- **All skill descriptions:** Shortened to concise one-liners.
### Fixed
- **Namespace-agnostic tool name parsing in `on_tool_failure.sh`:** `${TOOL_NAME##*__}` correctly strips any MCP namespace prefix, not just `mcp__mem0__`.
- **`_identity.py`/`_identity.sh`:** `CLAUDE_PLUGIN_OPTION_API_KEY` env var was not checked, causing key-not-found when using `userConfig`.
- **Three previously failing tests** (`test_on_file_read.py`, `test_rubric_dedup.py`, `test_write_path.py`) fixed after hook changes.
### Removed
- **`/mem0:dream --forget` flag:** Extracted to standalone `forget` skill.
- **`/mem0:dream --schedule` flag:** Use Claude Code's built-in `/schedule` command instead.
- **`/mem0:health --fix` flag:** Auto-fix mode removed entirely; use `/mem0:dream` for remediation.
- **CLI dependency for key management:** All `~/.mem0/config.json` fallback code removed.
## 0.2.2
### Fixed
- **Duplicate memory writes on compaction:** `on_pre_compact.py` was running as both primary and backup capture path. Now reads `session_stats` and skips if agent already stored 2+ memories. `on_stop.sh` and `on_session_end.sh` were both calling `on_pre_compact.py`, creating double captures — removed redundant calls.
- **Verbose session-state blobs:** `on_pre_compact.py` `build_content()` was producing 5000+ char structured markdown. Now produces minimal 2-line summary (`Working on:`, `Files touched:`), relying on `infer=True` for extraction.
- **Pre-compaction prompt rewrite:** Instruction changed from "store a single large `session_state` blob with `infer=False`" to "store 0–3 durable facts per session (15–50 words each), one per `add_memory` call, tagged by category."
- **False-positive error detection:** `on_bash_output.sh` and `on_user_prompt.sh` error grep pattern was too broad, triggering on routine test/linter output. Now uses two-tier approach: high-signal patterns (`Traceback`, `panic:`, `FATAL:`) fire always; lower-signal (`Error:`, `Exception:`) require 2+ occurrences.
- **Background `on_pre_commit.py` on every git commit:** `on_git_commit_capture.sh` was storing `commit_context` memories regardless of usefulness. Background call removed; hook now only performs memory search. `on_pre_commit.py` deleted.
- **Post-commit prompt always firing:** `on_post_commit.sh` now gated behind `settings.commit_prompts: true` in `mem0.md` (defaults to off).
- **Project ID lost after folder rename:** `_project.py` only looked up `project_map.json` by CWD path. Added remote-hash fallback: hashes `git remote.origin.url` to a 16-char key, self-heals map on hit.
- **Subagent skip list hardcoded:** `on_subagent_stop.sh` now reads `settings.subagent_skip` from `mem0.md` instead of hardcoded `Explore|Plan`.
- **Auto-import missed project-root files:** `auto_import.py` only searched CWD. Added `_git_root()` helper to also search git root when invoked from subdirectory.
- **Concurrent `ensure_deps.sh` install race:** Multiple parallel sessions could corrupt the venv. Added lock directory with 60s spin-wait and `.install-failed` sentinel.
- **Telemetry `distinct_id` used MD5:** Changed to SHA-256 (truncated 32 chars).
- **Telemetry caller props could override system props:** Moved system fields after spread so they always win.
- **Plugin version hardcoded in `telemetry.py`:** Replaced with `_load_plugin_version()` reading from `plugin.json`.
- **Onboard marker race:** Marker now created in `on_session_start.sh` when prompt is first displayed, not after skill completes.
### Changed
- **`capture_compact_summary.py`:** `infer` changed from `False` to `True` so platform can extract structured facts.
- **Chunking utilities extracted to `_chunking.py`:** `split_by_headers`, `split_by_hr_or_headers`, `filter_and_truncate` moved from `import_competing_tools.py` to shared module.
- **`auto_import.py` now chunks Markdown files:** `.md` files split by `## ` headers before import instead of single blob.
- **`enforce_metadata_defaults.sh`:** New `PreToolUse` hook on `add_memory` for all three editors. Injects default metadata (`confidence: 0.7`, `source: "auto_capture"`, `type: "task_learning"`) when agent omits them.
- **`mem0.md` Settings section parsing:** `parse_mem0_config.py` now parses `Settings` section; added `--key <dotted.path>` CLI argument for programmatic lookup.
- **Project config display condensed:** Session start shows compact summary line instead of raw JSON dump.
### Added
- `scripts/_chunking.py` — shared content-chunking utilities.
- `scripts/enforce_metadata_defaults.sh` — metadata defaults injection hook.
- `parse_mem0_config.py --key` — CLI accessor for individual `mem0.md` config keys.
- **Native `MEMORY.md` detection:** `on_session_start.sh` detects Claude Code auto-memory and prompts to disable or run `/mem0:import`.
- **`/mem0:list-projects` skill:** Discovers all project `app_id` scopes by paginating `get_memories` without an `app_id` filter.
- **`/mem0:tour` cross-project mode** (`--all-projects`) and peek mode (query argument).
- **`/mem0:stats` weekly digest mode** (`--weekly`).
- **`/mem0:dream --forget` mode:** Search-confirm-delete flow with undo-last-write.
- **`/mem0:import --tools` flag:** Import from competing AI tool configs.
- `conftest.py` — `_clean_project_map` autouse fixture preventing cross-test pollution.
### Removed
- `scripts/on_pre_commit.py` — source of unwanted background writes on every commit.
- **`/mem0:digest` skill** — merged into `/mem0:stats --weekly`.
- **`/mem0:forget` skill** — merged into `/mem0:dream --forget`.
- **`/mem0:import-tools` skill** — merged into `/mem0:import --tools`.
- **`/mem0:peek` skill** — merged into `/mem0:tour <query>`.
- `tests/test_pre_commit.py` — tests for deleted script.
## 0.2.1
### Added
- **11 new skills:** `/mem0:dream` (memory consolidation), `/mem0:export` (portable YAML-frontmatter export), `/mem0:import` (re-import exported memories), `/mem0:import-tools` (import from Cursor/Copilot/Cline/Continue configs), `/mem0:forget` (delete with confirmation), `/mem0:health` (diagnostic check — API key, MCP connectivity, read/write), `/mem0:peek` (compact quick-search), `/mem0:pin` (mark memory as high-priority), `/mem0:remember` (quick verbatim store with auto-classification), `/mem0:stats` (session + lifetime statistics), `/mem0:digest` (weekly memory summary).
- **8 new hook scripts:** `on_bash_output.sh` (scan bash output for errors, surface `anti_pattern`/`bug_fix` memories), `on_git_commit_capture.sh` (detect git commit/merge/rebase, search relevant memories), `on_post_commit.sh` (prompt to save commit learnings), `on_post_compact.sh` (recovery prompt to reload context after compaction), `on_session_end.sh` (last-chance transcript capture with dedup marker), `on_subagent_stop.sh` (remind to capture learnings from non-Explore/Plan subagents), `on_tool_failure.sh` (classify MCP failures as auth/rate-limit/network, suggest recovery), `on_pre_commit.py` (capture staged changes via REST API).
- **PostHog telemetry (`telemetry.py`):** Anonymous, fire-and-forget, 10% sampled. Uses stdlib `urllib` (no SDK dependency). Sends event type, platform, plugin version, anonymized identity. Never sends memory content or API keys. Opt-out via `MEM0_TELEMETRY=false`.
- **10 new memory categories in `setup_coding_categories.py`:** `dependency_decisions`, `performance_findings`, `security_constraints`, `testing_patterns`, `data_model`, `api_contracts`, `deployment_runbook`, `team_norms`, `domain_glossary`, `experiment_results`.
- **Dependency management (`ensure_deps.sh`):** Installs `mem0ai` into persistent venv at `${CLAUDE_PLUGIN_DATA}/venv`. Skips re-install if `requirements.txt` hash unchanged. Runs on `Setup(init|maintenance)` hook and every `SessionStart`.
- **Competing tool importer (`import_competing_tools.py`):** Parses and uploads configs from `.cursorrules`, `.github/copilot-instructions.md`, `memory-bank/`, `.continue/rules.md`. Splits by Markdown headers/horizontal rules.
- **Export file parser (`parse_export_file.py`):** Parses YAML-frontmatter Markdown format into JSON array.
- **Config parser (`parse_mem0_config.py`):** Reads `mem0.md` and extracts `Retention` section into category-to-days mapping.
- **Auto-onboarding:** `on_session_start.sh` detects first-time projects and triggers `/mem0:onboard` automatically.
- **`mem0.md` config loading:** Session start parses `mem0.md` and injects project config into context.
- **Inactive API key banner:** Shows `Mem0 Inactive` with `api_key=NOT_SET` instead of silently exiting.
- **`requirements.txt`:** Declares `mem0ai` as plugin's Python dependency.
- **Tests:** `test_coding_categories.py`, `test_import_competing_tools.py`, `test_parse_export_file.py`, `test_parse_mem0_config.py`, `test_pre_commit.py`, `test_session_stats.py`, `test_telemetry.py`, `test_write_path.py`.
### Changed
- **API scoping: `metadata.project_id` → `app_id`:** All scripts and skills now pass `project_id` as top-level `app_id` parameter instead of inside `metadata`. Affects `auto_import.py`, `capture_compact_summary.py`, `on_pre_compact.py`, all stop hooks, all skill instructions.
- **API endpoint: v1 → v3:** `auto_import.py`, `capture_compact_summary.py`, `on_pre_compact.py` now call `/v3/memories/add/`.
- **API key resolution:** `_identity.py` and `_identity.sh` now check `CLAUDE_PLUGIN_OPTION_MEM0_API_KEY` (Claude Code `userConfig` env var) as fallback after `MEM0_API_KEY`.
- **`session_stats.py`:** Added per-category counters, rolling list of up to 50 recent memory IDs, `peek` subcommand for non-destructive stat reading.
- **`setup_coding_categories.py`:** Now imports `mem0ai` from managed venv via `sys.path` injection.
- **`on_stop_cursor.sh`:** Added `loop_count` guard to prevent re-entry loops.
- **`on_stop.sh`:** Removed `set -e` so session-end reminder always emits even if `session_stats.py` fails. Added dedup marker (`~/.mem0/.captured_<session_id>`).
- **`on_user_prompt.sh`:** Detects source file paths in prompt and adds `metadata.files contains` search filter. Handles no-API-key case gracefully.
- **`/mem0:tour`:** Replaced 7 parallel type-filtered `search_memories` calls with single `get_memories(app_id=...)` + 3 broad searches (type filtering misses auto-categorized memories).
- **`/mem0:onboard`:** Added SDK install step, changed MCP check to use ToolSearch, writes onboard marker to prevent re-triggering.
- **`/mem0:mcp`:** Added 16-row category-to-query routing table, inline citations requirement, `branch` in metadata requirement.
### Fixed
- **`auto_import.py`, `capture_compact_summary.py`, `on_pre_compact.py`:** Were reading `MEM0_API_KEY` directly; now use `resolve_api_key()` so `CLAUDE_PLUGIN_OPTION_MEM0_API_KEY` is honored.
- **`on_pre_compact.py`:** `resolve_project_id()` and `resolve_branch()` now receive `cwd` from hook input instead of `os.getcwd()`, fixing incorrect identification when hook fires in different directory.
- **`on_stop_codex.sh`, `on_stop_cursor.sh`:** Missing `_identity.sh` source call; API key resolution via `userConfig` fallback was broken.
- **`on_post_tool_use.sh`:** Input field corrected from `tool_result` to `tool_output` to match hook JSON schema.
## 0.2.0
### Added
- **Project-scoped memories:** Deterministic `project_id` from git remote (`_project.sh` / `_project.py`). Memories are now isolated per-repo via `metadata.project_id` on every `add_memory` and `search_memories` call. Same repo cloned twice → same `project_id`.
- **Branch-aware tagging:** `metadata.branch` stamped on session-state and compact-summary memories. Enables branch-scoped recall (e.g. "what was I doing on feature/auth-rewrite?").
- **Auto-import of project files:** SessionStart detects CLAUDE.md, AGENTS.md, .cursorrules, .windsurfrules, mem0.md — hashes them (SHA-256), imports changed files as `project_profile` memories. Idempotent across sessions.
- **Active identity banner:** SessionStart now prints `user=X | project=Y | branch=Z | memories=N` instead of a silent bootstrap.
- **Session-end report:** Stop hook prints `Session: wrote N memories, retrieved M. Categories touched: ...` and appends to `~/.mem0/session-log.md`.
- **`/mem0:onboard` skill:** Post-install wizard — verifies API key, detects and imports project files, installs coding categories, prints setup summary. 30 seconds to value.
- **`/mem0:tour` skill:** Shows all memories for the current project grouped by category. Proof-of-value demo.
- **`/mem0:switch-project` skill:** Manual `project_id` override for monorepos and non-git directories. Persists to `~/.mem0/project_map.json`.
- **Session stats tracker** (`session_stats.py`): Tracks memory adds/searches per session for the end-of-session report.
### Changed
- All hooks and `mem0-mcp/SKILL.md` now include `project_id` in every filter and metadata example.
- SessionStart banner replaces the previous "## Mem0 Identity" block with a compact one-liner.
- `on_pre_compact.py` and `capture_compact_summary.py` now include `project_id` and `branch` in stored metadata.
## 0.1.3
### Fixed
- **user_id resolution no longer derives from `MEM0_API_KEY`.** v0.1.2 changed the resolver to fall back to `"mem0-" + sha256(MEM0_API_KEY)[:12]` ahead of `$USER`, which silently moved every existing user to a new bucket on update. Memories written under the previous `$USER` value became unreachable from the plugin. Resolution is now back to `MEM0_USER_ID` → `$USER` → `"default"`.
- Dropped the "regardless of which machine you're on" line from the SessionStart bootstrap, since cross-machine consolidation now requires setting `MEM0_USER_ID` explicitly.
### Notes for users upgrading from 0.1.2
- The `~/.mem0/identity.json` cache file is no longer read or written. Safe to delete.
- If you wrote memories during the v0.1.2 window, they live under `mem0-<sha256(api_key)[:12]>`. To recover: temporarily `export MEM0_USER_ID=mem0-<hash>`, search/export, then unset.
- Want a single bucket across machines (the original goal of #5076)? Set `MEM0_USER_ID` explicitly in your shell profile. The plugin will not auto-derive one.
## 0.1.2
### Added
- Deterministic `user_id` resolver (`_identity.sh` / `_identity.py`) — **reverted in 0.1.3, see above.**
- SessionStart-compact handler (`capture_compact_summary.py`) that stores the post-compaction summary as a memory with `metadata.type=compact_summary`.
- Coding-taxonomy setup script (`setup_coding_categories.py`) — one-shot `project.update(custom_categories=[...])` for `architecture_decisions`, `anti_patterns`, `task_learnings`, `tooling_setup`, `bug_fixes`, `coding_conventions`, `user_preferences`.
- Opt-in hook logging via `MEM0_DEBUG=1` → `~/.mem0/hooks.log`.
- `mem0-mcp` skill replacing the Claude-Code-specific `mem0-codex` skill.
### Fixed
- `session_id` now written to memory metadata (`on_pre_compact.py`).
- SessionStart bootstrap exits silently when `MEM0_API_KEY` is unset.
- `block_memory_write.sh` regex tightened to `MEMORY.md` / `.claude/memory/*` — no longer blocks `docs/memory/*.md`.
- Removed duplicate PreCompact write path (kept agent-driven, dropped the parallel Python REST entry from `hooks.json` / `cursor-hooks.json`).
- Hook-side captures (`session_state`, `compact_summary`) now set `expiration_date = today + 90 days`.
## 0.1.1
- Cursor plugin fully functional (`#4547`).
- Codex plugin support and integration docs (`#4665`).
- Codex lifecycle hooks via opt-in installer (`#4917`).
- Removed invalid keys from Claude plugin config (`#4821`).
## 0.1.0
- Initial release: Mem0 plugin for Claude Code and Cursor (`#4518`).
-71
View File
@@ -1,71 +0,0 @@
# Changelog
## 0.1.2 (2026-06-12)
### Fixed
- **Visible command feedback** — `/mem0-remember`, `/mem0-forget`, `/mem0-pin`, and `/mem0-scope` now render their results as persistent message blocks (`pi.sendMessage({ display: true })`) instead of `ctx.ui.notify(..., "info")`. The Pi TUI draws `"info"` notifications as dim, collapsible status text that overwrites the previous line, so command results were easily missed (felt like "no feedback"). Warnings and errors still use `ctx.ui.notify`, which renders prominently.
- **Relevance-filtered search** — `/mem0-search`, `/mem0-forget`, and `/mem0-pin` pass a similarity `threshold` (`searchThreshold`, default `0.3`; configurable in `mem0-config.json`, shown in `/mem0-status`), `top_k`, and `rerank` to the mem0 search API, matching the Claude Code and OpenClaw integrations. mem0 ranks results by similarity with no relevance floor, so without a threshold an unrelated query returns the closest (weak) memories — and `/mem0-forget` would offer them for deletion. The server-side threshold makes a query with no sufficiently similar memory report no match, and reranking orders the genuine matches by deeper relevance. Raise `searchThreshold` to be stricter; lower it if relevant results are missed.
### Improved
- **Richer feedback across every command** — results now show what actually happened: an action heading plus the relevant scope, query, match count, and affected memories.
- `/mem0-remember` echoes the stored text and the scope it landed in, instead of a generic success line.
- `/mem0-search` adds an `N matches for "<query>"` header.
- `/mem0-forget` and `/mem0-pin` name the query when nothing matches, list the affected memory, and label the disambiguation dialog with the match count.
- `/mem0-scope` explains where new memories will be saved.
- **Cleaner `/mem0-dream`** — the consolidation protocol is now sent to the agent hidden (`display: false`, still included in LLM context) behind a concise "Dreaming…" status line, instead of dumping the raw protocol into the transcript.
## 0.1.1 (2026-06-10)
Maintenance release — no functional changes.
### Chores
- Version bump to validate the new release pipeline (`pi-agent-plugin-checks.yml` / `pi-agent-plugin-cd.yml`)
## 0.1.0 (2026-06-09)
Initial release of `@mem0/pi-agent-plugin` — persistent semantic memory for Pi Agent.
### Features
- **Extension entry point** — registers `mem0_memory` tool, 8 slash commands, and auto-capture hooks
- **Agent tool** (`mem0_memory`) — search, add, get_all, delete, delete_all with scoped filters
- **Auto-capture** — extracts and stores memories from both user and assistant messages on `agent_end`
- **Dream consolidation** — automated memory maintenance: merge duplicates, resolve contradictions, prune stale entries. Gated by session count, time elapsed, and memory count thresholds
- **System prompt injection** — appends `MEMORY_POLICY` to every agent turn via `before_agent_start`
- **Monorepo-aware project scoping** — uses `git rev-parse --show-toplevel` for consistent app_id across subdirectories
- **3 memory scopes** — project (default), session, global
- **10 memory categories** — identity, preferences, goals, projects, decisions, technical, relationships, routines, lessons, work
- **8 skills** — context-loader, remember, search, forget, dream, tour, pin, status
- **Confirmation dialogs** — `/mem0-forget` and `/mem0-pin` ask for confirmation before destructive or mutating actions via `ctx.ui.confirm()`
- **Pin preserves memory ID** — `/mem0-pin` uses `mem0.update()` instead of add+delete, keeping the original UUID
- **Full memory IDs** — all displayed memory references show the complete UUID, not truncated short IDs
- **Dream gate optimization** — `dreamChecked` flag prevents repeated `getAll` API calls when the memory gate fails
- **Output truncation** — tool results capped at 200 lines / 50KB per Pi docs
- **Signal cancellation** — all tool actions respect `AbortSignal`
- **Session shutdown cleanup** — releases dream lock on `session_shutdown`
- **PostHog telemetry** — batched event queue with PII-safe error payloads
### Commands
| Command | Description |
|---------|-------------|
| `/mem0-remember` | Store a memory verbatim (no inference) |
| `/mem0-forget` | Search and delete memories (with confirmation) |
| `/mem0-search` | Semantic search across memories |
| `/mem0-tour` | Browse all memories by category |
| `/mem0-dream` | Trigger memory consolidation |
| `/mem0-pin` | Pin a memory to protect from pruning (preserves ID) |
| `/mem0-scope` | Change default scope for this session |
| `/mem0-status` | Connection health and diagnostics |
### Hooks
| Hook | Purpose |
|------|---------|
| `session_start` | Detect project (git root), resolve session ID, increment dream counter |
| `before_agent_start` | Inject memory policy into system prompt, auto-trigger dream if gates pass |
| `agent_end` | Auto-capture conversation memories, check dream completion |
| `session_shutdown` | Release dream lock, flush telemetry |
@@ -34,7 +34,6 @@
"dist",
"src",
"skills",
"CHANGELOG.md",
"README.md",
"LICENSE"
],