6 min read

Mem0: Long-Term Memory for AI Agents (GitHub, Scanned)

Long-term memory for AI agents: it extracts facts from conversations and recalls the relevant ones later.

Mem0 logo
✅
Scan: safe. Nothing malicious. Two things to know: anonymous usage telemetry goes to PostHog until you set MEM0_TELEMETRY=false, and the default configuration sends your conversations to OpenAI to extract memories. Scanned Sep 25, 2026; the full report is below.

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 mem0ai

2. Or the TypeScript SDK

npm install mem0ai

3. 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 bootstrap

The 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

CheckResult
Secrets3 candidates found and read; see the notes above.
Suspicious code9 pattern hits found and read; every one is listed under the raw findings.
Install-time code2 npm lifecycle scripts
Committed binariesNone.
CI workflows34 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 hosts40 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 vulnerabilities119 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 hygieneHas security policy, licence file, contributing guide. Missing automated dependency updates, CodeQL.
OpenSSF ScorecardNot 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)
WhereRuleMatch
integrations/agent-plugin-core/typescript/tests/lifecycle.test.ts:53private-key-----B…--- (27 chars)
integrations/claude-code-plugin/tests/test_memory_core.py:905github-tokengithub…xyz (37 chars)
integrations/claude-code-plugin/tests/test_memory_core.py:906private-key-----B…--- (27 chars)
Pattern hits (9)
WhereRuleMatch
.github/scripts/infer-component-labels.test.js:29very-long-line3367 chars
examples/nemoclaw/setup-mem0-nemoclaw.sh:9download-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:89download-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:316persistence (test/example)sudo systemctl enable --now docker
examples/nemoclaw/setup-mem0-nemoclaw.sh:440download-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:476download-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:483download-piped-to-shell (test/example)# The NVIDIA installer (curl | bash) triggers npm tar race conditions
integrations/hermes-plugin-mem0/_setup.py:363download-piped-to-shellprint(" 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:557download-piped-to-shell (test/example)["bash", "-c", f"curl -fsSL file://{SCRIPT} | bash -s -- --help"],
npm lifecycle scripts (2)
  • integrations/opencode-plugin/package.json prepack: bun run build
  • mem0-ts/src/oss/package.json prepare: npm run build
Worst known vulnerabilities (24 of 119)
AdvisorySeverityPackageSummary
GHSA-82r6-8w77-94w6criticalanyio@4.9.0AnyIO: TLSStream IDNA 2003 host name encoding enables potential TLS certificate spoofing
GHSA-36p7-vc44-83pfcriticalchromadb@1.5.9ChromaDB has a code injection vulnerability
GHSA-f4j7-r4q5-qw2ccriticalchromadb@1.5.9ChromaDB Python project has a pre-authentication code injection vulnerability
GHSA-4xpc-pv4p-pm3wcriticallitellm@1.83.7LiteLLM: Authentication Bypass via Host Header Injection
GHSA-2v37-7h3g-55p8highnanoid@3.3.16nanoid: custom generators can loop indefinitely when size is zero
GHSA-2883-xcg3-v3hhhighjs-yaml@3.15.1js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources
GHSA-2883-xcg3-v3hhhighjs-yaml@4.3.1js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources
GHSA-rgw5-rvv9-x895highbrace-expansion@5.0.8brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation
GHSA-mh99-v99m-4gvghighbrace-expansion@1.1.16brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash
GHSA-rgw5-rvv9-x895highbrace-expansion@1.1.16brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation
GHSA-7q85-xj36-vmfchighadm-zip@0.6.0adm-zip: Uncontrolled memory allocation via the declared uncompressed size (DoS)
GHSA-rgj7-g3m4-5g8chighsharp@0.35.3sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545
GHSA-cq5v-8q36-5273highaiohttp@3.13.5AIOHTTP: Out-of-bounds heap read in C HTTP response parser error path (malformed chunked response)
GHSA-jm66-cg57-jjv5highazure-core@1.35.0Azure Core is vulnerable to deserialization of untrusted data
GHSA-2wm9-hf6c-p5crhighchromadb@1.5.9ChromaDB allows any authenticated users to arbitrarily read, write, update, or delete data in any tenant's collection
GHSA-xph7-9rjv-w5frhighchromadb@1.5.9ChromaDB's SimpleRBACAuthorizationProvider doesn't check which tenant, database, or collection a permission applies to
GHSA-47fr-3ffg-hgmwhighclick@8.1.8
GHSA-537c-gmf6-5ccfhighcryptography@45.0.5Vulnerable OpenSSL included in cryptography wheels
GHSA-g6cj-pr64-35w5highcryptography@45.0.5cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
GHSA-jwv3-5hgf-82wwhighcryptography@45.0.5python-cryptography: Duplicate self-signed intermediates can cause exponential path-building
GHSA-r6ph-v2qm-q3c2highcryptography@45.0.5cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves
GHSA-wh2j-26j7-9728highgoogle-cloud-aiplatform@1.71.1Google Cloud Vertex AI has a a vulnerability involving predictable bucket naming
GHSA-j5g9-f88f-gfj3highhttplib2@0.22.0httplib2: Decompression Bomb Denial of Service via Unbounded gzip/deflate Response Handling
GHSA-qh6h-p6c9-ff54highlangchain-core@0.3.86LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions
Workflows worth a look

By the numbers

Stars66K
Forks7,766
Contributors408
Commits2,666
Open issues334
Open pull requests416
Releases416
Latest releasets-v3.3.1
LicenceApache-2.0
Main languagePython
Project age3 years
Last pushSep 25, 2026
Tracked files1,824
Lines of code325.3K
Checkout size36 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.