smart-memoryContext-aware memory for AI agents with dual retrieval modes ā fast vector search or curated Focus Agent synthesis. SQLite backend, zero configuration, local embeddings.
Install via ClawdBot CLI:
clawdbot install BluePointDigital/smart-memoryDrop-in replacement for OpenClaw's memory system with superior search quality and optional curated retrieval via Focus Agent.
npx clawhub install smart-memory
Or from ClawHub: https://clawhub.ai/BluePointDigital/smart-memory
node smart-memory/smart_memory.js --sync
node smart-memory/smart_memory.js --search "James values principles"
node smart-memory/smart_memory.js --focus
node smart-memory/smart_memory.js --search "complex decision about project direction"
node smart-memory/smart_memory.js --unfocus
Direct vector similarity search. Best for:
node smart-memory/smart_memory.js --search "git remote"
Multi-pass curation via Focus Agent. Best for:
node smart-memory/smart_memory.js --focus
node smart-memory/smart_memory.js --search "What did we decide about BluePointDigital architecture?"
How Focus Mode Works:
When enabled, searches go through additional processing:
Query: "What did we decide about BluePointDigital?"
āāāāāāāāāāāāāāāāāāā
ā Retrieve 20+ ā ā Vector similarity
ā chunks ā
āāāāāāāāāā¬āāāāāāāāā
ā¼
āāāāāāāāāāāāāāāāāāā
ā Weighted ā ā Term matching
ā Ranking ā Source boosting
ā ā Recency boost
āāāāāāāāāā¬āāāāāāāāā
ā¼
āāāāāāāāāāāāāāāāāāā
ā Select Top 5 ā ā Threshold filtering
āāāāāāāāāā¬āāāāāāāāā
ā¼
āāāāāāāāāāāāāāāāāāā
ā Synthesize ā ā Group by source
ā Narrative ā Extract key facts
āāāāāāāāāā¬āāāāāāāāā
ā¼
Structured output with confidence
memory_search({
query: "deployment configuration",
maxResults: 5
})
Returns (Fast Mode):
{
"query": "deployment configuration",
"mode": "fast",
"results": [
{
"path": "MEMORY.md",
"from": 42,
"lines": 8,
"score": 0.89,
"snippet": "..."
}
]
}
Returns (Focus Mode):
{
"query": "deployment configuration",
"mode": "focus",
"confidence": 0.87,
"sources": ["MEMORY.md", "memory/2026-02-05.md"],
"synthesis": "Relevant context for: \"deployment configuration\"\n\nFrom MEMORY.md:\n ⢠Docker setup uses docker-compose...\n ⢠Production deployment on AWS...\n\nFrom memory/2026-02-05.md:\n ⢠Decided to use Railway instead...",
"facts": [
{
"content": "Docker setup uses docker-compose...",
"source": "MEMORY.md",
"lines": "42-50",
"confidence": 0.89
}
]
}
memory_get({
path: "MEMORY.md",
from: 42,
lines: 10
})
memory_mode('focus') // Enable curated retrieval
memory_mode('fast') // Disable curated retrieval
memory_mode() // Get current mode status
# Sync memory files
node smart_memory.js --sync
# Search (uses current mode)
node smart_memory.js --search "query" [--max-results N]
# Search with mode override
node smart_memory.js --search "query" --focus
node smart_memory.js --search "query" --fast
# Toggle modes
node smart_memory.js --focus # Enable focus mode
node smart_memory.js --unfocus # Disable focus mode
node smart_memory.js --fast # Same as --unfocus
# Check status
node smart_memory.js --status # Database stats + current mode
node smart_memory.js --mode # Current mode details
# Focus agent only
node focus_agent.js --search "query"
node focus_agent.js --suggest "query" # Check if focus recommended
# Mode management
node memory_mode.js focus
node memory_mode.js unfocus
node memory_mode.js status
| Feature | Fallback | With sqlite-vec |
|---------|----------|-----------------|
| Keyword search | FTS5 (native) | FTS5 (native) |
| Vector search | JS cosine | Native KNN |
| Focus curation | +50-100ms | +50-100ms |
| Speed | ~100 chunks/sec | ~10,000 chunks/sec |
| Memory | All in RAM | DB handles it |
Use --focus or enable focus mode when:
Don't use focus mode when:
For best performance, install sqlite-vec:
# macOS
brew install sqlite-vec
# Ubuntu/Debian
# Download from https://github.com/asg017/sqlite-vec/releases
# Place vec0.so in ~/.local/lib/ or /usr/local/lib/
Without it: Works fine, just slower on large databases.
smart-memory/
āāā smart_memory.js # Main CLI
āāā focus_agent.js # Curated retrieval engine
āāā memory_mode.js # Mode toggle commands
āāā memory.js # OpenClaw wrapper
āāā db.js # SQLite layer
āāā search.js # Hybrid search
āāā chunker.js # Token-based chunking
āāā embed.js # Transformers.js embeddings
āāā vector-memory.db # SQLite database (auto-created)
MEMORY_DIR=/path/to/memory # Default: ./memory
MEMORY_FILE=/path/to/MEMORY.md # Default: ./MEMORY.md
MEMORY_DB_PATH=/path/to/db.sqlite # Default: ./vector-memory.db
| | v1 (JSON) | v2 (SQLite) | v2.1 (Focus Agent) |
|--|-----------|-------------|-------------------|
| Search | Vector only | Hybrid (BM25 + Vector) | Hybrid + Focus Curation |
| Storage | JSON file | SQLite | SQLite |
| Scale | ~1000 chunks | Unlimited | Unlimited |
| Keyword match | Weak | Strong (FTS5) | Strong (FTS5) |
| Context curation | No | No | Yes (toggle) |
| Setup | Zero config | Zero config | Zero config |
MIT
Generated Mar 1, 2026
A distributed team uses Smart Memory to quickly retrieve past decisions on architecture, such as Docker configurations or AWS deployment setups, via fast mode for routine queries. For complex planning sessions, they enable focus mode to synthesize discussions from multiple meeting notes into coherent narratives, aiding in strategic alignment and reducing miscommunication.
A law firm employs Smart Memory to search through case files and legal precedents using hybrid search for exact keyword matches and semantic understanding. In focus mode, it curates relevant sections from various documents to build a synthesized argument or summary, saving time in case preparation and improving accuracy in legal research.
Researchers use Smart Memory to organize and retrieve notes from papers, experiments, and lab logs with fast mode for quick fact-checking. For complex queries like synthesizing findings across multiple studies, focus mode provides curated narratives, helping in literature reviews and hypothesis formulation without manual data aggregation.
A support team integrates Smart Memory into their helpdesk system to search through past tickets and documentation using fast mode for immediate issue resolution. For intricate customer problems requiring multi-step solutions, focus mode synthesizes information from various sources, enabling more comprehensive and personalized responses.
Consultants leverage Smart Memory to access project histories and client communications, using fast mode for routine updates. In focus mode, it curates insights from diverse project documents to aid in decision-making and strategy development, enhancing efficiency in delivering tailored recommendations to clients.
Offer Smart Memory as a cloud-hosted service with tiered pricing based on usage limits, such as search volume or storage capacity. This model provides recurring revenue and scales easily with enterprise clients needing advanced memory management for AI agents, with potential add-ons for premium support or custom integrations.
Sell perpetual licenses to large organizations for on-premises deployment, including customization and dedicated support. This model targets industries with strict data privacy requirements, like legal or healthcare, where local processing is essential, generating high upfront revenue and long-term service contracts.
Provide a free version with basic fast mode and limited storage to attract individual developers or small teams. Monetize through paid upgrades offering focus mode, advanced analytics, and priority support, encouraging adoption and upselling as users scale their AI agent projects.
š¬ Integration Tip
Start by syncing memory files with the CLI command and test fast mode searches for simple queries before enabling focus mode for complex tasks to ensure smooth integration into existing workflows.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection