AI Agent Hub
AI エージェント / プラグイン情報メディア
← 一覧へ
Mem0
OTHER

Mem0

Mem0

AI エージェント向けの統一メモリレイヤー。トークン効率的なアルゴリズムにより、長期記憶と状態管理を実現し、チャットボットや LLM ベースのアプリケーションの個別化を支援します。

原文: Universal memory layer for AI Agents
#長期記憶#AI エージェント#Python#agents#ai#ai-agents#application#chatbots#chatgpt#genai#llm#long-term-memory
REPO STATS

リポジトリ統計

⭐ Stars
55.3k
🍴 Forks
6.3k
⚠️ Open Issues
322
🌿 Language
Python
📄 License
Apache-2.0
🕒 最終更新
2026.05.10 (1日前)
📅 公開日
2023.06.20
🌿 Branch
main
README

ドキュメント

— AI による自動翻訳 (2026.05.11 更新)

Mem0 - The Memory Layer for Personalized AI

mem0ai%2Fmem0 | Trendshift

詳しく学ぶ · Discord に参加 · デモ

Mem0 Discord Mem0 PyPI - ダウンロード GitHub コミットアクティビティ パッケージバージョン npm パッケージ Y Combinator S24

📄 Mem0 のトークン効率的なメモリアルゴリズムのベンチマーク →

新しいメモリアルゴリズム(2026年4月)

ベンチマーク トークン レイテンシ p50
LoCoMo 71.4 91.6 7.0K 0.88s
LongMemEval 67.8 93.4 6.8K 1.09s
BEAM (1M) 64.1 6.7K 1.00s
BEAM (10M) 48.6 6.9K 1.05s

すべてのベンチマークは同じ本番環境を想定したモデルスタック上で実行されます。シングルパス検索(1 回の呼び出し、エージェンティックループなし)です。

変わったこと:

  • シングルパス ADD のみの抽出 -- 1 回の LLM 呼び出しで、UPDATE/DELETE はありません。メモリは蓄積され、上書きされません。
  • エージェント生成ファクトは一級市民です -- エージェントがアクションを確認するとき、その情報は同等の重みで保存されるようになりました。
  • エンティティ リンキング -- エンティティは抽出、埋め込まれ、検索ブーストのためにメモリ全体でリンクされます。
  • マルチシグナル検索 -- セマンティック、BM25 キーワード、エンティティマッチングが並列でスコアリングおよび統合されます。

移行ガイドを参照してアップグレード手順を確認してください。評価フレームワークはオープンソース化されているため、誰でも数値を再現できます。

研究のハイライト

  • LoCoMo で 91.6 -- 前のアルゴリズムより +20 ポイント
  • LongMemEval で 93.4 -- +26 ポイント、アシスタントメモリ リコール で +53.6
  • BEAM (1M) で 64.1 -- 100万トークンでの本番規模メモリ評価
  • フルペーパーを読む

はじめに

Mem0(「メム・ゼロ」)は、インテリジェントなメモリレイヤーで AI アシスタントとエージェントを強化し、パーソナライズされた AI インタラクションを可能にします。ユーザーの好みを記憶し、個々のニーズに適応し、時間とともに継続的に学習します。カスタマーサポート チャットボット、AI アシスタント、自律システムに最適です。

主な機能とユースケース

コア機能:

  • マルチレベル メモリ:ユーザー、セッション、エージェント状態を適応的なパーソナライゼーションでシームレスに保持します
  • 開発者フレンドリー:直感的な API、クロスプラットフォーム SDK、フル マネージド サービス オプション

応用:

  • AI アシスタント:一貫性のある、コンテキスト豊富な会話
  • カスタマーサポート:過去のチケットとユーザー履歴を思い出して、カスタマイズされたサポートを提供
  • ヘルスケア:患者の好みと履歴を追跡して、パーソナライズされたケアを提供
  • 生産性とゲーム:ユーザー行動に基づいた適応型ワークフローと環境

🚀 クイックスタートガイド

