Mem0 gives an AI app a memory that outlasts the conversation. You hand it the messages of a chat; it uses a language model to pull out the facts worth keeping (a preference, a name, a decision the agent made), embeds them, and stores them against a user, session or agent ID. On the next turn you search it, and the handful of relevant memories goes into the prompt instead of the whole history. Out of the box it calls OpenAI for extraction and embeddings and keeps vectors in a local Qdrant store; both swap out for Ollama, Anthropic, Gemini and most popular vector databases.
It earns its place as the default answer to "how do I make my agent remember things". It is a Python and TypeScript library, a self-hostable server with a dashboard, and a CLI, with ready-made plugins for Claude Code, OpenCode, Hermes, OpenClaw, n8n, Zapier and the Vercel AI SDK. The company behind it, a Y Combinator S24 startup, sells a hosted platform. The open-source code is Apache-2.0, and the README is candid that its headline benchmark scores come from the platform, which includes optimizations the open-source SDK does not.
- Repository: github.com/mem0ai/mem0
- Licence: Apache-2.0 (Apache License 2.0)
- Language: Python. Stars: 66K. Forks: 7,766. Last push: Sep 25, 2026.
- Scan: safe, Sep 25, 2026, commit 94c3fe9
Who it is for
Developers building chatbots, support agents or coding assistants that should remember users across sessions, and teams that want that memory on their own infrastructure rather than inside a model vendor's product.
Getting started
1. Install the Python library (the default setup needs an OPENAI_API_KEY)
pip install mem0ai2. Or the TypeScript SDK
npm install mem0ai3. Or, from a clone of the repository, run the self-hosted server: it starts the stack, creates an admin and issues the first API key
cd server && make bootstrapThe library's defaults send conversation text to OpenAI for fact extraction and embeddings unless you configure a local model such as Ollama. Anonymous usage telemetry is on by default; set MEM0_TELEMETRY=false to turn it off.
Safety scan
We cloned mem0ai/mem0 at commit 94c3fe9 on Sep 25, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.
- Three secret hits, all fakes in tests of Mem0's own redaction code: a placeholder GitHub token and two PEM private-key blocks wrapping the words "secret" and "private-material", there to prove the plugins strip credentials before anything leaves the machine. No self-decoding code, no committed binaries and no bare-IP URLs across about 325,000 lines of Python and TypeScript.
- The pattern hits are examples and hints. examples/nemoclaw/setup-mem0-nemoclaw.sh, a setup script for NVIDIA's NemoClaw sandbox, installs nvm with its curl | bash installer and runs sudo systemctl enable docker. The Hermes plugin's setup prints the Ollama install one-liner as advice without running it, and one test pipes a local file:// script to bash. The two npm lifecycle hooks (prepare, prepack) only build the TypeScript packages from source.
- Telemetry: mem0/memory/telemetry.py sends anonymous events to PostHog (us.i.posthog.com) with the library version, Python version and OS details, sampling routine events at 10 percent. It is on unless MEM0_TELEMETRY is false, and the self-hosted server does the same. An email address is attached only when you use the hosted platform's client.
- 119 known advisories across 13 lockfiles, 4 critical. 107 sit in the root poetry.lock, which resolves every optional extra at once for development: the critical ones are chromadb 1.5.9 and litellm 1.83.7 (both optional extras) and an old anyio. pip install mem0ai does not read that file and resolves current versions. The rest are in the JavaScript plugins' and dashboard's lockfiles, mostly build tooling.
- 34 workflows. Three use pull_request_target (the PR gate, the labeler and a contributor check), and none checks out the pull request's code. Only 2 of 40 third-party actions are pinned to a commit. Security policy, contributing guide and code of conduct present; no Dependabot or CodeQL.
What the scanner counted
| Check | Result |
|---|---|
| Secrets | 3 candidates found and read; see the notes above. |
| Suspicious code | 9 pattern hits found and read; every one is listed under the raw findings. |
| Install-time code | 2 npm lifecycle scripts |
| Committed binaries | None. |
| CI workflows | 34 workflows. 3 use pull_request_target, none check out the pull request head. 38 of 40 third-party actions pinned to a tag rather than a commit. |
| Network hosts | 40 distinct hosts referenced from source; most often api.mem0.ai, workspace.databricks.com, github.com, docs.mem0.ai. No URLs to bare IP addresses. |
| Known vulnerabilities | 119 advisories across 2,331 pinned packages: 4 critical, 56 high, 44 moderate, 15 low. cli/node/pnpm-lock.yaml: 178 packages, 1 advisories; integrations/agent-plugin-core/requirements-dev.txt: 1 packages, 0 advisories; integrations/agent-plugin-core/typescript/pnpm-lock.yaml: 3 packages, 0 advisories; integrations/deepseek-plugin/pnpm-lock.yaml: 212 packages, 1 advisories; integrations/n8n-nodes-mem0/pnpm-lock.yaml: 558 packages, 2 advisories; integrations/openclaw/pnpm-lock.yaml: 472 packages, 1 advisories; integrations/pi-agent-plugin/pnpm-lock.yaml: 551 packages, 2 advisories; integrations/vercel-ai-sdk/pnpm-lock.yaml: 414 packages, 5 advisories; integrations/zapier-mem0/pnpm-lock.yaml: 348 packages, 1 advisories; mem0-ts/pnpm-lock.yaml: 1,094 packages, 7 advisories; poetry.lock: 315 packages, 107 advisories; server/dashboard/pnpm-lock.yaml: 586 packages, 6 advisories; server/requirements.txt: 5 packages, 0 advisories. |
| Project hygiene | Has security policy, licence file, contributing guide. Missing automated dependency updates, CodeQL. |
| OpenSSF Scorecard | Not scored: the project is not in Scorecard's weekly index. |
The raw findings
Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.
Secret candidates (3, redacted)
| Where | Rule | Match |
|---|---|---|
| integrations/agent-plugin-core/typescript/tests/lifecycle.test.ts:53 | private-key | -----B…--- (27 chars) |
| integrations/claude-code-plugin/tests/test_memory_core.py:905 | github-token | github…xyz (37 chars) |
| integrations/claude-code-plugin/tests/test_memory_core.py:906 | private-key | -----B…--- (27 chars) |
Pattern hits (9)
| Where | Rule | Match |
|---|---|---|
| .github/scripts/infer-component-labels.test.js:29 | very-long-line | 3367 chars |
| examples/nemoclaw/setup-mem0-nemoclaw.sh:9 | download-piped-to-shell (test/example) | # curl -fsSL https://raw.githubusercontent.com/mem0ai/mem0/main/scripts/setup-mem0-nemoclaw.sh | bash |
| examples/nemoclaw/setup-mem0-nemoclaw.sh:89 | download-piped-to-shell (test/example) | echo " curl -fsSL https://raw.githubusercontent.com/mem0ai/mem0/main/scripts/setup-mem0-nemoclaw.sh | bash" |
| examples/nemoclaw/setup-mem0-nemoclaw.sh:316 | persistence (test/example) | sudo systemctl enable --now docker |
| examples/nemoclaw/setup-mem0-nemoclaw.sh:440 | download-piped-to-shell (test/example) | curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && |
| examples/nemoclaw/setup-mem0-nemoclaw.sh:476 | download-piped-to-shell (test/example) | curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash |
| examples/nemoclaw/setup-mem0-nemoclaw.sh:483 | download-piped-to-shell (test/example) | # The NVIDIA installer (curl | bash) triggers npm tar race conditions |
| integrations/hermes-plugin-mem0/_setup.py:363 | download-piped-to-shell | print(" Ollama not found. Install it:\n curl -fsSL https://ollama.com/install.sh | sh\n Or on macOS: brew install ollama") |
| tests/test_oss_to_platform_migrate.py:557 | download-piped-to-shell (test/example) | ["bash", "-c", f"curl -fsSL file://{SCRIPT} | bash -s -- --help"], |
npm lifecycle scripts (2)
integrations/opencode-plugin/package.jsonprepack:bun run buildmem0-ts/src/oss/package.jsonprepare:npm run build
Worst known vulnerabilities (24 of 119)
| Advisory | Severity | Package | Summary |
|---|---|---|---|
| GHSA-82r6-8w77-94w6 | critical | anyio@4.9.0 | AnyIO: TLSStream IDNA 2003 host name encoding enables potential TLS certificate spoofing |
| GHSA-36p7-vc44-83pf | critical | chromadb@1.5.9 | ChromaDB has a code injection vulnerability |
| GHSA-f4j7-r4q5-qw2c | critical | chromadb@1.5.9 | ChromaDB Python project has a pre-authentication code injection vulnerability |
| GHSA-4xpc-pv4p-pm3w | critical | litellm@1.83.7 | LiteLLM: Authentication Bypass via Host Header Injection |
| GHSA-2v37-7h3g-55p8 | high | nanoid@3.3.16 | nanoid: custom generators can loop indefinitely when size is zero |
| GHSA-2883-xcg3-v3hh | high | js-yaml@3.15.1 | js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources |
| GHSA-2883-xcg3-v3hh | high | js-yaml@4.3.1 | js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources |
| GHSA-rgw5-rvv9-x895 | high | brace-expansion@5.0.8 | brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation |
| GHSA-mh99-v99m-4gvg | high | brace-expansion@1.1.16 | brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash |
| GHSA-rgw5-rvv9-x895 | high | brace-expansion@1.1.16 | brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation |
| GHSA-7q85-xj36-vmfc | high | adm-zip@0.6.0 | adm-zip: Uncontrolled memory allocation via the declared uncompressed size (DoS) |
| GHSA-rgj7-g3m4-5g8c | high | sharp@0.35.3 | sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545 |
| GHSA-cq5v-8q36-5273 | high | aiohttp@3.13.5 | AIOHTTP: Out-of-bounds heap read in C HTTP response parser error path (malformed chunked response) |
| GHSA-jm66-cg57-jjv5 | high | azure-core@1.35.0 | Azure Core is vulnerable to deserialization of untrusted data |
| GHSA-2wm9-hf6c-p5cr | high | chromadb@1.5.9 | ChromaDB allows any authenticated users to arbitrarily read, write, update, or delete data in any tenant's collection |
| GHSA-xph7-9rjv-w5fr | high | chromadb@1.5.9 | ChromaDB's SimpleRBACAuthorizationProvider doesn't check which tenant, database, or collection a permission applies to |
| GHSA-47fr-3ffg-hgmw | high | click@8.1.8 | |
| GHSA-537c-gmf6-5ccf | high | cryptography@45.0.5 | Vulnerable OpenSSL included in cryptography wheels |
| GHSA-g6cj-pr64-35w5 | high | cryptography@45.0.5 | cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing |
| GHSA-jwv3-5hgf-82ww | high | cryptography@45.0.5 | python-cryptography: Duplicate self-signed intermediates can cause exponential path-building |
| GHSA-r6ph-v2qm-q3c2 | high | cryptography@45.0.5 | cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves |
| GHSA-wh2j-26j7-9728 | high | google-cloud-aiplatform@1.71.1 | Google Cloud Vertex AI has a a vulnerability involving predictable bucket naming |
| GHSA-j5g9-f88f-gfj3 | high | httplib2@0.22.0 | httplib2: Decompression Bomb Denial of Service via Unbounded gzip/deflate Response Handling |
| GHSA-qh6h-p6c9-ff54 | high | langchain-core@0.3.86 | LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions |
Workflows worth a look
- .github/workflows/pr-gate.yml: pull_request_target
- .github/workflows/pr-labeler.yml: pull_request_target
- .github/workflows/vouch-check-pr.yml: pull_request_target
By the numbers
| Stars | 66K |
|---|---|
| Forks | 7,766 |
| Contributors | 408 |
| Commits | 2,666 |
| Open issues | 334 |
| Open pull requests | 416 |
| Releases | 416 |
| Latest release | ts-v3.3.1 |
| Licence | Apache-2.0 |
| Main language | Python |
| Project age | 3 years |
| Last push | Sep 25, 2026 |
| Tracked files | 1,824 |
| Lines of code | 325.3K |
| Checkout size | 36 MB |
Lines by language: Python 125.1K, TypeScript 107.2K, Markdown 62.7K, JSON 14.7K, Jupyter 3,924, YAML 3,264.
Questions
Is Mem0 free?
The open-source library, CLI and self-hosted server are Apache-2.0 and free for any use, including commercial. Mem0 also sells a hosted platform with managed storage and, per the README, retrieval optimizations the open-source SDK lacks. You still pay whichever model provider you point it at, unless that is a local model running on your own hardware.
Can Mem0 run fully locally?
Yes. Configure Ollama or another local model for fact extraction, a local embedding model, and the default Qdrant store stays on your machine. The defaults are OpenAI's gpt-5-mini and text-embedding-3-small, so a local setup takes a short config dictionary, and MEM0_TELEMETRY=false stops the one remaining outbound call, the anonymous usage events.
How is Mem0 different from keeping the chat history in the prompt?
History grows until it no longer fits and costs tokens on every turn. Mem0 stores distilled facts instead and retrieves only those relevant to the current message, combining semantic, keyword and entity matching. The trade-off is an extra model call each time you add memories, and extraction can drop or misstate a detail a full transcript would have kept.
This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.
