Mnemos Memory: 为 Openclaw Skills 提供持久化上下文

作者:互联网

2026-04-12

AI教程

什么是 Mnemos Memory?

Mnemos Memory 作为一个强大的、本地优先的内存基础设施,旨在为 AI 编程智能体提供长期持久性。通过利用 Openclaw Skills,开发人员可以确保其智能体在多个会话中保留关键上下文、架构决策和项目事实。它通过提供一个智能体可以自主查询和更新的专用存储层,绕过了短期上下文窗口的限制。

它以隐私和速度为核心,利用 Sqlite 进行数据持久化,并支持 OpenAI 和 Ollama 等多种嵌入提供商。此技能对于复杂的工程任务特别有价值,在这些任务中,保持一致的状态对于智能体的准确性和效率至关重要。

下载入口:https://github.com/openclaw/skills/tree/main/skills/anthony-maio/mnemos-memory

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install mnemos-memory

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 mnemos-memory。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Mnemos Memory 应用场景

  • 为长期开发任务持久化存储项目特定事实和架构决策。
  • 智能体内存自引导,Openclaw Skills 自动安装和配置其自身的存储后端。
  • 在使用 Claude Code 或其他支持的 IDE 钩子的开发工作流中自动捕获事实。
  • 跨会话上下文检索,以保持多智能体或多任务环境中的连续性。
Mnemos Memory 工作原理
  1. 通过识别宿主机并通过 pip 安装 Mnemos 包来初始化环境。
  2. 通过在任务开始时执行 mnemos_retrieve 来启动内存生命周期,以获取相关的历史数据。
  3. 在整个会话中使用 mnemos_store 捕获持久事实,以确保重要信息保存到 Sqlite 后端。
  4. 在工作周期结束时执行 mnemos_consolidate,将存储的观察结果整理成整洁、可搜索的知识库。
  5. 使用 mnemos_inspect 或 CLI 工具进行故障排除或手动验证智能体存储内存的准确性。

Mnemos Memory 配置指南

要将持久化内存集成到您的 Openclaw Skills 中,请遵循以下安装步骤:

pip install "mnemos-memory[mcp]"
mnemos ui

安装完成后,将 mnemos-mcp 连接到您的规范 MNEMOS_CONFIG_PATH。您可以通过运行诊断工具来验证安装的健康状况:

mnemos-cli doctor

Mnemos Memory 数据架构与分类体系

Mnemos Memory 使用结构化的本地优先方法组织信息,以最大限度地提高性能和隐私:

组件 实现细节
核心存储 用于本地优先持久化的 Sqlite 数据库。
检索 通过 OpenAI、OpenRouter 或 Ollama 进行向量嵌入。
配置 通过 MNEMOS_CONFIG_PATH 进行集中管理。
工具集 用于存储、检索和合并操作的 MCP 兼容工具。
name: mnemos-memory
description: Use when users or OpenClaw/ClawHub agents need to install, configure, self-bootstrap, troubleshoot, or operate Mnemos for persistent scoped agent memory, or when they mention Mnemos, agent memory, scoped memory, memory MCP tools, or memory automation.

Mnemos Memory

Mnemos is a local-first memory layer for coding agents. Use this skill to guide users or OpenClaw agents onto the supported install path, explain the operating loop, and keep compatibility claims accurate.

Default path

  • Prefer pip install "mnemos-memory[mcp]" and mnemos ui.
  • For OpenClaw / ClawHub, teach the agent to self-install mnemos-memory[mcp], run mnemos ui, then wire mnemos-mcp to the canonical MNEMOS_CONFIG_PATH before relying on memory.
  • Recommend SQLite as the supported persistent store.
  • Recommend a real embedding provider (openclaw, openai, openrouter, or ollama) for production retrieval quality.
  • Validate setup with the control-plane smoke check or mnemos-cli doctor.

Claim discipline

  • Safe to claim: local-first scoped memory, MCP tools, SQLite starter profile, Claude Code plugin flow, documented Codex flow.
  • Be explicit that deterministic auto-memory is shipped for Claude Code via hooks.
  • For Codex, Cursor, OpenClaw, and generic MCP hosts, do not imply automatic capture unless the host has its own automation or the user adds one.
  • Do not present removed legacy backends as available runtime options.

Workflow

  1. Identify the host: Claude Code, Cursor, Codex, OpenClaw, or generic MCP.
  2. If the repo is available locally, read README.md, docs/MCP_INTEGRATION.md, and docs/codex.md before answering.
  3. Give the default install path first. Only fall back to manual config snippets if the user cannot use the control plane.
  4. Explain the operating loop:
    • mnemos_retrieve at task start
    • mnemos_store for durable facts only
    • mnemos_consolidate before finishing substantial work
    • mnemos_inspect when a stored fact looks wrong
  5. Read references/hosts.md for host-specific config snippets and caveats, especially the OpenClaw / ClawHub self-install flow when the agent must bootstrap itself.
  6. Read references/operations.md for automation, capture-mode, storage guidance, and troubleshooting.

Avoid

  • Do not tell users to manually type memories as the primary workflow.
  • Do not recommend SimpleEmbeddingProvider for production retrieval quality.
  • Do not suggest external storage backends for Mnemos. Keep users on the SQLite path.