ライブラリ セルフホステッド サーバー クラウド プラットフォーム
最適用途 テスト、プロトタイピング 自社インフラストラクチャで実行するチーム ゼロオプス本番運用
セットアップ pip install mem0ai docker compose up app.mem0.ai でサインアップ
ダッシュボード -- あり あり
認証と API キー -- あり あり
高度な機能 -- プレビュー すべて含まれる

テストだけですか?ライブラリを使用してください。チーム向けですか?セルフホスト。ゼロオプスが必要ですか?クラウド。

ライブラリ (pip / npm)

pip install mem0ai

BM25 キーワードマッチングとエンティティ抽出を備えたハイブリッド検索を強化するには、NLP サポート付きでインストールしてください。

pip install mem0ai[nlp]
python -m spacy download en_core_web_sm

npm を使用して SDK をインストールしてください。

npm install mem0ai

セルフホステッド サーバー

注意: セルフホスト認証はデフォルトで有効です。認証前のビルドからアップグレードしていますか? ADMIN_API_KEY を設定するか、ウィザードを使用して管理者を登録するか、ローカル開発のみの場合は AUTH_DISABLED=true を設定してください。アップグレード ノート を参照してください。

# Recommended: one command — start the stack, create an admin, issue the first API key.
cd server && make bootstrap

# Manual: start the stack and finish setup via the browser wizard.
cd server && docker compose up -d    # http://localhost:3000

セルフホスト ドキュメント で構成を確認してください。

クラウド プラットフォーム

  1. Mem0 プラットフォーム にサインアップしてください
  2. SDK または API キーを使用してメモリ レイヤーを埋め込みます

CLI

ターミナルからメモリを管理してください。

npm install -g @mem0/cli   # or: pip install mem0-cli

mem0 init
mem0 add "Prefers dark mode and vim keybindings" --user-id alice
mem0 search "What does Alice prefer?" --user-id alice

完全なコマンド リファレンスについては、CLI ドキュメント を参照してください。

エージェント スキル

AI コーディング アシスタント (Claude Code、Codex、Cursor、Windsurf、OpenCode、OpenClaw、スキル標準をサポートするその他のツール) に Mem0 でビルドする方法を教えてください。2 つのカテゴリがあります。

参考スキル — 常に有効 (SDK 知識がアシスタントのコンテキストに読み込まれています):

npx skills add https://github.com/mem0ai/mem0 --skill mem0
npx skills add https://github.com/mem0ai/mem0 --skill mem0-cli
npx skills add https://github.com/mem0ai/mem0 --skill mem0-vercel-ai-sdk

パイプライン スキル — オンデマンド実行 (既存のリポジトリでエンドツーエンドのワークフローを実行):

npx skills add https://github.com/mem0ai/mem0 --skill mem0-integrate
npx skills add https://github.com/mem0ai/mem0 --skill mem0-test-integration

/mem0-integrate を使用して Mem0 をテストファースト パイプライン経由で既存のリポジトリに統合し、/mem0-test-integration を使用して確認してください。詳細については、スキル カタログ または Mem0 を使用した Vibecoding を参照してください。

基本的な使い方

Mem0 は機能するために LLM が必要で、デフォルトは OpenAI の gpt-5-mini です。ただし、様々な LLM に対応しており、詳細は Supported LLMs ドキュメントを参照してください。

Mem0 はデフォルトの埋め込みモデルとして OpenAI の text-embedding-3-small を使用します。ハイブリッド検索(セマンティック + キーワード + エンティティブースティング)で最良の結果を得るには、少なくとも Qwen 600M または同等の埋め込みモデルの使用をお勧めします。設定の詳細については Supported Embeddings を参照してください。

最初のステップはメモリをインスタンス化することです:

from openai import OpenAI
from mem0 import Memory

openai_client = OpenAI()
memory = Memory()

