Agent skill

Mem0 Platform SDK

by mem0ai in mem0ai/mem0

Adds persistent memory to AI apps with the Mem0 Python and TypeScript SDKs: store, search, update and delete user memories, with framework integrations.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Mem0 Platform SDK

skills CLI
$ npx skills add mem0ai/mem0 --skill mem0 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mem0ai/mem0 mem0 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mem0ai/mem0.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mem0 .claude/skills/mem0 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mem0
GitHub stars
67k
Used in
2 other repos
Token cost
~2.2k tokens
SKILL.md length
564 words
Files
14 (incl. scripts, references)
Skills in repo
26
Repo updated
First seen
Licence
Apache-2.0

At a glance

Adds persistent memory to AI apps with the Mem0 Python and TypeScript SDKs: store, search, update and delete user memories, with framework integrations.

  • Works in 3 steps: Install and authenticate → Initialize the client → Core operations
  • Adding long-term memory to a chatbot or agent
  • SKILL.md covers Step 1: Install and authenticate, Step 2: Initialize the client, Step 3: Core operations and Common integration pattern, plus 6 more sections
  • Runs Python scripts from its folder; calls python, pip and npm; needs MEM0_API_KEY

What it does

The skill walks the agent through installing mem0ai for Python or TypeScript, setting a MEM0_API_KEY, creating a MemoryClient (or AsyncMemoryClient in async Python), and the retrieve, generate, store pattern that every Mem0 integration follows. The core operations shown are adding memories from chat messages, searching with filters such as a user id, listing all memories, updating one and deleting one.

It covers the managed Platform API, which needs no infrastructure to deploy, the open-source self-hosted Memory class, and integrations with LangChain, CrewAI, OpenAI Agents SDK, Pipecat, LlamaIndex, AutoGen and LangGraph. Reference files cover the API, architecture, features, integration patterns, quickstart, SDK guide and use cases, and a mem0_doc_search.py script searches the documentation. It is the default Mem0 skill for ambiguous queries; command-line work goes to mem0-cli and the Vercel AI SDK provider to mem0-vercel-ai-sdk.

Platform use needs internet access to api.mem0.ai and an API key. An agent without a key can run mem0 init through the mem0 command-line tool to get one, and you can claim the account later. The skill targets SDK v3 and mentions a v2 compatibility mode.

When your agent uses it

  • Adding long-term memory to a chatbot or agent
  • Remembering user preferences across sessions
  • Wiring Mem0 into LangChain, CrewAI or LlamaIndex
  • Choosing between the hosted platform and self-hosted memory

Example prompts

  • “Add Mem0 to my support chatbot so it remembers each customer's preferences between sessions.”
  • “Store this conversation as memories for user alice and then search for her dietary preferences.”
  • “Wire Mem0 memory into my CrewAI agent in Python.”

Requirements

  • Python 3.10 or newer, or Node.js 18 or newer
  • The mem0ai package
  • A MEM0_API_KEY for the Platform
  • Internet access to api.mem0.ai
  • Compatibility (from SKILL.md): Requires Python 3.10+ or Node.js 18+, pip install mem0ai or npm install mem0ai, MEM0_API_KEY env var (Platform), and internet access to api.mem0.ai. Targets the v3 API (Python mem0ai 2.x, TypeScript mem0ai 3.x).

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Install and authenticate
  2. Initialize the client
  3. Core operations

What it can do on your machine

Read from SKILL.md and the folder at commit b7ad69a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • pip
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.mem0.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • MEM0_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Python 3.10+ or Node.js 18+, pip install mem0ai or npm install mem0ai, MEM0_API_KEY env var (Platform), and internet access to api.mem0.ai. Targets the v3 API (Python mem0ai 2.x, TypeScript mem0ai 3.x).

    From compatibility in the SKILL.md frontmatter.

Context cost

