
Mem0
Implement Mem0 long-term memory in agents with correct Python versus TypeScript SDK calls, naming, and constructor patterns.
Overview
Mem0 is an agent skill for the Build phase that documents Python versus TypeScript Mem0 SDK differences for memory CRUD, search, webhooks, and project APIs.
Install
npx skills add https://github.com/mem0ai/mem0 --skill mem0What is this skill?
- Side-by-side Python and TypeScript Mem0 Platform vs OSS import paths
- Method parity table: add, search, get, getAll/get_all, update, delete, history, batch ops
- Documents constructor differences: MemoryClient(api_key) vs new MemoryClient({ apiKey })
- Covers project APIs, webhooks, and user listing/deletion across SDKs
- Notes MEM0_API_KEY environment variable fallback on both runtimes
Adoption & trust: 1.1k installs on skills.sh; 58k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are adding Mem0 to an agent but keep mixing Python snake_case APIs with TypeScript camelCase clients and wrong import paths.
Who is it for?
Builders actively coding Mem0-backed agents who need a single cross-SDK reference inside the editor.
Skip if: Products not using Mem0, or founders still in idea validation without an agent memory layer planned.
When should I use this skill?
Implementing or debugging Mem0 memory APIs when switching between Python and TypeScript agent codebases.
What do I get? / Deliverables
Your agent implementation uses the correct SDK surface—imports, constructors, and method names—for add, search, batch, and webhook operations on Mem0.
- Correct SDK call patterns in your codebase
- Aligned cross-language memory operation implementations
Recommended Skills
Journey fit
Mem0 is integration reference material for wiring persistent memory while you build agent products, not a discovery or launch workflow. Agent-tooling is where memory clients, webhooks, and batch memory APIs belong in the solo-builder journey shelf.
How it compares
Reference skill for Mem0 SDK parity—not a generic RAG tutorial and not an MCP server directory entry.
Common Questions / FAQ
Who is mem0 for?
Solo developers building AI agents who standardize on Mem0 for persistent memory and work in Python, TypeScript, or both.
When should I use mem0?
During Build/agent-tooling when wiring MemoryClient or OSS Memory, implementing search and history, or aligning webhook and batch calls across languages.
Is mem0 safe to install?
Review the Security Audits panel on this Prism page; integrating Mem0 in your app will require API keys and network calls you manage outside the skill.
SKILL.md
READMESKILL.md - Mem0
# Python vs TypeScript SDK Differences Quick-reference cheatsheet for developers working across both Mem0 SDKs. ## Constructor | Aspect | Python | TypeScript | |--------|--------|------------| | Import (Platform) | `from mem0 import MemoryClient` | `import MemoryClient from 'mem0ai'` | | Import (OSS) | `from mem0 import Memory` | `import { Memory } from 'mem0ai/oss'` | | Constructor | `MemoryClient(api_key="m0-xxx")` | `new MemoryClient({ apiKey: 'm0-xxx' })` | | Required param | `api_key` (positional or kwarg) | `apiKey` (in options object) | Both read from `MEM0_API_KEY` env var if no key provided. ## Method Naming | Operation | Python | TypeScript | |-----------|--------|------------| | Add | `add()` | `add()` | | Search | `search()` | `search()` | | Get | `get()` | `get()` | | Get all | `get_all()` | `getAll()` | | Update | `update()` | `update()` | | Delete | `delete()` | `delete()` | | Delete all | `delete_all()` | `deleteAll()` | | History | `history()` | `history()` | | Batch update | `batch_update()` | `batchUpdate()` | | Batch delete | `batch_delete()` | `batchDelete()` | | List users | `users()` | `users()` | | Delete users | `delete_users()` | `deleteUsers()` | | Get project | `project.get()` | `getProject()` | | Update project | `project.update()` | `updateProject()` | | Create webhook | `create_webhook()` | `createWebhook()` | | Get webhooks | `get_webhooks()` | `getWebhooks()` | | Update webhook | `update_webhook()` | `updateWebhook()` | | Delete webhook | `delete_webhook()` | `deleteWebhook()` | | Create export | `create_memory_export()` | `createMemoryExport()` | | Get export | `get_memory_export()` | `getMemoryExport()` | | Feedback | `feedback()` | `feedback()` | **Rule:** Python uses `snake_case`, TypeScript uses `camelCase` for method names. ## Parameter Passing ```python # Python: kwargs client.add(messages, user_id="alice", metadata={"source": "chat"}) client.search("query", filters={"user_id": "alice"}, top_k=5, rerank=True) ``` ```typescript // TypeScript: options object with camelCase for top-level params, snake_case for filter keys await client.add(messages, { userId: 'alice', metadata: { source: 'chat' } }); await client.search('query', { filters: { user_id: 'alice' }, topK: 5, rerank: true }); ``` **v3:** Python uses `snake_case` everywhere. TypeScript uses `camelCase` for top-level params (`userId`, `topK`) but `snake_case` for filter keys (`user_id`, `agent_id`). ## Architectural Differences | Aspect | Python | TypeScript | |--------|--------|------------| | HTTP library | httpx | axios | | Default timeout | 300s | 60s | | Sync support | Yes (`MemoryClient`) | No (all async) | | Async support | Yes (`AsyncMemoryClient`) | All methods are async | | Project management | `client.project.*` (separate class) | `client.getProject()` / `client.updateProject()` | | Context manager | `async with AsyncMemoryClient()` | Not supported | ## Platform Features: Python-only These methods exist in Python but not TypeScript: | Method | Description | |--------|-------------| | `get_summary(filters)` | Get summary of memories | | `reset()` | Delete ALL data (users + memories) | | `project.create(name)` | Create a new project | | `project.delete()` | Delete current project | | `project.get_members()` | List project members | | `project.add_member(email, role)` | Add member to project | | `project.update_member(email, role)` | Change member role | | `project.remove_member(email)` | Remove member | ## Platform Features: TypeScript-only | Method | Description | |--------|-------------| | `deleteUser(data)` | Convenience method for single entity deletion | | `ping()` | Health check endpoint | ## OSS Config Naming | Python config key | TypeScript config key | |-------------------|----------------------| | `vector_store` | `vectorStore` | | `history_db_path` | `historyDbPath` | | `custom_instructions` | `customInstructions` | ## OSS Scope Parameter Naming | Python | TypeScript | |--------|------------