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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install m2wise - After installation, invoke the skill by name or use
/m2wise - Provide required inputs per the skill's parameter spec and get structured output
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 604 downloads so far.
How do I install M2Wise?
Run "/install m2wise" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is M2Wise free?
Yes, M2Wise is completely free (open-source). You can download, install and use it at no cost.
Which platforms does M2Wise support?
M2Wise is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created M2Wise?
It is built and maintained by zengyi-thinking (@zengyi-thinking); the current version is v1.0.2.