M2Wise
/install m2wise
\r \r
M2Wise - Memory-to-Wisdom Engine\r
\r
This is a skill for the OpenClaw AI Agent to enable long-term memory and self-evolving wisdom.\r \r
🎯 Purpose\r
\r As an AI agent, you inherently lack persistent memory across distinct sessions. The M2Wise skill bridges this gap. It allows you to:\r
- Extract and store memories (facts, preferences, commitments) from user conversations.\r
- Retrieve contextual memories and aggregated wisdom before answering.\r
- Consolidate raw memories into overarching "Wisdom" (rules, schemas, and skills) during idle time.\r \r
🚦 When to Use This Skill\r
\r You should proactively invoke this skill in the following scenarios:\r
- User expresses a preference: e.g., "I prefer short answers", "Don't use emojis."\r
- User shares a personal fact: e.g., "I work as a Python developer", "I live in Beijing."\r
- User asks you to remember: e.g., "Remember that I hate spam."\r
- Before answering complex questions: To recall the user's past preferences or facts to personalize your response.\r \r
🛠️ How to Use (Agent Instructions)\r
\r You can interact with M2Wise via its Python SDK. Use your shell/execution environment to run these scripts snippet by snippet.\r \r
1. Installation Requirements\r
Make sure the environment has M2Wise installed before calling its Python API:\r
pip install m2wise[all]\r
```\r
\r
### 2. Saving Memories (Online Phase)\r
When you detect a fact or preference in the conversation, run a quick python script to save it:\r
```python\r
from m2wise_sdk import M2WiseSDK\r
\r
sdk = M2WiseSDK()\r
# Extract and save the user's message\r
sdk.add_message("current_user_id", "I prefer concise Chinese answers for technical questions")\r
```\r
\r
### 3. Retrieving Context (Online Phase)\r
Before fulfilling a user's request, fetch their relevant memories:\r
```python\r
from m2wise_sdk import M2WiseSDK\r
\r
sdk = M2WiseSDK()\r
context = sdk.get_context("current_user_id", "How should I answer this technical question?")\r
print("Retrieved Context:", context)\r
```\r
*Action: Read the output of this script and adapt your final response to the user based on the retrieved context.*\r
\r
### 4. Background Processing (Sleep & Dream)\r
It is a good practice to trigger memory consolidation periodically (e.g., at the end of a long task).\r
```python\r
from m2wise_sdk import M2WiseSDK\r
\r
sdk = M2WiseSDK()\r
# Sleep: Extracts memories and groups them into Wisdom Drafts\r
sdk.trigger_sleep("current_user_id")\r
\r
# Dream: Verifies drafts against counterexamples and publishes them\r
sdk.trigger_dream("current_user_id")\r
```\r
\r
## 🧩 MCP Server Alternative\r
\r
If your OpenClaw runtime supports MCP (Model Context Protocol), you can start the M2Wise MCP server and use its native tools instead of writing Python scripts:\r
\r
```bash\r
# Start the MCP server\r
m2wise-mcp --data-dir ./data\r
```\r
\r
**Available MCP Tools:**\r
- `m2wise_add`: Add memory from conversation.\r
- `m2wise_search`: Search memories and wisdom.\r
- `m2wise_sleep`: Generate wisdom drafts.\r
- `m2wise_dream`: Verify and publish wisdom.\r
\r
## 🧠 Memory and Wisdom Types You Will Encounter\r
\r
- **Memories**: `preference` (likes/dislikes), `fact` (states/attributes), `commitment` (future actions).\r
- **Wisdoms**: `principle` (interaction guidelines), `schema` (behavioral patterns), `skill` (operational tactics).\r
\r
## 🚀 Best Practices\r
\r
1. **Be Proactive**: Don't wait for the user to explicitly say "remember this". If they state a strong preference, save it using `sdk.add_message()`.\r
2. **Context First**: For ambiguous requests, always query the memory bank first.\r
3. **Consolidate Often**: Run `trigger_sleep()` and `trigger_dream()` after completing a major task to ensure your wisdom evolves and stays clean.\r
\r
## 🔗 Resources\r
\r
- **GitHub Repository**: https://github.com/zengyi-thinking/M2Wise.git\r
- **Installation via OpenClaw (ClawHub)**:\r
```bash\r
npx clawdhub@latest install m2wise\r
```\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install m2wise - 安装完成后,直接呼叫该 Skill 的名称或使用
/m2wise触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
M2Wise 是什么?
Memory-to-Wisdom Engine for AI agents. Use this skill to give yourself long-term memory, extract user preferences/facts from conversations, and track wisdom... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 604 次。
如何安装 M2Wise?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install m2wise」即可一键安装,无需额外配置。
M2Wise 是免费的吗?
是的,M2Wise 完全免费(开源免费),可自由下载、安装和使用。
M2Wise 支持哪些平台?
M2Wise 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 M2Wise?
由 zengyi-thinking(@zengyi-thinking)开发并维护,当前版本 v1.0.2。