def chat_with_memories(message: str, user_id: str = "default_user") -> str:
    # Retrieve relevant memories
    relevant_memories = memory.search(query=message, filters={"user_id": user_id}, top_k=3)
    memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories["results"])

    # Generate Assistant response
    system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
    messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
    response = openai_client.chat.completions.create(model="gpt-5-mini", messages=messages)
    assistant_response = response.choices[0].message.content

    # Create new memories from the conversation
    messages.append({"role": "assistant", "content": assistant_response})
    memory.add(messages, user_id=user_id)

    return assistant_response

def main():
    print("Chat with AI (type 'exit' to quit)")
    while True:
        user_input = input("You: ").strip()
        if user_input.lower() == 'exit':
            print("Goodbye!")
            break
        print(f"AI: {chat_with_memories(user_input)}")

if __name__ == "__main__":
    main()

詳細な統合手順については、QuickstartAPI Reference を参照してください。

🔗 統合とデモ

  • ChatGPT with Memory: Mem0 によって提供される個人化されたチャット (Live Demo)
  • Browser Extension: ChatGPT、Perplexity、Claude 全体でメモリを保存 (Chrome Extension)
  • Langgraph Support: Langgraph + Mem0 でカスタマーボットを構築 (Guide)
  • CrewAI Integration: Mem0 で CrewAI の出力をカスタマイズ (Example)

📚 ドキュメントとサポート

引用

引用可能なペーパーが公開されました:

@article{mem0,
  title={Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory},
  author={Chhikara, Prateek and Khant, Dev and Aryan, Saket and Singh, Taranjeet and Yadav, Deshraj},
  journal={arXiv preprint arXiv:2504.19413},
  year={2025}
}

⚖️ ライセンス

Apache 2.0 — 詳細は LICENSE ファイルをご確認ください。

— GitHub から取得した原文(一部省略の場合あり)

Mem0 - The Memory Layer for Personalized AI

mem0ai%2Fmem0 | Trendshift

Learn more · Join Discord · Demo

Mem0 Discord Mem0 PyPI - Downloads GitHub commit activity Package version Npm package Y Combinator S24

📄 Benchmarking Mem0's token-efficient memory algorithm →

New Memory Algorithm (April 2026)

Benchmark Old New Tokens Latency p50
LoCoMo 71.4 91.6 7.0K 0.88s
LongMemEval 67.8 93.4 6.8K 1.09s
BEAM (1M) 64.1 6.7K 1.00s
BEAM (10M) 48.6 6.9K 1.05s

All benchmarks run on the same production-representative model stack. Single-pass retrieval (one call, no agentic loops).

What changed:

  • Single-pass ADD-only extraction -- one LLM call, no UPDATE/DELETE. Memories accumulate; nothing is overwritten.
  • Agent-generated facts are first-class -- when an agent confirms an action, that information is now stored with equal weight.
  • Entity linking -- entities are extracted, embedded, and linked across memories for retrieval boosting.
  • Multi-signal retrieval -- semantic, BM25 keyword, and entity matching scored in parallel and fused.

See the migration guide for upgrade instructions. The evaluation framework is open-sourced so anyone can reproduce the numbers.

Research Highlights

  • 91.6 on LoCoMo -- +20 points over the previous algorithm
  • 93.4 on LongMemEval -- +26 points, with +53.6 on assistant memory recall
  • 64.1 on BEAM (1M) -- production-scale memory evaluation at 1M tokens
  • Read the full paper

Introduction

