Memori

MemoriLabs活跃维护 有专家点评

给 AI Agent 提供持久化记忆的基础设施层,把对话和执行过程转成结构化状态,兼容任意 LLM,可直接接入现有数据设施,支持云上和本地部署。

Memori is agent-native memory infrastructure. A LLM-agnostic layer that turns agent execution and conversation into structured, persistent state for production systems. Built for enterprise, Memori works with the data infrastructure you already run, no rip-and-replace, and deploys across managed cloud, single-tenant cloud, VPC, and on-premises.

v3.3.6发布于 2026-05-28 01:01 UTC17,542star +83 / 7 天3,961fork同步于 2026-11-10 23:26 UTC

专家点评

上手难度:进阶更新于 2026-11-11

给 Agent 加持久记忆的中间层,注册客户端后自动落库和召回,不用自己写状态机

适用场景

  • 在线对话服务:需要把多轮会话和工具调用结果落成可检索状态时,它把持久化和召回挂在 LLM 客户端注册这一步上,省掉自己维护 session 表和摘要逻辑;换成纯向量库方案,召回语义有了但实体/流程归属还得自己补。
  • 多租户 SaaS 里的 Agent:用 entity_id + process_id 的 attribution 把「谁」和「哪条流程」分开,比在 prompt 里塞 user_id 更可控;自己搓一套就得处理跨会话隔离和清理。
  • 已有 Postgres/MySQL 的团队:BYODB 让你把记忆写进现有库,不用为了记忆再引入一套独立存储;换 Mem0 之类的托管方案通常意味着数据要出去。
  • 用 Claude Code / 自建 Agent 跑长任务:OpenClaw、Hermes 插件和 MCP 接入能捕获工具调用和决策,不用改 Agent 主循环。

踩坑

  • 默认路径是 Memori Cloud:不显式配 BYODB 就会把对话数据发到 app.memorilabs.ai,同时要 MEMORI_API_KEY 和 LLM key 两套凭证;对数据出境敏感的部署要先读 BYODB 文档再动手。
  • 本地/自托管模型接入是 issue 里反复出现的诉求(Ollama/vLLM、OpenAI-compatible endpoint 两条独立 issue),说明默认链路对非官方 endpoint 的支持不完整,跑本地模型前先确认当前版本是否已覆盖。
  • 记忆没保存/偏好被部分遗忘这类问题在 issue 里有单条报告,反应数很低,无法判断是普遍缺陷还是个例;上线前自己补一层写入校验和召回命中检查比较稳妥。

同类对比

Mem0 和 Zep 是同类,差别在托管程度和数据落点:能接受数据托管、想要开箱即用的选它们;必须留在自有库里的选 Memori。纯 RAG 场景其实用向量库加自写会话表就够,不必上这层。

怎么上手

由 README 提炼,执行前请确认
pip install memori
npm install @memorilabs/memori
硬件要求按 README 说明

README 未说明,未提及显存、GPU 型号或 CPU 运行要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

给 Agent 加持久记忆的 LLM 无关中间层,把执行与对话存成结构化状态

给 AI Agent 提供持久化记忆的基础设施层,把对话和执行过程转成结构化状态,兼容任意 LLM,可直接接入现有数据设施,支持云上和本地部署。

核心能力

  • 注册 LLM 客户端后自动持久化并召回对话
  • 用 attribution 绑定 entity_id 与 process_id 区分用户和流程
  • 支持 BYODB 接入自有数据库,无需替换现有数据设施
  • 提供 OpenClaw 与 Hermes 插件,捕获工具调用和决策
  • 提供 MCP 方式一条命令接入 Agent

容易踩的坑

