Install
openclaw skills install m2wiseMemory-to-Wisdom Engine for AI agents. Use this skill to give yourself long-term memory, extract user preferences/facts from conversations, and track wisdom...
openclaw skills install m2wiseThis is a skill for the OpenClaw AI Agent to enable long-term memory and self-evolving wisdom.
As an AI agent, you inherently lack persistent memory across distinct sessions. The M2Wise skill bridges this gap. It allows you to:
You should proactively invoke this skill in the following scenarios:
You can interact with M2Wise via its Python SDK. Use your shell/execution environment to run these scripts snippet by snippet.
Make sure the environment has M2Wise installed before calling its Python API:
pip install m2wise[all]
When you detect a fact or preference in the conversation, run a quick python script to save it:
from m2wise_sdk import M2WiseSDK
sdk = M2WiseSDK()
# Extract and save the user's message
sdk.add_message("current_user_id", "I prefer concise Chinese answers for technical questions")
Before fulfilling a user's request, fetch their relevant memories:
from m2wise_sdk import M2WiseSDK
sdk = M2WiseSDK()
context = sdk.get_context("current_user_id", "How should I answer this technical question?")
print("Retrieved Context:", context)
Action: Read the output of this script and adapt your final response to the user based on the retrieved context.
It is a good practice to trigger memory consolidation periodically (e.g., at the end of a long task).
from m2wise_sdk import M2WiseSDK
sdk = M2WiseSDK()
# Sleep: Extracts memories and groups them into Wisdom Drafts
sdk.trigger_sleep("current_user_id")
# Dream: Verifies drafts against counterexamples and publishes them
sdk.trigger_dream("current_user_id")
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:
# Start the MCP server
m2wise-mcp --data-dir ./data
Available MCP Tools:
m2wise_add: Add memory from conversation.m2wise_search: Search memories and wisdom.m2wise_sleep: Generate wisdom drafts.m2wise_dream: Verify and publish wisdom.preference (likes/dislikes), fact (states/attributes), commitment (future actions).principle (interaction guidelines), schema (behavioral patterns), skill (operational tactics).sdk.add_message().trigger_sleep() and trigger_dream() after completing a major task to ensure your wisdom evolves and stays clean.npx clawdhub@latest install m2wise