Mem0 Platform SDK loads about 2.2k tokens when it runs, and up to ~23k if it reads all its reference files. Until then it costs about 182 tokens; SKILL.md has 564 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~182
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~23k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mem0ai/mem0 at commit b7ad69a, republished under its Apache-2.0 licence (© mem0ai). 564 words, ~2,199 tokens.

Download SKILL.mdSave it as .claude/skills/mem0/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
mem0
description
Mem0 Platform SDK for adding persistent memory to AI applications. TRIGGER when: user mentions "mem0", "MemoryClient", "memory layer", "remember user preferences", "persistent context", "personalization", or needs to add long-term memory to chatbots, agents, or AI apps. Covers Python SDK (mem0ai), TypeScript SDK (mem0ai), and framework integrations (LangChain, CrewAI, OpenAI Agents SDK, Pipecat, LlamaIndex, AutoGen, LangGraph). Also covers the open-source self-hosted Memory class. This is the DEFAULT mem0 skill for ambiguous queries. DO NOT TRIGGER when: user asks about CLI commands, terminal usage, or shell scripts (use mem0-cli), or Vercel AI SDK / @mem0/vercel-ai-provider / createMem0 (use mem0-vercel-ai-sdk).
compatibility
Requires Python 3.10+ or Node.js 18+, pip install mem0ai or npm install mem0ai, MEM0_API_KEY env var (Platform), and internet access to api.mem0.ai. Targets the v3 API (Python mem0ai 2.x, TypeScript mem0ai 3.x).
license
Apache-2.0
metadata.author
mem0ai
metadata.version
3.1.0
metadata.category
ai-memory
metadata.tags
memory, personalization, ai, python, typescript, vector-search
metadata.mem0_tested_versions
mem0ai (PyPI) >=2.0.0,<3.0.0; mem0ai (npm) >=3.0.0,<4.0.0

Mem0 Platform Integration

Skill Graph: This skill is part of the Mem0 skill graph:

Mem0 is a managed memory layer for AI applications. It stores, retrieves, and manages user memories via API — no infrastructure to deploy. For self-hosted usage, see the OSS section in the client references below.

Step 1: Install and authenticate

Python:

bash
pip install mem0ai
export MEM0_API_KEY="m0-your-api-key"

TypeScript/JavaScript:

bash
npm install mem0ai
export MEM0_API_KEY="m0-your-api-key"

Get an API key at: https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=skill-mem0

Don't have a MEM0_API_KEY? Run mem0 init --agent --agent-caller <your-name> --json (after pip install mem0-cli or npm install -g @mem0/cli), substituting your agent identity (e.g. claude-code, cursor). If you forgot to pass --agent-caller, run mem0 identify <your-name> after init. The human can claim later with mem0 init --email <your-email>.

Step 2: Initialize the client

Python:

python
from mem0 import MemoryClient
client = MemoryClient(api_key="m0-xxx")

TypeScript:

typescript
import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: 'm0-xxx' });

For async Python, use AsyncMemoryClient.

Step 3: Core operations

Every Mem0 integration follows the same pattern: retrieve → generate → store.

