{"id":13455934,"url":"https://github.com/mem0ai/mem0","last_synced_at":"2026-05-27T19:01:02.702Z","repository":{"id":176348497,"uuid":"656099147","full_name":"mem0ai/mem0","owner":"mem0ai","description":"Universal memory layer for AI Agents","archived":false,"fork":false,"pushed_at":"2026-05-21T15:59:25.000Z","size":55888,"stargazers_count":56356,"open_issues_count":399,"forks_count":6417,"subscribers_count":227,"default_branch":"main","last_synced_at":"2026-05-21T16:51:36.757Z","etag":null,"topics":["agents","ai","ai-agents","application","chatbots","chatgpt","genai","llm","long-term-memory","memory","memory-management","python","rag","state-management"],"latest_commit_sha":null,"homepage":"https://mem0.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mem0ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2023-06-20T08:58:36.000Z","updated_at":"2026-05-21T16:47:44.000Z","dependencies_parsed_at":"2023-09-26T22:42:54.333Z","dependency_job_id":"c83b3d66-b9e0-4059-95bf-497c2102adaa","html_url":"https://github.com/mem0ai/mem0","commit_stats":{"total_commits":1044,"total_committers":143,"mean_commits":7.300699300699301,"dds":0.8218390804597702,"last_synced_commit":"3914f4d6ac4ab1bc3da5174c559ad43b13f005e0"},"previous_names":["embedchain/embedchain"],"tags_count":323,"template":false,"template_full_name":null,"purl":"pkg:github/mem0ai/mem0","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mem0ai%2Fmem0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mem0ai%2Fmem0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mem0ai%2Fmem0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mem0ai%2Fmem0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mem0ai","download_url":"https://codeload.github.com/mem0ai/mem0/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mem0ai%2Fmem0/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33456263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","ai-agents","application","chatbots","chatgpt","genai","llm","long-term-memory","memory","memory-management","python","rag","state-management"],"created_at":"2024-07-31T08:01:13.654Z","updated_at":"2026-05-27T19:01:02.678Z","avatar_url":"https://github.com/mem0ai.png","language":"Python","funding_links":[],"categories":["AI Agent Frameworks","Python","🧠 エージェントメモリ","AI \u0026 LLM","🧺 Curated catalog","NLP","Addons, extensions, plug-ins for integrating LLM into third-party applications","AI Memory and Context","Chatbots \u0026 Virtual Companions","🏗️ Reference Implementations \u0026 Case Studies","Applications","Memory Management","Projects","Repos","Personalization \u0026 User Memory","APIs","推理 Inference","Design Primitives","Runtime","HarmonyOS","Learning","🛠️ Tools \u0026 Projects","Industry Strength Information Retrieval","📊 Data and Research Agents","LLM Ops","⚙️ Agent Operations","chatgpt","🌟 Hidden Gems: Underrated Tools","AI Agent Optimized VDBs","📋 List of Open-Source Projects","Memory Systems","Librerías para usar NLP en español","✍️ Write Context","Personal Assistants \u0026 Conversational Agents","3. **Real-World Applications**","MCP \u0026 Model Context Protocol","\u003ca name=\"Python\"\u003e\u003c/a\u003ePython","🧠 AI Applications \u0026 Platforms","5. Agent Memory","🛠️ Memory Apps \u0026 Tools","🛠️ Tools and Frameworks (Memory Infrastructure)","Table of Contents","Knowledge Graphs and Memory","🧐 Memory \u0026 Persistence","AI and Agents","State \u0026 Memory","Tools","🧩 Agent Frameworks \u0026 Dev Libraries","2. The Design of the Harness","2. Systems \u0026 Frameworks (stateful agents / memory managers)","Memory, State, and Communication","🤖 AI \u0026 Machine Learning","Open-source repos","Supporting Infrastructure","LLM Application / RAG","🛠️ Hands-on Projects and Examples","4. Agentic AI \u0026 Multi-Agent Systems","Agent Memory \u0026 Stateful Context","Memory","Agent Infrastructure"],"sub_categories":["General Agent Frameworks","その他の標準","RAG \u0026 Vector Search","Memory","Other user interfaces","T9 · Memory","Advanced Components","AI Agents \u0026 Templates","Memory \u0026 State","Tool","Windows Manager","Repositories","Memory \u0026 Compression","RAG and Knowledge Bases","Other Cloud Provider Credits","🧠 Memory","Resources","Agents","Vector Store Tutorials","Modelos de Embeddings para Sentence Similarity y Semantic Search","Long-term memory","Virtual Assistants","Agent Memory \u0026 Context","Tools","Rust","Knowledge Management","AI Utilities","Benchmark Reality Check (real-world tool use)","Long-term Memory Systems","Memory Management","Specialized Agent Libraries","2.2. Memory Systems","📑 Key Frameworks \u0026 Code Samples","Frameworks \u0026 Tools"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/mem0ai/mem0\"\u003e\n    \u003cimg src=\"docs/images/banner-sm.png\" width=\"800px\" alt=\"Mem0 - The Memory Layer for Personalized AI\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\" style=\"display: flex; justify-content: center; gap: 20px; align-items: center;\"\u003e\n  \u003ca href=\"https://trendshift.io/repositories/11194\" target=\"blank\"\u003e\n    \u003cimg src=\"https://trendshift.io/api/badge/repositories/11194\" alt=\"mem0ai%2Fmem0 | Trendshift\" width=\"250\" height=\"55\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://mem0.ai\"\u003eLearn more\u003c/a\u003e\n  ·\n  \u003ca href=\"https://mem0.dev/DiG\"\u003eJoin Discord\u003c/a\u003e\n  ·\n  \u003ca href=\"https://mem0.dev/demo\"\u003eDemo\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://mem0.dev/DiG\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Discord-%235865F2.svg?\u0026logo=discord\u0026logoColor=white\" alt=\"Mem0 Discord\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/mem0ai\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/dm/mem0ai\" alt=\"Mem0 PyPI - Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/mem0ai/mem0\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/commit-activity/m/mem0ai/mem0?style=flat-square\" alt=\"GitHub commit activity\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/mem0ai\" target=\"blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/mem0ai?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/mem0ai\" target=\"blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/mem0ai\" alt=\"Npm package\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.ycombinator.com/companies/mem0\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Y%20Combinator-S24-orange?style=flat-square\" alt=\"Y Combinator S24\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://mem0.ai/research\"\u003e\u003cstrong\u003e📄 Benchmarking Mem0's token-efficient memory algorithm →\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## New Memory Algorithm (April 2026)\n\n| Benchmark | Old | New  | Tokens  | Latency p50  |\n| --- | --- | --- | --- | --- |\n| **LoCoMo** | 71.4 | **91.6** | 7.0K  | 0.88s  |\n| **LongMemEval** | 67.8 | **94.8** | 6.8K  | 1.09s  |\n| **BEAM (1M)** | — | **64.1** | 6.7K  | 1.00s  |\n| **BEAM (10M)** | — | **48.6** | 6.9K  | 1.05s  |\n\nAll benchmarks run on the same production-representative model stack. Single-pass retrieval (one call, no agentic loops).\n\n**What changed:**\n- **Single-pass ADD-only extraction** -- one LLM call, no UPDATE/DELETE. Memories accumulate; nothing is overwritten.\n- **Agent-generated facts are first-class** -- when an agent confirms an action, that information is now stored with equal weight.\n- **Entity linking** -- entities are extracted, embedded, and linked across memories for retrieval boosting.\n- **Multi-signal retrieval** -- semantic, BM25 keyword, and entity matching scored in parallel and fused.\n- **Temporal Reasoning** -- time-aware retrieval that ranks the right dated instance for queries about current state, past events, and upcoming plans.\n\nSee the [migration guide](https://docs.mem0.ai/migration/oss-v2-to-v3) for upgrade instructions. The [evaluation framework](https://github.com/mem0ai/memory-benchmarks) is open-sourced so anyone can reproduce the numbers.\n\n## Research Highlights\n- **91.6 on LoCoMo** -- +20 points over the previous algorithm\n- **94.8 on LongMemEval** -- +27 points, with +53.6 on assistant memory recall\n- **64.1 on BEAM (1M)** -- production-scale memory evaluation at 1M tokens\n- [Read the full paper](https://mem0.ai/research)\n\n# Introduction\n\n[Mem0](https://mem0.ai) (\"mem-zero\") enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions. It remembers user preferences, adapts to individual needs, and continuously learns over time—ideal for customer support chatbots, AI assistants, and autonomous systems.\n\n### Key Features \u0026 Use Cases\n\n**Core Capabilities:**\n- **Multi-Level Memory**: Seamlessly retains User, Session, and Agent state with adaptive personalization\n- **Developer-Friendly**: Intuitive API, cross-platform SDKs, and a fully managed service option\n\n**Applications:**\n- **AI Assistants**: Consistent, context-rich conversations\n- **Customer Support**: Recall past tickets and user history for tailored help\n- **Healthcare**: Track patient preferences and history for personalized care\n- **Productivity \u0026 Gaming**: Adaptive workflows and environments based on user behavior\n\n## 🚀 Quickstart Guide \u003ca name=\"quickstart\"\u003e\u003c/a\u003e\n\n### Sign up as an agent\n\nAI agents can mint a working Mem0 API key in under five seconds — no email, no dashboard, no OTP. Four commands end-to-end:\n\n```bash\n# 1. Install\nnpm install -g @mem0/cli      # or: pip install mem0-cli\n\n# 2. Sign up as an agent (replace `claude-code` with your name)\nmem0 init --agent --agent-caller claude-code\n\n# 3. Add a memory\nmem0 add \"I am using mem0\"\n\n# 4. Search\nmem0 search \"am I using mem0\"\n```\n\nThe human owner can claim the account later with `mem0 init --email \u003ctheir-email\u003e` — same key, memories preserved. Full guide: [Sign up as an agent](https://docs.mem0.ai/platform/agent-signup).\n\n| | Library | Self-Hosted Server | Cloud Platform |\n|---|---------|-------------------|----------------|\n| **Best for** | Testing, prototyping | Teams running on their own infrastructure | Zero-ops production use |\n| **Setup** | `pip install mem0ai` | `docker compose up` | Sign up at [app.mem0.ai](https://app.mem0.ai?utm_source=oss\u0026utm_medium=readme) |\n| **Dashboard** | -- | [Yes](https://docs.mem0.ai/open-source/setup) | Yes |\n| **Auth \u0026 API Keys** | -- | Yes | Yes |\n| **Advanced Features** | -- | Teasers | All included |\n\nJust testing? Use the library. Building for a team? Self-hosted. Want zero ops? Cloud.\n\n### Library (pip / npm)\n\n```bash\npip install mem0ai\n```\n\nFor enhanced hybrid search with BM25 keyword matching and entity extraction, install with NLP support:\n\n```bash\npip install mem0ai[nlp]\npython -m spacy download en_core_web_sm\n```\n\nInstall sdk via npm:\n\n```bash\nnpm install mem0ai\n```\n\n### Self-Hosted Server\n\n\u003e **Note:** Self-hosted auth is on by default. Upgrading from a pre-auth build? Set `ADMIN_API_KEY`, register an admin through the wizard, or `AUTH_DISABLED=true` for local dev only. See [upgrade notes](https://docs.mem0.ai/open-source/setup#upgrade-notes).\n\n```bash\n# Recommended: one command — start the stack, create an admin, issue the first API key.\ncd server \u0026\u0026 make bootstrap\n\n# Manual: start the stack and finish setup via the browser wizard.\ncd server \u0026\u0026 docker compose up -d    # http://localhost:3000\n```\n\nSee the [self-hosted docs](https://docs.mem0.ai/open-source/overview) for configuration.\n\n### Cloud Platform\n\n1. Sign up on [Mem0 Platform](https://app.mem0.ai?utm_source=oss\u0026utm_medium=readme)\n2. Embed the memory layer via SDK or API keys\n3. Using hosted Qdrant vectors? See the [Platform migration guide](https://docs.mem0.ai/migration/oss-to-platform) to import them into Mem0 Platform.\n\n### CLI\n\nManage memories from your terminal:\n\n```bash\nnpm install -g @mem0/cli   # or: pip install mem0-cli\n\nmem0 init\nmem0 add \"Prefers dark mode and vim keybindings\" --user-id alice\nmem0 search \"What does Alice prefer?\" --user-id alice\n```\n\nSee the [CLI documentation](https://docs.mem0.ai/platform/cli) for the full command reference.\n\n### Agent Skills\n\nTeach your AI coding assistant (Claude Code, Codex, Cursor, Windsurf, OpenCode, OpenClaw, and any tool that supports the skills standard) how to build with Mem0. Two categories:\n\n**Reference skills — always on** (SDK knowledge loaded into the assistant's context):\n\n```bash\nnpx skills add https://github.com/mem0ai/mem0 --skill mem0\nnpx skills add https://github.com/mem0ai/mem0 --skill mem0-cli\nnpx skills add https://github.com/mem0ai/mem0 --skill mem0-vercel-ai-sdk\n```\n\n**Pipeline skills — run on demand** (execute an end-to-end workflow in an existing repo):\n\n```bash\nnpx skills add https://github.com/mem0ai/mem0 --skill mem0-integrate\nnpx skills add https://github.com/mem0ai/mem0 --skill mem0-test-integration\n```\n\nUse `/mem0-integrate` to wire Mem0 into an existing repo via a test-first pipeline, then `/mem0-test-integration` to verify. See the [skills catalog](./skills/) or [Vibecoding with Mem0](https://docs.mem0.ai/vibecoding) for the full picture.\n\n### Basic Usage\n\nMem0 requires an LLM to function, with `gpt-5-mini` from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to our [Supported LLMs documentation](https://docs.mem0.ai/components/llms/overview).\n\nMem0 uses `text-embedding-3-small` from OpenAI as the default embedding model. For best results with hybrid search (semantic + keyword + entity boosting), we recommend using at least [Qwen 600M](https://huggingface.co/Alibaba-NLP/gte-Qwen2-1.5B-instruct) or a comparable embedding model. See [Supported Embeddings](https://docs.mem0.ai/components/embedders/overview) for configuration details.\n\nFirst step is to instantiate the memory:\n\n```python\nfrom openai import OpenAI\nfrom mem0 import Memory\n\nopenai_client = OpenAI()\nmemory = Memory()\n\ndef chat_with_memories(message: str, user_id: str = \"default_user\") -\u003e str:\n    # Retrieve relevant memories\n    relevant_memories = memory.search(query=message, filters={\"user_id\": user_id}, top_k=3)\n    memories_str = \"\\n\".join(f\"- {entry['memory']}\" for entry in relevant_memories[\"results\"])\n\n    # Generate Assistant response\n    system_prompt = f\"You are a helpful AI. Answer the question based on query and memories.\\nUser Memories:\\n{memories_str}\"\n    messages = [{\"role\": \"system\", \"content\": system_prompt}, {\"role\": \"user\", \"content\": message}]\n    response = openai_client.chat.completions.create(model=\"gpt-5-mini\", messages=messages)\n    assistant_response = response.choices[0].message.content\n\n    # Create new memories from the conversation\n    messages.append({\"role\": \"assistant\", \"content\": assistant_response})\n    memory.add(messages, user_id=user_id)\n\n    return assistant_response\n\ndef main():\n    print(\"Chat with AI (type 'exit' to quit)\")\n    while True:\n        user_input = input(\"You: \").strip()\n        if user_input.lower() == 'exit':\n            print(\"Goodbye!\")\n            break\n        print(f\"AI: {chat_with_memories(user_input)}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\nFor detailed integration steps, see the [Quickstart](https://docs.mem0.ai/quickstart) and [API Reference](https://docs.mem0.ai/api-reference).\n\n## 🔗 Integrations \u0026 Demos\n\n- **ChatGPT with Memory**: Personalized chat powered by Mem0 ([Live Demo](https://mem0.dev/demo))\n- **Browser Extension**: Store memories across ChatGPT, Perplexity, and Claude ([Chrome Extension](https://chromewebstore.google.com/detail/onihkkbipkfeijkadecaafbgagkhglop?utm_source=item-share-cb))\n- **Langgraph Support**: Build a customer bot with Langgraph + Mem0 ([Guide](https://docs.mem0.ai/integrations/langgraph))\n- **CrewAI Integration**: Tailor CrewAI outputs with Mem0 ([Example](https://docs.mem0.ai/integrations/crewai))\n\n## 📚 Documentation \u0026 Support\n\n- Full docs: https://docs.mem0.ai\n- Community: [Discord](https://mem0.dev/DiG) · [X (formerly Twitter)](https://x.com/mem0ai)\n- Contact: founders@mem0.ai\n\n## Citation\n\nWe now have a paper you can cite:\n\n```bibtex\n@article{mem0,\n  title={Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory},\n  author={Chhikara, Prateek and Khant, Dev and Aryan, Saket and Singh, Taranjeet and Yadav, Deshraj},\n  journal={arXiv preprint arXiv:2504.19413},\n  year={2025}\n}\n```\n\n## ⚖️ License\n\nApache 2.0 — see the [LICENSE](https://github.com/mem0ai/mem0/blob/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmem0ai%2Fmem0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmem0ai%2Fmem0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmem0ai%2Fmem0/lists"}