需要先在 app.memorilabs.ai 注册获取 MEMORI_API_KEY,并同时配置 LLM 的 API key;默认走 Memori Cloud,想用自有数据库需另看 BYODB 文档;CLI 依赖 Python 环境,通过 python -m memori 调用

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.3.6
  1. v3.3.6Version 3.3.6最新正式版2026-05-28 · 2026-05-28 01:01 UTC

    What's Changed

    Full Changelog: https://github.com/MemoriLabs/Memori/compare/v3.3.5...v3.3.6

  2. v3.3.5Version 3.3.52026-05-27 · 2026-05-27 16:20 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/MemoriLabs/Memori/compare/v3.3.4...v3.3.5

  3. v3.3.4Version 3.3.42026-05-20 · 2026-05-20 14:52 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/MemoriLabs/Memori/compare/v3.3.3...v3.3.4

  4. v3.3.3Version 3.3.32026-05-05 · 2026-05-05 18:22 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/MemoriLabs/Memori/compare/v3.3.2...v3.3.3

  5. v3.3.2Version 3.3.22026-04-29 · 2026-04-29 15:59 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/MemoriLabs/Memori/compare/v3.3.1...v3.3.2

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Memori Labs

    Memori Labs

    Getting Started

    Installation

    npm install @memorilabs/memori
    
    pip install memori
    

    Quickstart

    Sign up at app.memorilabs.ai, get a Memori API key, and start building. Full docs: memorilabs.ai/docs/memori-cloud/.

    Set MEMORI_API_KEY and your LLM API key (e.g. OPENAI_API_KEY), then:

    import { OpenAI } from 'openai';
    import { Memori } from '@memorilabs/memori';
    
    // Requires MEMORI_API_KEY and OPENAI_API_KEY in your environment
    const client = new OpenAI();
    const mem = new Memori().llm
      .register(client)
      .attribution('user_123', 'support_agent');
    
    async function main() {
      await client.chat.completions.create({
        model: 'gpt-4o-mini',
        messages: [{ role: 'user', content: 'My favorite color is blue.' }],
      });
      // Conversations are persisted and recalled automatically in the background.
    
      const response = await client.chat.completions.create({
        model: 'gpt-4o-mini',
        messages: [{ role: 'user', content: "What's my favorite color?" }],
      });
      // Memori recalls that your favorite color is blue.
    }
    
    from memori import Memori
    from openai import OpenAI
    
    # Requires MEMORI_API_KEY and OPENAI_API_KEY in your environment
    client = OpenAI()
    mem = Memori().llm.register(client)
    
    mem.attribution(entity_id="user_123", process_id="support_agent")
    
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "My favorite color is blue."}]
    )
    # Conversations are persisted and recalled automatically.
    
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "What's my favorite color?"}]
    )
    # Memori recalls that your favorite color is blue.
    

    Explore the Memories

    Use the Dashboard — Memories, Analytics, Playground, and API Keys.

    [!TIP] Want to use your own database? Check out docs for Memori BYODB here: https://memorilabs.ai/docs/memori-byodb/. For disposable BYODB development databases, see the TiDB Zero provisioning guide: docs/memori-byodb/databases/tidb.mdx.

    LoCoMo Benchmark

    Memori was evaluated on the LoCoMo benchmark for long-conversation memory and achieved 87% overall accuracy while using an average of 721 tokens per query. That is just 2.8% of the full-context footprint, showing that structured memory can preserve reasoning quality without forcing large prompts into every request.

    Compared with other retrieval-based memory systems, Memori outperformed Zep, LangMem, and Mem0 while reducing prompt size by roughly 67% vs. Zep and lowering context cost by more than 36x vs. full-context prompting.

    Read the benchmark overview, see the results, or download the paper.

    "Memori's average accuracy along with the standard deviation"

    OpenClaw (Persistent Memory for Your Gateway)

    By default, OpenClaw agents forget everything between sessions. The Memori plugin fixes that. It automatically captures structured memory from conversation and agent execution after each turn — including tool calls, decisions, and outcomes — and makes it available for agents to recall on demand.

    No changes to your agent code or prompts are required. The plugin hooks into OpenClaw's lifecycle, so you get structured memory, agent-controlled recall, and Advanced Augmentation with a drop-in plugin.

    openclaw plugins install @memorilabs/openclaw-memori
    openclaw plugins enable openclaw-memori
    
    openclaw memori init \
      --api-key "YOUR_MEMORI_API_KEY" \
      --entity-id "your-app-user-id" \
      --project-id "my-project"
    
    openclaw gateway restart
    

    For setup and configuration, see the OpenClaw Quickstart. For architecture and lifecycle details, see the OpenClaw Overview.

    Hermes Agent (Persistent Memory Provider)

    Memori also ships as a Hermes Agent memory provider. It captures completed conversations in the background and gives Hermes explicit memori_recall and memori_recall_summary tools for agent-controlled recall.

    pip install hermes-memori
    hermes-memori install
    
    hermes config set memory.provider memori
    HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
    mkdir -p "$HERMES_HOME"
    echo "MEMORI_API_KEY=YOUR_MEMORI_API_KEY" >> "$HERMES_HOME/.env"
    echo "MEMORI_ENTITY_ID=your-app-user-id" >> "$HERMES_HOME/.env"
    

    MEMORI_PROJECT_ID is optional; when omitted, the provider uses Hermes' active project context for scoping.

    For setup and configuration, see the Hermes Quickstart. For architecture and lifecycle details, see the Hermes Overview.

    MCP (Connect Your Agent in One Command)

    Your agent forgets everything between sessions. Memori fixes that. It remembers your stack, your conventions, and how you like things done so you stop repeating yourself.

    Works for solo developers and teams. Your agent learns coding patterns, reviewer preferences, and project conventions over time. For teams, that means shared context that new engineers pick up on day one instead of absorbing tribal knowledge over months.

    If you use Claude Code, Cursor, Codex, Warp, or Antigravity, you can connect Memori with no SDK integration needed:

    claude mcp add --transport http memori https://api.memorilabs.ai/mcp/ \
      --header "X-Memori-API-Key: ${MEMORI_API_KEY}" \
      --header "X-Memori-Entity-Id: your_username" \
      --header "X-Memori-Process-Id: claude-code"
    

    For Cursor, Codex, Warp, and other clients, see the MCP client setup guide.

    Attribution

    To get the most out of Memori, you want to attribute your LLM interactions to an entity (think person, place or thing; like a user) and a process (think your agent, LLM interaction or program).

    If you do not provide any attribution, Memori cannot make memories for you.

    mem.attribution("12345", "my-ai-bot");
    
    mem.attribution(entity_id="12345", process_id="my-ai-bot")
    

    Session Management

    Memori uses sessions to group your LLM interactions together. For example, if you have an agent that executes multiple steps you want those to be recorded in a single session.

    By default, Memori handles setting the session for you but you can start a new session or override the session by executing the following:

    mem.resetSession();
    // or
    mem.setSession(sessionId);
    
    mem.new_session()
    # or
    mem.set_session(session_id)
    

    Supported LLMs

    • Anthropic
    • Bedrock
    • DeepSeek
    • Gemini
    • Grok (xAI)
    • OpenAI (Chat Completions & Responses API)

    (unstreamed, streamed, synchronous and asynchronous)

    Supported Frameworks

    • Agno
    • LangChain
    • Pydantic AI

    Supported Platforms

    • DeepSeek
    • Nebius AI Studio

    Examples

    For more examples and demos, check out the Memori Cookbook.

    Memori Advanced Augmentation

    Memories are tracked at several different levels:

    • entity: think person, place, or thing; like a user
    • process: think your agent, LLM interaction or program
    • session: the current interactions between the entity, process and the LLM

    Memori's Advanced Augmentation enhances memories at each of these levels with:

    • attributes
    • events
    • facts
    • people
    • preferences
    • relationships
    • rules
    • skills

    Memori knows who your user is, what tasks your agent handles and creates unparalleled context between the two. Augmentation occurs in the background incurring no latency.

    By default, Memori Advanced Augmentation is available without an account but rate-limited. When you need increased limits, sign up for Memori Advanced Augmentation or use the Memori CLI:

    # Install the CLI via pip to manage your account
    python -m memori sign-up <email_address>
    

    Memori Advanced Augmentation is always free for developers!

    Once you've obtained an API key, set the following environment variable (used by both Python and TypeScript SDKs):

    export MEMORI_API_KEY=[api_key]
    

    The Memori CLI uses your exported environment first, then fills missing values from a .env file in the directory where you run the command.

    Managing Your Quota

    At any time, you can check your quota using the Memori CLI (works for both SDKs):

    python -m memori quota
    

    Or by checking your account at https://app.memorilabs.ai/. If you have reached your IP address quota, sign up and get an API key for increased limits.

    If your API key exceeds its quota limits, we will email you and let you know.

    Command Line Interface (CLI)

    The Memori CLI is the unified tool for managing your account, keys, and quotas across all SDKs. To use it, execute the following from the command line:

    # Requires Python installed
    python -m memori
    

    This will display a menu of the available options. For more information about what you can do with the Memori CLI, please reference Command Line Interface.

    Contributing

    We welcome contributions from the community! Please see our Contributing Guidelines for details on:

    • Setting up your development environment
    • Code style and standards
    • Submitting pull requests
    • Reporting issues

    Support


    Memori Enterprise

    Memori Enterprise is built for any enterprise running production agents, particularly high-volume ones such as internal SDLC.

    Recently, a major project management platform automating QA with AI agents faced severe inefficiency as its agents suffered from session amnesia, repeatedly burning excessive tool calls.

    By integrating Memori's agent-native memory layer in a secure private VPC, the platform captured execution traces to stop redundant discoveries and improve run over run.

    This deployment delivered:

    • $2.1M/year reduction in token spend on just one QA automation workflow
    • Material soft ROI including increases in accuracy, reduction in latency, and reduction in human in the loop review

    Following this success, this enterprise has already identified four additional high-priority agentic workflows for Memori integration.

    Please email us at [email protected] if you'd like a preview.


    License

    Apache 2.0 - see LICENSE