Add memories
python
messages = [
    {"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
    {"role": "assistant", "content": "Got it! I'll remember that."}
]
client.add(messages, user_id="alice")
Search memories
python
results = client.search("dietary preferences", filters={"user_id": "alice"})
for mem in results.get("results", []):
    print(mem["memory"])
Get all memories
python
all_memories = client.get_all(filters={"user_id": "alice"})
Update a memory
python
client.update("memory-uuid", text="Updated: vegetarian, nut allergy, prefers organic")
Delete a memory
python
client.delete("memory-uuid")
client.delete_all(user_id="alice")  # delete all for a user

Common integration pattern

python
from mem0 import MemoryClient
from openai import OpenAI

mem0 = MemoryClient()
openai = OpenAI()

def chat(user_input: str, user_id: str) -> str:
    # 1. Retrieve relevant memories
    memories = mem0.search(user_input, filters={"user_id": user_id})
    context = "\n".join([m["memory"] for m in memories.get("results", [])])

    # 2. Generate response with memory context
    response = openai.chat.completions.create(
        model="gpt-5-mini",
        messages=[
            {"role": "system", "content": f"User context:\n{context}"},
            {"role": "user", "content": user_input},
        ]
    )
    reply = response.choices[0].message.content

    # 3. Store interaction for future context
    mem0.add(
        [{"role": "user", "content": user_input}, {"role": "assistant", "content": reply}],
        user_id=user_id
    )
    return reply

Common edge cases

  • Search returns empty: add() is asynchronous and returns {"event_id": "...", "status": "PENDING"} (eventId on the TS client). Memories are searchable once the event is SUCCEEDED (poll GET /v1/event/{event_id}/, or wait a few seconds). infer=False is synchronous. Also verify user_id matches exactly (case-sensitive) and use filters={"user_id": "..."} syntax.
  • AND filter with user_id + agent_id returns empty: Entities are stored separately. Use OR instead, or query separately.
  • Duplicate memories: Don't mix infer=True (default) and infer=False for the same data. Stick to one mode.
  • Wrong import: For the hosted Platform use from mem0 import MemoryClient (or AsyncMemoryClient for async). from mem0 import Memory is the self-hosted OSS class and does not use MEM0_API_KEY.
  • v3 defaults (Platform): top_k=10, rerank=False. threshold is a server-side cutoff applied before score blending, not a floor on the returned score (the default and 0.0 return the same or nearly the same results). The client sends none of these unless you pass them. The OSS Memory.search() default is top_k=20. Adjust as needed for your use case.
Show full SKILL.md (227 more words)Show less

v2 Compatibility

The "v2" line is Python SDK 1.x and TypeScript SDK 2.x. If you are still on it, note these differences from the current SDKs (Python 2.x, TypeScript 3.x):

  • Entity IDs: user_id / agent_id / run_id could be top-level kwargs on search() and get_all(). They now go inside filters (top-level raises an error)
  • Defaults (Platform): threshold=0.3, rerank=False. OSS: top_k=100, no threshold, rerank=True
  • Graph memory: enable_graph=True and relations are gone. Entity linking is built in (see client/python.md for OSS)

See the Platform migration guide and the OSS migration guide for details.

For the latest docs beyond what's in the references, use the doc search tool:

bash
python ${CLAUDE_SKILL_DIR}/scripts/mem0_doc_search.py --query "topic"
python ${CLAUDE_SKILL_DIR}/scripts/mem0_doc_search.py --page "/platform/features/graph-memory"
python ${CLAUDE_SKILL_DIR}/scripts/mem0_doc_search.py --index

No API key needed — searches docs.mem0.ai directly.

Client SDK References

Language-specific deep references (Platform + OSS):

LanguageFile
Python (MemoryClient + AsyncMemoryClient + Memory OSS)client/python.md
TypeScript/Node.js (MemoryClient + Memory OSS)client/node.md
Python vs TypeScript differencesclient/differences.md

Platform References

Load these on demand for deeper detail:

TopicFile
Quickstart (Python, TS, cURL)references/quickstart.md
SDK guide (all methods, both languages)references/sdk-guide.md
API reference (endpoints, filters, object schema)references/api-reference.md
Architecture (pipeline, lifecycle, scoping, performance)references/architecture.md
Platform features (retrieval, graph, categories, MCP, etc.)references/features.md
Framework integrations (LangChain, CrewAI, OpenAI Agents, etc.)references/integration-patterns.md
Use cases & examples (real-world patterns with code)references/use-cases.md
SkillWhen to useLink
mem0-cliTerminal commands, scripting, CI/CD, agent tool loopslocal / GitHub
mem0-vercel-ai-sdkVercel AI SDK provider with automatic memorylocal / GitHub

© mem0ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (scripts, references) in skills/mem0 of mem0ai/mem0.

  • SKILL.md
  • LICENSE
  • README.md
  • client/differences.md
  • client/node.md
  • client/python.md
  • references/api-reference.md
  • references/architecture.md
  • references/features.md
  • references/integration-patterns.md
  • references/quickstart.md
  • references/sdk-guide.md
  • references/use-cases.md
  • scripts/mem0_doc_search.py

Open the folder on GitHubat commit b7ad69a

Used in 2 other repositories

We found 4 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in mem0ai/mem0, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Mem0 Platform SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mem0 Platform SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mem0 Platform SDK this skillmem0ai/mem067k2 repos~2.2kAutomated safety check: PassApache-2.0
Edgeone Makers MigrationTencentEdgeOne/edgeone-makers-tools1.9k1 repos~4.1kAutomated safety check: PassMIT
Omnigent Framework Detectionomnigent-ai/omnigent11k—~610Automated safety check: PassApache-2.0
Agentsop Framework Selectionagentsope/SkillAlchemy459—~5.8kAutomated safety check: PassMIT
Neo4j Agent Memory Skillneo4j-contrib/neo4j-skills114—~5.8kAutomated safety check: PassMIT
Cloudbase Agent PythonTencentCloudBase/CloudBase-AI-Toolkit1.1k2 repos~2.9kAutomated safety check: NotesMIT

Similar skills

  • Edgeone Makers Migration

    TencentEdgeOne/edgeone-makers-tools

    Migrate existing AI agent projects (LangChain, LangGraph, OpenAI Agents SDK, Claude Agent SDK, CrewAI) to EdgeOne Makers platform conventions.

    1.9k GitHub starsUsed in 1 repo~4.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Omnigent Framework Detection

    omnigent-ai/omnigent

    Scans Python agent code for framework imports and recommends the matching Omnigent executor type, or says when the framework is not natively supported yet.

    11k GitHub stars~610 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Agentsop Framework Selection

    agentsope/SkillAlchemy

    Neutral, framework-agnostic decision tree for project kickoff: "which agent / RAG / LLM framework should I reach for?" Synthesizes the ecosystem sections of 7 landmark-project SOPs (LangGraph…

    459 GitHub stars~5.8k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Neo4j Agent Memory Skill

    neo4j-contrib/neo4j-skills

    Authoritative reference for the neo4j-agent-memory Python package — a graph-native memory system for AI agents built on Neo4j — and for the hosted service (NAMS) at memory.neo4jlabs.com.

    114 GitHub stars~5.8k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Cloudbase Agent Python

    TencentCloudBase/CloudBase-AI-Toolkit

    Build production-ready AI agent backends using the CloudBase Agent Python SDK — create agents with LangGraph/CrewAI/LlamaIndex, serve them via FastAPI with AG-UI protocol streaming +…

    1.1k GitHub starsUsed in 2 repos~2.9k tokens
    AI & LLM EngineeringAuto-check: notes
  • Deep Agents Core

    langchain-ai/langchain-skills

    Official

    Explains how to build agents with the Deep Agents framework: create_deep_agent, the built-in middleware, the harness, SKILL.md format and configuration options.

    1.3k GitHub starsUsed in 1 repo~3.1k tokens
    AI & LLM EngineeringAuto-check passed

More from mem0ai/mem0

All 26 skills in this repo
  • Adds, searches, lists, updates and deletes memories on the Mem0 platform from the terminal with the mem0 command, including a JSON mode built for agents.

    67k GitHub stars~2k tokensUpdated yesterday
    Auto-check: notes
  • Adds persistent memory to Vercel AI SDK apps with the Mem0 provider, using a wrapped model or standalone retrieve and store utilities.

    67k GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Finds and deletes specific mem0 memories by search query or ID, always asking for confirmation first, and can undo the most recent memories added this session.

    67k GitHub stars~664 tokensUpdated yesterday
    Auto-check passed
  • Saves a fact, decision or preference the user states into mem0 as written, labeled with a memory type such as decision, convention or user_preference.

    67k GitHub stars~560 tokensUpdated yesterday
    Auto-check passed
  • Shows or changes the default Mem0 memory scope, project, session or global, which decides where memories are saved and searched.

    67k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Looks up stored agent memories by keyword or ID and prints compact one-line results instead of full detail.

    67k GitHub stars~502 tokensUpdated yesterday
    Auto-check passed

Questions about Mem0 Platform SDK

What does Mem0 Platform SDK do?

Adds persistent memory to AI apps with the Mem0 Python and TypeScript SDKs: store, search, update and delete user memories, with framework integrations. The skill walks the agent through installing mem0ai for Python or TypeScript, setting a MEM0_API_KEY, creating a MemoryClient (or AsyncMemoryClient in async Python), and the retrieve, generate, store pattern that every Mem0 integration follows. The core operations shown are adding memories from chat messages, searching with filters such as a user id, listing all memories, updating one and deleting one.

When should I use Mem0 Platform SDK?

Mem0 Platform SDK fits situations like: adding long-term memory to a chatbot or agent; remembering user preferences across sessions; wiring Mem0 into LangChain, CrewAI or LlamaIndex; choosing between the hosted platform and self-hosted memory.

How do I install Mem0 Platform SDK in Claude Code?

Run `npx skills add mem0ai/mem0 --skill mem0 -a claude-code`. Or copy the skill folder (skills/mem0 in mem0ai/mem0) into .claude/skills/mem0 in your project. Claude Code loads it when a task matches its description.

How do I install Mem0 Platform SDK in Codex?

Run `npx skills add mem0ai/mem0 --skill mem0 -a codex`. Or copy the skill folder (skills/mem0 in mem0ai/mem0) into .agents/skills/mem0 in your project. Codex loads it when a task matches its description.

Can I use Mem0 Platform SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mem0ai/mem0 --skill mem0 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mem0, .gemini/skills/mem0, .github/skills/mem0 and .opencode/skills/mem0 in your project.

What does Mem0 Platform SDK need to run?

Going by SKILL.md and its folder, Mem0 Platform SDK needs Python for the scripts in its folder, the command-line tools its instructions call (python, pip and npm) and credentials named MEM0_API_KEY. Our summary lists: Python 3.10 or newer, or Node.js 18 or newer; The mem0ai package; A MEM0_API_KEY for the Platform; Internet access to api.mem0.ai. Compatibility (from SKILL.md): Requires Python 3.10+ or Node.js 18+, pip install mem0ai or npm install mem0ai, MEM0_API_KEY env var (Platform), and internet access to api.mem0.ai. Targets the v3 API (Python mem0ai 2.x, TypeScript mem0ai 3.x)..

Does Mem0 Platform SDK access the network?

SKILL.md names 1 domain. As links in the text: docs.mem0.ai. This is read from the text; nothing was executed.

Is Mem0 Platform SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Mem0 Platform SDK use?

Mem0 Platform SDK is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mem0 Platform SDK use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 21k tokens, read only when the agent opens those files.

What are the alternatives to Mem0 Platform SDK?

Skills that share tags, products or a category with Mem0 Platform SDK: Edgeone Makers Migration (TencentEdgeOne/edgeone-makers-tools, 1.9k stars), Omnigent Framework Detection (omnigent-ai/omnigent, 11k stars), Agentsop Framework Selection (agentsope/SkillAlchemy, 459 stars) and Neo4j Agent Memory Skill (neo4j-contrib/neo4j-skills, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mem0 Platform SDK?

mem0ai (a GitHub organization) maintains it in mem0ai/mem0, which has 66,788 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 7, 2026.

Source: mem0ai/mem0 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.