memories.sh logomemories.sh
Integrations

OpenClaw

Integrate memories.sh with OpenClaw.

OpenClaw is an open-source personal AI assistant. Its runtime reads a workspace pack under ~/.openclaw/workspace (not just AGENTS.md), so memories.sh should preserve and sync the full workspace file set.

Why memories.sh + OpenClaw

Adding memories.sh gives you:

  • Cross-tool portability — Rules and decisions you keep for OpenClaw also power Claude Code, Cursor, Windsurf, and other integrations
  • Structured memory store — Keep rules, decisions, and facts in one searchable local database
  • Reusable skills — Generate .agents/skills/**/SKILL.md once and reuse across agent ecosystems

1) Run OpenClaw onboarding once

openclaw onboard

This creates and configures your OpenClaw workspace (default: ~/.openclaw/workspace).

2) Generate memories.sh output for OpenClaw

From your project (where your memories are scoped):

cd your-project
memories init
memories generate claude -o ~/.openclaw/workspace/AGENTS.md --force
memories generate agents
mkdir -p ~/.openclaw/workspace/skills
if [ -d .agents/skills ]; then
  cp -R .agents/skills/. ~/.openclaw/workspace/skills/
fi

This writes:

  1. AGENTS.md into OpenClaw's workspace for session instructions
  2. SKILL.md files into OpenClaw's workspace skills/ directory

OpenClaw Workspace Files (Synced)

memories files ingest / memories files apply now carry the OpenClaw workspace set:

  • ~/.openclaw/workspace/AGENTS.md
  • ~/.openclaw/workspace/SOUL.md
  • ~/.openclaw/workspace/TOOLS.md
  • ~/.openclaw/workspace/IDENTITY.md
  • ~/.openclaw/workspace/USER.md
  • ~/.openclaw/workspace/HEARTBEAT.md
  • ~/.openclaw/workspace/BOOTSTRAP.md
  • ~/.openclaw/workspace/BOOT.md (when present)
  • ~/.openclaw/workspace/MEMORY.md / memory.md
  • ~/.openclaw/workspace/memory/*.md
  • ~/.openclaw/workspace/skills/**/*

To include OpenClaw runtime config (~/.openclaw/openclaw.json) in file sync too:

memories files ingest --global --include-config
memories files apply --global --include-config --force

Secret-like fields are redacted before storage; keep real credentials in Supabase Vault or environment variables.

3) Keep it in sync

Whenever memories change:

cd your-project
memories generate claude -o ~/.openclaw/workspace/AGENTS.md --force
memories generate agents
if [ -d .agents/skills ]; then
  cp -R .agents/skills/. ~/.openclaw/workspace/skills/
fi

Optional reminder setup:

memories reminders add "0 9 * * 1-5" "OpenClaw refresh: run generate + skills copy + files apply"

4) Sync DB memory and OpenClaw file memory

# Bidirectional sync between DB rows and OpenClaw memory files
memories openclaw memory sync --direction both

Use this order around session boundaries:

# 1) Read semantic + recent episodic bootstrap context
memories openclaw memory bootstrap

# 2) Flush recent meaningful session events to today's daily log
memories openclaw memory flush <session-id>

# 3) Write a raw snapshot file from session events
memories openclaw memory snapshot <session-id> --trigger reset

# 4) Keep DB rows and files aligned
memories openclaw memory sync --direction both

Trigger guidance:

  • Near compaction or inactivity thresholds: run flush
  • On /new, /reset, or handoff boundaries: run snapshot --trigger new_session|reset|manual|auto_compaction
  • Run sync after lifecycle writes when multiple devices/workspaces may read the same memory files

Important Notes

  • OpenClaw docs define a full workspace contract (AGENTS, SOUL, TOOLS, IDENTITY, USER, HEARTBEAT, BOOTSTRAP, BOOT, and memory files).
  • OpenClaw docs currently do not document a project-level MCP config path like .openclaw/mcp.json for this integration flow.
  • openclaw onboard seeds default workspace templates (AGENTS, SOUL, TOOLS, IDENTITY, USER, HEARTBEAT, BOOTSTRAP).
  • memories generate agents only creates .agents/skills when skills exist in your memory store, so copying skills should be conditional.
  • If you changed your workspace path in ~/.openclaw/openclaw.json (for example agent.workspace or agents.defaults.workspace), replace ~/.openclaw/workspace with your configured path.

OpenClaw Agent Skill (GitHub)

The distributable OpenClaw skill lives in this repository and can be referenced directly:

OpenClaw References

On this page