Mem0: A Personalization Layer Your Assistant Remembers With
Add user, session, and agent-level memory to an assistant so it remembers preferences across conversations.
Run this workflow
CI-verified, 2/2 fixtures passing.
Build this with your agent
One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.
Intended Use
Adding cross-conversation memory to a chatbot or assistant: Mem0 extracts facts from a chat and retrieves the relevant ones next turn. CI installs the SDK and verifies the Memory class imports cleanly. Extraction and retrieval (add/search) run an LLM plus an embedder, OpenAI by default, so they're fenced and need your key.
Not for
- Fully offline use, Mem0's default extract/retrieve path calls a hosted model
- Expecting CI to verify add() and search(), those are the model-driven steps
The Stack
Tested Against
mem0ai@latestpython@3.12Side effects & data flow
- Network
- PyPI, install only (model calls only in the fenced step)
- Writes
- ./.venv/
- Credentials
- LLM API key, for the fenced add/search steps only
Prerequisites
- Python 3.10+
- pip
- An LLM API key for the add/search steps (OpenAI by default)
Steps
- 1
Install the SDK and verify it imports
pip install mem0ai, then confirm the Memory class is importable. That's the deterministic spine: the dependency tree resolves and the SDK loads. CI runs exactly this, no key.
python3 -m venv .venv .venv/bin/pip install -q mem0ai .venv/bin/python - <<'EOF' from mem0 import Memory assert callable(Memory), "Memory is not a class/callable" print("mem0 imports OK: Memory class available") EOF - 2
Add and search memories (the model step, not checked by CI)
memory.add("Prefers vim keybindings and dark mode", user_id="alice") then memory.search(query=..., filters=...). Both extract/retrieve with an LLM and an embedder (OpenAI by default), so set your key first; CI never claims this part.
Eval, 2 fixtures
Last passed: verified todayimportscontainstimeout 900s · max $0Expected:
mem0 imports OK: Memory class availableclean-exitexit_codetimeout 900s · max $0Expected:
0
Results
YC-backed, one of the most popular open-source memory repos.
Did this work for you?
Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.
Related workflows
- One shared memory for every coding agent: prove the configs actually point at the same server
- Validate a WrenAI semantic model's references before an agent queries through it
- Wire the DeepWiki MCP into your agent so it looks up repos instead of hallucinating
- Verify an agent-skills plugin before you ship or install it
- WebMCP: declare a site's agent tools, and gate the ones that spend money
- Wire GLM-5.2 into Hermes: valid route, 64k-context check, no key in config
Liked this workflow?
Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).