CLI Reference
CLI Reference Complete reference for all memories.sh CLI commands.
The memories CLI is the primary interface for managing your AI agent memory store. All commands operate on a local SQLite database at ~/.config/memories/local.db.
Command references on this page map to a segmented lifecycle model:
session working memory + long-term semantic/episodic/procedural stores.
See Memory Segmentation .
# First-time setup (auto-configures MCP for detected tools)
memories setup
# Add memories
memories add --rule "Always use TypeScript strict mode"
memories add --decision "Chose Tailwind for utility-first CSS"
memories add --fact "API rate limit is 100/min"
# Search
memories search "authentication"
memories search "how to handle login" --semantic
# Reminders
memories reminders add "0 9 * * 1-5" "Review open TODOs"
memories reminders run
# Generate instruction files
memories generate all
# Sync config files
memories files ingest
memories files apply --global
Command Description initInitialize memories and auto-configure MCP for detected tools (setup alias) loginAuthenticate for cloud sync features
Command Description addAdd a new memory (rule, decision, fact, or note) recallGet rules and relevant memories for AI agents promptOutput memories formatted for AI system prompts
Command Description searchKeyword or semantic search across memories listList memories with optional filters embedGenerate embeddings for semantic search
Command Description editEdit an existing memory forgetSoft-delete memories by ID or bulk filter tagBulk tag and untag operations remindersManage cron-based reminders (add, list, run, enable, disable, delete) staleFind stale memories with superseded/conflict filters reviewInteractively keep/delete stale memories
Command Description sessionManage explicit memory session lifecycle (start, checkpoint, status, end, snapshot) compactRun inactivity compaction worker for active sessions consolidateMerge duplicates and supersede outdated memories openclaw memoryRead/write OpenClaw semantic, daily, and snapshot files
Command Description generateGenerate IDE rule files from memories diffShow what changed since last generate
Command Description exportExport memories to JSON or YAML importImport memories from JSON or YAML ingestImport from existing IDE rule files
Command Description syncManage cloud sync filesSync config files (.agents, .cursor, .claude, etc.)
Command Description configManage agent configuration orgList and switch active organization workspace serveStart the MCP server statsShow memory statistics doctorCheck health and diagnose issues hookManage git hooks
When inside a git repository, commands automatically scope to the current project (detected from the origin remote URL)
When outside a git repo, or when --global is passed, memories are stored with global scope
Global memories are included in all project queries
All memories are stored in a single SQLite database at ~/.config/memories/local.db
FTS5 full-text search with BM25 ranking
Vector embeddings for semantic search (dimension depends on selected model; default is 384)
Soft-deleted memories are retained but excluded from queries
When you run memories setup (or memories init), it automatically:
Detects installed AI tools (Cursor, Claude Code, Windsurf, VS Code)
Configures MCP for each detected tool
Generates instruction files with your existing memories
Imports existing project skill configs (such as .claude/skills and .codex/skills) into memories
This means your memories are immediately available to your AI tools via MCP.