mem0-api

mem0-api is a skill for Claude Code, Codex from pinkpixel-dev/mem0-mcp. It costs 186 tokens per session (2,808 once invoked), scanned A, original, MIT.

A reference for Mem0, a memory service that saves useful facts from conversations so AI agents and chatbots can recall information in later sessions.

In plain words
What is it for?
Use it to add persistent conversation memory, store and search facts, and integrate Mem0 with Python, Node.js, or TypeScript applications.
Why use it?
It explains how to choose between Mem0’s hosted service and self-hosted version, install the SDK, authenticate, and use the memory API.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pinkpixel-dev/mem0-mcp/mem0-api
Any agent
npx skills add pinkpixel-dev/mem0-mcp --skill mem0-api
Clone the repo
git clone --depth 1 https://github.com/pinkpixel-dev/mem0-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mem0-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/pinkpixel-dev/mem0-mcp/mem0-api.svg)](https://agentmods.dev/skills/pinkpixel-dev/mem0-mcp/mem0-api)
Your own site
<a href="https://agentmods.dev/skills/pinkpixel-dev/mem0-mcp/mem0-api"><img src="https://agentmods.dev/badge/skills/pinkpixel-dev/mem0-mcp/mem0-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 186 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,808 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00186 $0.02808
Opus 5 $0.00093 $0.01404
Sonnet 5 $0.00037 $0.00562
Haiku 4.5 $0.00019 $0.00281

Measured 4d ago against content hash 4452223bf058, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mem0-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/mem0-api/SKILL.md · 326 lines

How it starts

The opening of the file, as written. The whole thing — 326 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mem0 API & SDK

Mem0 is a managed memory layer for LLM agents. It extracts facts from conversations, deduplicates, and exposes them via semantic search — giving agents persistent, cross-session context without you managing a vector DB.

Two products, one mental model:

  • Mem0 Platform (managed, recommended) — hosted API + dashboard, sub-50ms retrieval
  • Mem0 OSS (self-hosted) — run your own vector store, LLM, and embedder stack

Quick Product Routing

User imports `from mem0 import MemoryClient`      → Platform
User imports `from mem0 import Memory`             → OSS (Python)
User imports `import { Memory } from "mem0ai/oss"` → OSS (Node)
User imports `import MemoryClient from "mem0ai"`   → Platform (TS/JS)
No package installed yet                           → Recommend Platform first

Install

# Python
pip install mem0ai

# Node / TypeScript
npm install mem0ai

# CLI
pip install mem0-cli    # Python CLI
npm install -g @mem0/cli  # Node CLI

API Key: Get from app.mem0.ai/dashboard/api-keys

Auth header: Authorization: Token <YOUR_API_KEY>


Platform SDK — Core CRUD (TypeScript / Python)

TypeScript (primary for this project)

import MemoryClient from "mem0ai";

const client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY! });

// ADD — async, returns event_id
const result = await client.add(
  [{ role: "user", content: "I moved to Austin last month." }],
  { user_id: "alice" }
);
// result.event_id → poll GET /v1/event/{id}/ to confirm SUCCEEDED

// SEARCH — V3 hybrid (semantic + BM25 + entity). Filters REQUIRED in V3.
const hits = await client.search("Where does Alice live?", {
  filters: { user_id: "alice" },
  top_k: 10,
});

// GET ALL
const all = await client.getAll({ user_id: "alice" });

// GET ONE
const mem = await client.get("<memory_id>");

// UPDATE
await client.update("<memory_id>", { text: "Alice lives in Austin, TX" });

// DELETE ONE
await client.delete("<memory_id>");

// DELETE ALL for a scope
await client.deleteAll({ user_id: "alice" });

Read the full file on GitHub · 326 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 326 lines · 186 tokens per session scan A 4452223bf058

Subscribe to this mod's changes

mem0-api is a skill published in the GitHub repository pinkpixel-dev/mem0-mcp (98 stars, last pushed 1mo ago), licensed MIT. It adds 186 tokens to every session and 2,808 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.