Mem0 ("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.

Key Features & Use Cases

Core Capabilities:

  • Multi-Level Memory: Seamlessly retains User, Session, and Agent state with adaptive personalization
  • Developer-Friendly: Intuitive API, cross-platform SDKs, and a fully managed service option

Applications:

  • AI Assistants: Consistent, context-rich conversations
  • Customer Support: Recall past tickets and user history for tailored help
  • Healthcare: Track patient preferences and history for personalized care
  • Productivity & Gaming: Adaptive workflows and environments based on user behavior

🚀 Quickstart Guide

Library Self-Hosted Server Cloud Platform
Best for Testing, prototyping Teams running on their own infrastructure Zero-ops production use
Setup pip install mem0ai docker compose up Sign up at app.mem0.ai
Dashboard -- Yes Yes
Auth & API Keys -- Yes Yes
Advanced Features -- Teasers All included

Just testing? Use the library. Building for a team? Self-hosted. Want zero ops? Cloud.

Library (pip / npm)

pip install mem0ai

For enhanced hybrid search with BM25 keyword matching and entity extraction, install with NLP support:

pip install mem0ai[nlp]
python -m spacy download en_core_web_sm

Install sdk via npm:

npm install mem0ai

Self-Hosted Server

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.

# Recommended: one command — start the stack, create an admin, issue the first API key.
cd server && make bootstrap

# Manual: start the stack and finish setup via the browser wizard.
cd server && docker compose up -d    # http://localhost:3000

See the self-hosted docs for configuration.

Cloud Platform

  1. Sign up on Mem0 Platform
  2. Embed the memory layer via SDK or API keys

CLI

Manage memories from your terminal:

npm install -g @mem0/cli   # or: pip install mem0-cli

mem0 init
mem0 add "Prefers dark mode and vim keybindings" --user-id alice
mem0 search "What does Alice prefer?" --user-id alice

See the CLI documentation for the full command reference.

Agent Skills

Teach 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:

Reference skills — always on (SDK knowledge loaded into the assistant's context):

npx skills add https://github.com/mem0ai/mem0 --skill mem0
npx skills add https://github.com/mem0ai/mem0 --skill mem0-cli
npx skills add https://github.com/mem0ai/mem0 --skill mem0-vercel-ai-sdk

Pipeline skills — run on demand (execute an end-to-end workflow in an existing repo):

npx skills add https://github.com/mem0ai/mem0 --skill mem0-integrate
npx skills add https://github.com/mem0ai/mem0 --skill mem0-test-integration

Use /mem0-integrate to wire Mem0 into an existing repo via a test-first pipeline, then /mem0-test-integration to verify. See the skills catalog or Vibecoding with Mem0 for the full picture.

Basic Usage

Mem0 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.

Mem0 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 or a comparable embedding model. See Supported Embeddings for configuration details.

First step is to instantiate the memory:

from openai import OpenAI
from mem0 import Memory

openai_client = OpenAI()
memory = Memory()

def chat_with_memories(message: str, user_id: str = "default_user") -> str:
    # Retrieve relevant memories
    relevant_memories = memory.search(query=message, filters={"user_id": user_id}, top_k=3)
    memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories["results"])

    # Generate Assistant response
    system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
    messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
    response = openai_client.chat.completions.create(model="gpt-5-mini", messages=messages)
    assistant_response = response.choices[0].message.content

    # Create new memories from the conversation
    messages.append({"role": "assistant", "content": assistant_response})
    memory.add(messages, user_id=user_id)

    return assistant_response

def main():
    print("Chat with AI (type 'exit' to quit)")
    while True:
        user_input = input("You: ").strip()
        if user_input.lower() == 'exit':
            print("Goodbye!")
            break
        print(f"AI: {chat_with_memories(user_input)}")

if __name__ == "__main__":
    main()

For detailed integration steps, see the Quickstart and API Reference.

🔗 Integrations & Demos

  • ChatGPT with Memory: Personalized chat powered by Mem0 (Live Demo)
  • Browser Extension: Store memories across ChatGPT, Perplexity, and Claude (Chrome Extension)
  • Langgraph Support: Build a customer bot with Langgraph + Mem0 (Guide)
  • CrewAI Integration: Tailor CrewAI outputs with Mem0 (Example)

📚 Documentation & Support

Citation

We now have a paper you can cite:

@article{mem0,
  title={Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory},
  author={Chhikara, Prateek and Khant, Dev and Aryan, Saket and Singh, Taranjeet and Yadav, Deshraj},
  journal={arXiv preprint arXiv:2504.19413},
  year={2025}
}

⚖️ License

Apache 2.0 — see the LICENSE file for details.

RELATED

同じカテゴリの他のツール