What Mem0 adds that prompts cannot solve
A standard AI agent has no memory. Every conversation starts from zero context. You can stuff previous messages into the prompt, but that gets expensive and hits context limits fast. Mem0 works differently: as the conversation progresses, it extracts key facts ('user prefers Python 3.12', 'deployment target is Vercel', 'budget is under $100/month') and stores them in a vector database. On the next session, Mem0 retrieves relevant memories and injects them into the system prompt automatically. The agent now 'remembers' without you managing conversation history manually.
Integration: 5 lines of Python, 3 API calls
`from mem0 import Memory; m = Memory(); m.add('User prefers dark mode and Python examples', user_id='alex'); results = m.search('code examples', user_id='alex')`. Three API calls: add memory, search memory, get all memories for a user. The search uses semantic similarity, so 'code samples' matches 'Python examples' even though the words are different. The memory is scoped by user_id, agent_id, or session_id. You control what context is available to which agent. For saas.pet, I would scope newsletter preferences per subscriber and code review history per GitHub repo.
Self-hosted vs cloud: the privacy decision
Cloud (mem0.ai): free tier gives 10,000 memories and 1,000 searches per month. Privacy model: your data is on their servers. Self-hosted: use Mem0 with your own vector database (Qdrant, Pinecone, Weaviate, or Chroma) and your own embedding model. The `mem0ai/mem0` pip package supports both modes with a config switch. For customer data, I would self-host. For internal tools, the cloud version is fine and saves 30 minutes of setup. The self-hosted version needs about 2GB RAM for the vector DB plus embedding model.
What it remembers and what it should not
Mem0 is good at remembering: user preferences (language, format, style), factual statements ('our API limit is 1000 req/min'), learned patterns ('Alex usually deploys on Vercel, not Netlify'). It is bad at: long-term context across 100+ conversations (memories become noisy), nuanced preferences that change over time ('I used to prefer X but now prefer Y'), and anything that requires reasoning over multiple memories ('because Alex prefers Python and deploys to Vercel, suggest serverless Python frameworks'). The quality depends heavily on your embedding model. I used OpenAI's text-embedding-3-small and got good results.
Mem0 vs LangChain Memory vs raw vector DB
Mem0 is purpose-built for memory. It handles extraction (deciding what to remember), deduplication (not storing the same fact twice), and retrieval (finding relevant memories). LangChain's ConversationBufferMemory is simpler: it just stores full conversation history in a buffer. This works for short-term memory but does not scale. Building memory with a raw vector DB (Pinecone, Qdrant) gives maximum control but requires you to write extraction logic, deduplication, and retrieval yourself. Mem0 is the right abstraction level: you get memory features without building a memory system from scratch.