clawvault
v1.5.0
Published
π An elephant never forgets. Structured memory for OpenClaw agents. Context death resilience, Obsidian-compatible markdown, local semantic search.
Maintainers
Readme
ClawVault π
An elephant never forgets.
Structured memory system for AI agents. Store, search, and link memories across sessions.
Built for OpenClaw β the AI agent framework. Works standalone too.
Install for OpenClaw Agents
# Install the skill (recommended for OpenClaw agents)
clawhub install clawvault
# Or install the CLI globally
npm install -g clawvaultRequirements
- Node.js 18+
- qmd β Local semantic search (required)
# Install qmd first
bun install -g qmd # or: npm install -g qmd
# Then install clawvault
npm install -g clawvaultWhy ClawVault?
AI agents forget things. Context windows overflow, sessions end, important details get lost. ClawVault fixes that:
- Structured storage β Organized categories, not random notes
- Local search β qmd provides BM25 + semantic search with local embeddings (no API quotas)
- Wiki-links β
[[connections]]visible in Obsidian's graph view - Session continuity β Handoff/recap system for context death
- Token efficient β Search instead of loading entire memory files
Quick Start
# Initialize vault with qmd collection
clawvault init ~/memory --qmd-collection my-memory
# Store memories
clawvault remember decision "Use qmd" --content "Local embeddings, no API limits"
clawvault remember lesson "Context death is survivable" --content "Write it down"
clawvault capture "Quick note to process later"
# Search (uses qmd)
clawvault search "decision" # BM25 keyword search
clawvault vsearch "what did I decide" # Semantic search
# Session management
clawvault wake
clawvault sleep "build wake/sleep commands" --next "run doctor"
clawvault handoff --working-on "task1" --next "task2" # Manual handoff (advanced)
clawvault recap # Manual recap (advanced)Tip: Set CLAWVAULT_PATH to skip directory walk (or use shell-init):
echo 'export CLAWVAULT_PATH="$HOME/memory"' >> ~/.bashrc
eval "$(clawvault shell-init)"Search: qmd vs memory_search
Use qmd (or clawvault search) β not memory_search
| Tool | Backend | Speed | API Limits |
|------|---------|-------|------------|
| qmd search / clawvault search | Local BM25 | Instant | None |
| qmd vsearch / clawvault vsearch | Local embeddings | Fast | None |
| memory_search | Gemini API | Variable | Yes, hits quotas |
# β
Use this
qmd search "query" -c my-memory
clawvault search "query"
# β Avoid (API quotas)
memory_searchVault Structure
my-memory/
βββ .clawvault.json # Config (includes qmd collection name)
βββ decisions/ # Choices with reasoning
βββ lessons/ # Things learned
βββ people/ # One file per person
βββ projects/ # Active work
βββ commitments/ # Promises and deadlines
βββ inbox/ # Quick capture (process later)
βββ handoffs/ # Session continuityCommands
Store Memories
# With type classification (recommended)
clawvault remember <type> <title> --content "..."
# Types: decision, lesson, fact, commitment, project, person
# Quick capture
clawvault capture "Note to self"
# Manual store
clawvault store -c decisions -t "Title" --content "..."Note: All write commands auto-update the qmd index. Use --no-index to skip.
Search
clawvault search "query" # BM25 keyword
clawvault search "query" -c people # Filter by category
clawvault vsearch "query" # Semantic (local embeddings)Browse
clawvault list # All documents
clawvault list decisions # By category
clawvault get decisions/title # Specific document
clawvault stats # Vault overviewSession Continuity
# Start a session (recover + recap + summary)
clawvault wake
# End a session with a handoff
clawvault sleep "building CRM, fixing webhook" \
--blocked "waiting for API key" \
--next "deploy to production" \
--decisions "chose Supabase over Firebase" \
--feeling "focused"
# Manual tools (advanced)
clawvault handoff --working-on "task1" --next "task2"
clawvault recap --brief # Token-efficient recap
# Health check
clawvault doctorAgent Setup (AGENTS.md)
Add this to your AGENTS.md to ensure proper memory habits:
## Memory
**Write everything down. Memory doesn't survive session restarts.**
### Search (use qmd, not memory_search)
\`\`\`bash
qmd search "query" -c your-memory # Fast keyword
qmd vsearch "query" -c your-memory # Semantic
\`\`\`
### Store
\`\`\`bash
clawvault remember decision "Title" --content "..."
clawvault remember lesson "Title" --content "..."
\`\`\`
### Session Start
\`\`\`bash
clawvault wake
\`\`\`
### Session End
\`\`\`bash
clawvault sleep "..." --next "..."
\`\`\`
### Checkpoint (during heavy work)
\`\`\`bash
clawvault checkpoint --working-on "..." --focus "..." --blocked "..."
\`\`\`
### Why qmd over memory_search?
- Local embeddings β no API quotas
- Always works β no external dependencies
- Fast β instant BM25, quick semanticTemplates
ClawVault includes templates for common memory types:
decision.mdβ Choices with context and reasoninglesson.mdβ Things learnedperson.mdβ People you work withproject.mdβ Active workhandoff.mdβ Session state before context deathdaily.mdβ Daily notes
Use with: clawvault store -c category -t "Title" -f decision
Library Usage
import { ClawVault, createVault, findVault } from 'clawvault';
const vault = await createVault('./memory', { qmdCollection: 'my-memory' });
await vault.store({
category: 'decisions',
title: 'Use ClawVault',
content: 'Decided to use ClawVault for memory.',
});
const results = await vault.find('memory', { limit: 5 });License
MIT
"An elephant never forgets." β Now neither do you. π
