Memstate + OpenClaw
Give your OpenClaw personal AI assistant persistent, versioned memory โ installed as a skill from ClawHub.
OpenClaw uses a skill-based extension model instead of MCP. The Memstate AI skill teaches your OpenClaw agent to check existing project context before every task and save summaries after โ automatically, every session. No MCP config file required.
Skills vs MCP โ What's the difference?
Most AI coding agents (Claude Code, Cursor, Cline) use the Model Context Protocol (MCP) to connect to Memstate. OpenClaw uses a different extension model called Agent Skills โ portable instruction bundles that live in your workspace and are loaded automatically. The Memstate skill works the same way under the hood; it just installs differently.
Prerequisites
OpenClaw installed
Install OpenClaw with the one-liner: curl -fsSL https://openclaw.ai/install.sh | bash. See the OpenClaw Getting Started guide.
Memstate API key
Get a free API key at memstate.ai/dashboard. No credit card required.
Python 3 available
The Memstate skill scripts require python3. Run python3 --version to confirm. Python 3.8+ is sufficient.
Get Your API Key
Sign up for free โ no credit card required.
Sign Up FreeAlready have an account? Go to API Keys โ
Set Your API Key
The Memstate skill reads your API key from the MEMSTATE_API_KEY environment variable. Add it to your shell profile so it persists across sessions.
export MEMSTATE_API_KEY="your_api_key_here"After editing your shell profile, run source ~/.zshrc (or open a new terminal) to apply the change.
OpenClaw environment variables
You can also set MEMSTATE_API_KEY in your OpenClaw Gateway config so it is always available to your agent without needing to export it manually. See the OpenClaw environment variables docs.
Install the Memstate Skill
Use the native OpenClaw CLI to install the skill directly from ClawHub:
Recommended โ native OpenClaw CLI
openclaw skills install memstate-aiAlternative โ ClawHub CLI (also installs into your workspace)
npx clawhub@latest install memstate-aiStart a New Session and Test
Skills are loaded at session start. Start a new OpenClaw session (or restart the Gateway) so it picks up the Memstate skill, then paste this onboarding prompt to confirm everything is working:
I'm onboarding Memstate AI memory for this project. Please:
1. Analyze this codebase and write a concise high-level architecture overview in markdown โ covering the main components, tech stack, key directories, and how data flows through the system.
2. Save it to Memstate using: memstate_remember(project_id="<your_project>", content="<the markdown>", source="agent")
3. Then call memstate_get(project_id="<your_project>") and show me the memory tree so I can confirm it worked.Replace <your_project> with a short snake_case name for your repo (e.g. my_app).
What to expect
Your agent will analyze the codebase, write an architecture overview, save it to Memstate, then display the memory tree. You'll see structured memories like project.my_app.architecture โ this context is now available in every future session automatically.
What the Skill Does
Your agent automatically checks existing project memories to avoid duplicate work and surface prior decisions.
memstate_get(project_id="my_app")Your agent saves a markdown summary of what was done, key decisions made, and files modified.
memstate_remember(project_id="my_app", content="## Summary\n...", source="agent")Keeping the Skill Updated
The Memstate skill is versioned on ClawHub. Update it any time with:
openclaw skills update --allTo see which skills are installed and their current versions:
openclaw skills listMemstate AI on ClawHub
The Memstate AI skill is published on ClawHub at clawhub.ai/yepthatsjason/memstate-ai. You can browse the skill files, review the security scan, and download specific versions from there.
License
MIT-0 (no attribution required)
Runtime
python3 + MEMSTATE_API_KEY
Security
VirusTotal: Benign ยท OpenClaw: High Confidence
Troubleshooting
The skill installs but my agent doesn't seem to use it
Skills are loaded at session start. Make sure you started a new OpenClaw session after installing. You can verify the skill is loaded by running openclaw skills list.
I get "MEMSTATE_API_KEY not set" errors
The skill reads the API key from the MEMSTATE_API_KEY environment variable. Ensure it is exported in your shell profile and that OpenClaw was started in a shell where the variable is set.
How do I uninstall the skill?
Remove the skill folder from your OpenClaw workspace skills directory. The default location is ~/.openclaw/skills/memstate-ai. Workspace skills take precedence over global skills.