/mem0-integrate
Integrate Mem0 into an existing repository using a goal-driven, TDD pipeline. Detects the repo's language automatically and asks the user to pick between Mem0 Platform (managed) and Mem0 Open Source (self-hosted). Writes failing tests before any implementation. Produces a local
$ npx -y skills add mem0ai/mem0 --skill mem0-integrate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/mem0-integrate
Context preview
The summary Claude sees to decide when to auto-load this skill.
Integrate Mem0 into an existing repository using a goal-driven, TDD pipeline. Detects the repo's language automatically and asks the user to pick between Mem0 Platform (managed) and Mem0 Open Source (self-hosted). Writes failing tests before any implementation. Produces a local
SKILL.md
mem0-integrate.SKILL.mdname: mem0-integrate
description: >
Integrate Mem0 into an existing repository using a goal-driven, TDD pipeline.
Detects the repo's language automatically and asks the user to pick between
Mem0 Platform (managed) and Mem0 Open Source (self-hosted). Writes failing
tests before any implementation. Produces a local feature branch plus
`.mem0-integration/` artifacts consumed by the paired verification skill.
TRIGGER when: user says "integrate mem0", "add mem0 to this repo", "wire
mem0 into <repo>", or asks how to add memory to an existing project.
DO NOT TRIGGER when: the user wants general SDK usage (use skill:mem0),
CLI usage (use skill:mem0-cli), or Vercel AI SDK (use skill:mem0-vercel-ai-sdk).
After success, invoke skill:mem0-test-integration to verify in the same
workspace (loose coupling).
license: Apache-2.0
metadata:
author: mem0ai
version: "0.1.0"
category: ai-memory
tags: "memory, integration, tdd, platform, oss"
mem0_tested_versions: "mem0ai (PyPI) >=2.0.0,<3.0.0; mem0ai (npm) >=3.0.0,<4.0.0"
mem0-integrate
Wire Mem0 into an existing repo with a goal-driven, test-first pipeline. Pairs with `mem0-test-integration` for verification.
Canonical sources (fetch before deciding anything)
The skill MUST `WebFetch` these URLs before step 3 and cite them in `plan.md`. They are the ground truth — do not rely on ambient knowledge of the Mem0 API.
Agent-ready docs
- Scope-tagged docs index: https://docs.mem0.ai/llms.txt
- Full docs (single file, deep dives): https://docs.mem0.ai/llms-full.txt
- OpenAPI spec (Platform REST, machine-readable): https://docs.mem0.ai/openapi.json
- Hosted MCP server: https://mcp.mem0.ai (requires Platform API key)
- Integrations index: https://docs.mem0.ai/integrations
Published Mem0 skills — delegate; do not reimplement
Prefer these over writing your own call-site patterns. Each is a standalone `SKILL.md` with triggers, examples, and version-pinned code.
- SDK (Python + TS, Platform + OSS): https://raw.githubusercontent.com/mem0ai/mem0/main/skills/mem0/SKILL.md
- CLI: https://raw.githubusercontent.com/mem0ai/mem0/main/skills/mem0-cli/SKILL.md
- Vercel AI SDK: https://raw.githubusercontent.com/mem0ai/mem0/main/skills/mem0-vercel-ai-sdk/SKILL.md
- Portable editor/MCP plugin: https://github.com/mem0ai/mem0/tree/main/integrations/mem0-agent-plugin
SDK source (read when docs are ambiguous)
Public repo. Cross-check against the `mem0_tested_versions` range in this skill's frontmatter if the `main` branch has moved past a major.
- Repo root: https://github.com/mem0ai/mem0
- Python SDK: https://github.com/mem0ai/mem0/tree/main/mem0
- TypeScript SDK: https://github.com/mem0ai/mem0/tree/main/mem0-ts
Quickstarts (for bootstrapping unfamiliar stacks)
- Platform: https://docs.mem0.ai/platform/quickstart
- OSS Python: https://docs.mem0.ai/open-source/python-quickstart
- OSS Node: https://docs.mem0.ai/open-source/node-quickstart
- Platform vs OSS comparison: https://docs.mem0.ai/platform/platform-vs-oss
Integration principles (non-negotiable)
The true goal of this skill is to produce a **PR the maintainers can accept without argument**. That rules out anything invasive.
1. **Additive, not replacing.** If the target repo already has a memory system, a session store, a user-context layer, or anything named `Memory` / `memory_*`, Mem0 sits **alongside** it, not in place of it. The existing system keeps working unchanged. 2. **Opt-in by default.** Gate all new Mem0 code behind a feature flag (env var like `MEM0_ENABLED=1`, a config key, or a strategy selector). With the flag unset, behavior is the repo's original behavior, byte-for-byte. 3. **No breakage.** No removed exports, no renamed public functions, no changed method signatures, no modified existing tests, no changed behavior of existing tests. All pre-existing tests must pass unchanged both with the flag set and unset. 4. **Minimal dependency surface.** Add `mem0ai` (plus any deps the delegated skill requires) and nothing else. No new vector stores, no graph databases, no provider SDKs the repo does not already use. 5. **Separable commits.** Code, tests, and config/docs land in separate commits so reviewers can cherry-pick. 6. **The null hypothesis wins.** If no additive, gated fit exists after step 6 (plan), exit with code 1 and a rationale. A bad PR is worse than no PR. 7. **Backend only.** Mem0 integration lives in server-side code. API keys, memory scope, and user-identity resolution are not safe client-side. If the repo has both backend and frontend, the call sites live in backend files. Frontend-only repos are rejected at preconditions.
Enforced at four gates: **preconditions** (reject frontend-only repos and repos where additive fit is impossible), **step 2 comprehension** (confirm a backend exists and name candidate surfaces), **step 6 plan review** (reject plans that mutate existing exports or name client-side call sites), and **step 10 self-healing loop** (refuse to "fix" principle violations — surface them instead).
Skill delegation rules
Before writing any code, check whether a published skill already covers the target stack. If yes, delegate — copy its call-site pattern into `plan.md` and into the tests; do not paraphrase.
| Detected in target repo | Delegate to | Why | |---|---|---| | `@ai-sdk/*` + `ai` in `package.json` | `skills/mem0-vercel-ai-sdk` | Integration is via `createMem0` provider wrapper, not raw `MemoryClient`. | | CLI-only repo (Typer, Commander, Click, Cobra) with no LLM call sites | `skills/mem0-cli` | Call sites are command handlers, not model wrappers. Consider whether mem0 actually fits first. | | Target is an MCP client / editor config (Claude Code, Cursor, Codex settings) | `integrations/mem0-agent-plugin` | Wire via MCP server URL + hooks; no SDK code usually needed. | | Any other Python or TS repo with an LLM call site | `skills/mem0` | Default SDK integra
Read more
name: mem0-integrate description: > Integrate Mem0 into an existing repository using a goal-driven, TDD pipeline. Detects the repo's language automatically and asks the user to pick between Mem0 Platform (managed) and Mem0 Open Source (self-hosted). Writes failing tests before any implementation. Produces a local feature branch plus `.mem0-integration/` artifacts consumed by the paired verification skill. TRIGGER when: user says "integrate mem0", "add mem0 to this repo", "wire mem0 into <repo>", or asks how to add memory to an existing project. DO NOT TRIGGER when: the user wants general SDK usage (use skill:mem0), CLI usage (use skill:mem0-cli), or Vercel AI SDK (use skill:mem0-vercel-ai-sdk). After success, invoke skill:mem0-test-integration to verify in the same workspace (loose coupling). license: Apache-2.0 metadata: author: mem0ai version: "0.1.0" category: ai-memory tags: "memory, integration, tdd, platform, oss" mem0_tested_versions: "mem0ai (PyPI) >=2.0.0,<3.0.0; mem0ai (npm) >=3.0.0,<4.0.0"
mem0-integrate
Wire Mem0 into an existing repo with a goal-driven, test-first pipeline. Pairs with `mem0-test-integration` for verification.
Canonical sources (fetch before deciding anything)
The skill MUST `WebFetch` these URLs before step 3 and cite them in `plan.md`. They are the ground truth — do not rely on ambient knowledge of the Mem0 API.
Agent-ready docs
- Scope-tagged docs index: https://docs.mem0.ai/llms.txt
- Full docs (single file, deep dives): https://docs.mem0.ai/llms-full.txt
- OpenAPI spec (Platform REST, machine-readable): https://docs.mem0.ai/openapi.json
- Hosted MCP server: https://mcp.mem0.ai (requires Platform API key)
- Integrations index: https://docs.mem0.ai/integrations
Published Mem0 skills — delegate; do not reimplement
Prefer these over writing your own call-site patterns. Each is a standalone `SKILL.md` with triggers, examples, and version-pinned code.
- SDK (Python + TS, Platform + OSS): https://raw.githubusercontent.com/mem0ai/mem0/main/skills/mem0/SKILL.md
- CLI: https://raw.githubusercontent.com/mem0ai/mem0/main/skills/mem0-cli/SKILL.md
- Vercel AI SDK: https://raw.githubusercontent.com/mem0ai/mem0/main/skills/mem0-vercel-ai-sdk/SKILL.md
- Portable editor/MCP plugin: https://github.com/mem0ai/mem0/tree/main/integrations/mem0-agent-plugin
SDK source (read when docs are ambiguous)
Public repo. Cross-check against the `mem0_tested_versions` range in this skill's frontmatter if the `main` branch has moved past a major.
- Repo root: https://github.com/mem0ai/mem0
- Python SDK: https://github.com/mem0ai/mem0/tree/main/mem0
- TypeScript SDK: https://github.com/mem0ai/mem0/tree/main/mem0-ts
Quickstarts (for bootstrapping unfamiliar stacks)
- Platform: https://docs.mem0.ai/platform/quickstart
- OSS Python: https://docs.mem0.ai/open-source/python-quickstart
- OSS Node: https://docs.mem0.ai/open-source/node-quickstart
- Platform vs OSS comparison: https://docs.mem0.ai/platform/platform-vs-oss
Integration principles (non-negotiable)
The true goal of this skill is to produce a **PR the maintainers can accept without argument**. That rules out anything invasive.
1. **Additive, not replacing.** If the target repo already has a memory system, a session store, a user-context layer, or anything named `Memory` / `memory_*`, Mem0 sits **alongside** it, not in place of it. The existing system keeps working unchanged. 2. **Opt-in by default.** Gate all new Mem0 code behind a feature flag (env var like `MEM0_ENABLED=1`, a config key, or a strategy selector). With the flag unset, behavior is the repo's original behavior, byte-for-byte. 3. **No breakage.** No removed exports, no renamed public functions, no changed method signatures, no modified existing tests, no changed behavior of existing tests. All pre-existing tests must pass unchanged both with the flag set and unset. 4. **Minimal dependency surface.** Add `mem0ai` (plus any deps the delegated skill requires) and nothing else. No new vector stores, no graph databases, no provider SDKs the repo does not already use. 5. **Separable commits.** Code, tests, and config/docs land in separate commits so reviewers can cherry-pick. 6. **The null hypothesis wins.** If no additive, gated fit exists after step 6 (plan), exit with code 1 and a rationale. A bad PR is worse than no PR. 7. **Backend only.** Mem0 integration lives in server-side code. API keys, memory scope, and user-identity resolution are not safe client-side. If the repo has both backend and frontend, the call sites live in backend files. Frontend-only repos are rejected at preconditions.
Enforced at four gates: **preconditions** (reject frontend-only repos and repos where additive fit is impossible), **step 2 comprehension** (confirm a backend exists and name candidate surfaces), **step 6 plan review** (reject plans that mutate existing exports or name client-side call sites), and **step 10 self-healing loop** (refuse to "fix" principle violations — surface them instead).
Skill delegation rules
Before writing any code, check whether a published skill already covers the target stack. If yes, delegate — copy its call-site pattern into `plan.md` and into the tests; do not paraphrase.
| Detected in target repo | Delegate to | Why | |---|---|---| | `@ai-sdk/*` + `ai` in `package.json` | `skills/mem0-vercel-ai-sdk` | Integration is via `createMem0` provider wrapper, not raw `MemoryClient`. | | CLI-only repo (Typer, Commander, Click, Cobra) with no LLM call sites | `skills/mem0-cli` | Call sites are command handlers, not model wrappers. Consider whether mem0 actually fits first. | | Target is an MCP client / editor config (Claude Code, Cursor, Codex settings) | `integrations/mem0-agent-plugin` | Wire via MCP server URL + hooks; no SDK code usually needed. | | Any other Python or TS repo with an LLM call site | `skills/mem0` | Default SDK integra
Mem0 ("mem-zero") enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions.

