ClawMemory is a local-first memory layer for OpenClaw/OpenKrab ecosystem.
It gives agents persistent memory, semantic recall, session buffering, reminder commitments, and a self-host dashboard.
- Persistent Memory: Markdown source of truth + SQLite index (
memory/events,memory/index.sqlite3). - Smart Recall: Hybrid lexical + semantic retrieval with snippets and prompt-ready context.
- Session Buffer: Append/peek/flush short-term memory safely.
- Intent Scheduler:
pending/overdue/completedreminders (better than plain cron). - Dashboard TUI: Timeline, search, health cards, sessions, and commitments directly in your terminal.
- Claw Integrations:
ClawReceipt: recurring purchase patterns (finance/recurring)ClawFlow: cron setup memory + fail follow-up remindersClawWizard: preference memory (interactivevscli)ClawGraph: entity & relationship sync (projects, clients, tasks, expenses)
- Privacy First: Self-host/local by default, no cloud API required.
- Optional Real Vector DB: Chroma + sentence-transformers (local).
flowchart TD
A([User/Tool Event]) --> B{Capture Type}
B -->|Direct Fact| C[memory_write]
B -->|Conversation Turn| D[memory_session_append]
D --> E{Flush condition met?}
E -->|yes| F[memory_session_flush]
E -->|no| D
C --> G[(Markdown + SQLite)]
F --> G
G --> H[memory_search]
H --> I[snippet + prompt_context]
G --> J[memory_distill]
J --> K[MEMORY.md]
J --> L[profile.md]
M[reminder_set] --> N[(commitments.sqlite3)]
N --> O[reminder_poll/watch]
O --> P[overdue or completed]
- Python 3.10+
- OpenClaw CLI (recommended for plugin usage)
- Clone repo
git clone https://github.com/OpenKrab/ClawMemory.git
cd ClawMemory- Create virtual environment and install
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]- Run tests
pytest -q tests --capture=noInstall plugin from local path:
openclaw plugins install --link /absolute/path/to/ClawMemory
openclaw plugins enable clawmemorySet memory slot:
{
"plugins": {
"slots": {
"memory": "clawmemory"
}
}
}pythonBin(default:python3)memoryRoot(default:memory)timeoutMs(default:20000)autoFlushMaxTurns(default:24)minConfidence(default:0.7)reminderDefaultSeconds(default:300)vectorBackend(hashed|chroma)embedModel(default:all-MiniLM-L6-v2)
clawmemory write --payload '{"text":"User prefers interactive wizard","source":"clawwizard/session","tags":["preference"],"confidence":0.9}'
clawmemory search --query "wizard preference" -k 5
clawmemory get --id <memory_id>clawmemory session-append --session-id s1 --role user --content "I prefer wizard setup"
clawmemory session-peek --session-id s1 --limit 20
clawmemory session-flush --session-id s1 --min-confidence 0.7clawmemory distill --days 7clawmemory reminder-set --text "check build result" --in-seconds 300
clawmemory reminder-list --status pending
clawmemory reminder-poll --limit 100
clawmemory reminder-complete --id <reminder_id> --note "done"
clawmemory reminder-snooze --id <reminder_id> --seconds 120
clawmemory reminder-watch --interval 1.0 --max-sleep 30python -m clawmemory.openclaw_bridge integration_capture_receipts --root memory <<'JSON'
{"events":[{"merchant":"Shopee","amount":500,"timestamp":"2026-01-25T10:00:00+00:00"},{"merchant":"Shopee","amount":700,"timestamp":"2026-02-26T10:00:00+00:00"}]}
JSONpython -m clawmemory.openclaw_bridge integration_flow_cron_setup --root memory <<'JSON'
{"cron_expression":"0 9 * * *","job_name":"daily-report"}
JSONpython -m clawmemory.openclaw_bridge integration_flow_job_failure --root memory <<'JSON'
{"job_name":"daily-report","fail_reason":"timeout","remind_in_seconds":300}
JSONpython -m clawmemory.openclaw_bridge integration_wizard_preference --root memory <<'JSON'
{"mode":"interactive"}
JSONpython -m clawmemory.openclaw_bridge integration_graph_sync --root memory <<'JSON'
{"entities":{"projects":[{"id":"p1","name":"ClawMemory","deadline":"2026-03-31"}],"clients":[{"id":"c1","name":"OpenKrab"}]}}
JSON(In progress) The TUI provides a rich terminal interface for managing your memories.
clawmemory tuiNo extra install needed.
pip install -e .[vector]
export CLAWMEMORY_VECTOR_BACKEND=chroma
export CLAWMEMORY_EMBED_MODEL=all-MiniLM-L6-v2clawmemory/store.py- storage + retrievalclawmemory/vector_semantic.py- semantic backend abstractionclawmemory/session_buffer.py- short-term memory bufferclawmemory/distill.py- distillation pipelineclawmemory/commitments.py- reminder engineclawmemory/integrations.py- ClawReceipt/Flow/Wizard capture helpersclawmemory/dashboard.py- local UI serverclawmemory/openclaw_bridge.py- OpenClaw bridge command entrypointindex.js- OpenClaw runtime plugin bindingsopenclaw.plugin.json- OpenClaw plugin manifestskills/clawmemory/SKILL.md- skill instructions
pytest -q tests --capture=noPRs are welcome. Please include tests for behavior changes and keep self-host/privacy defaults intact.
Built for the Lobster Way 🦞
