How robersonnaves/mem0 works
Mem0 is a long-term memory layer for AI agents, available as an OSS library, hosted API, self-hosted service, CLI and agent integrations. Its main workflow accepts scoped messages, extracts and embeds memories, stores them for later search, and returns relevant context; the platform client also exposes retrieval and management operations. The graph includes the README’s major deployment and access branches. Core calls are supported by sampled source; some server, dashboard and integration wiring is based on documented capabilities and tree structure, not sampled implementation.
Main entry points: memory/main.py Memory extraction · server/main.py Self-hosted API · proxy/main.py Chat proxy · client/main.py Python platform client
Components 21
Memory engine
- Memory API
mem0/memory/main.py - Memory extraction
mem0/memory/main.py - Memory search
mem0/memory/main.py
Model and storage providers
- Embedding providers
mem0/embeddings - LLM providers
mem0/llms - Vector stores
mem0/vector_stores - History and messages
mem0/memory/storage.py - Rerankers
mem0/reranker
SDK and CLI access
- Python platform client
mem0/client/main.py - TypeScript SDK
mem0-ts/src/client/mem0.ts - Mem0 CLI
cli/python/src/mem0_cli/app.py - Chat proxy
mem0/proxy/main.py
Self-hosted service
- Self-hosted API
server/main.py - Auth and API keys
server/auth.py - Management routes
server/routers - Admin dashboard
server/dashboard/src/app/(root)/dashboard
Agent integrations
- Agent plugins
integrations/agent-plugin-core - OpenClaw integration
integrations/openclaw/index.ts
Other components
- Developer or agent
- Mem0 Platform API
- AI agent
Connections 28
- Developer or agent → Memory API: submits messages
- Memory API → Memory extraction: extracts facts
- Memory extraction → LLM providers: requests extraction
- Memory extraction → Embedding providers: embeds facts
- Memory extraction → Vector stores: stores memories
- Memory extraction → History and messages: saves messages
- Memory API → Memory search: searches memories
- Memory search → Embedding providers: embeds query
- Memory search → Vector stores: retrieves candidates
- Memory search → Rerankers: reranks results
- Memory API → Developer or agent: returns memories
- Developer or agent → Python platform client: calls SDK
- Developer or agent → TypeScript SDK: calls SDK
- Developer or agent → Mem0 CLI: runs commands
- Python platform client → Mem0 Platform API: sends API requests
- TypeScript SDK → Mem0 Platform API: sends API requests
- Mem0 CLI → Mem0 Platform API: manages memories
- Mem0 Platform API → Chat proxy: serves client calls
- Developer or agent → Chat proxy: uses chat API
- Chat proxy → Memory API: adds and searches
- Developer or agent → Self-hosted API: calls self-hosted API
- Self-hosted API → Auth and API keys: checks access
- Self-hosted API → Management routes: mounts routes
- Admin dashboard → Self-hosted API: manages service
- AI agent → Agent plugins: uses integration
- Agent plugins → Mem0 Platform API: accesses memory API
- AI agent → OpenClaw integration: uses integration
- OpenClaw integration → Mem0 Platform API: recalls and captures