CLI Commands
engram CLI command reference
CLI Commands
Engram CLI works standalone with SQLite and on-disk HNSW indexes. No running server required.
Global flags:
--config <path>— path to configuration file--format <json|text|jsonl>— output format (defaultjson)
engram init
Initializes the ~/.engram/ directory with configuration, database, and prints MCP server setup instructions.
engram initThis command is handled before config loading and does not require an existing engram.toml.
engram server
Starts a Unix socket server to accept JSON requests from the MCP server.
engram serverListens on ~/.engram/engram.sock (configurable via server.socket_path). Runs background reindexing at reindex_interval_secs interval.
engram store
Saves a new memory record.
engram store \
--context "Auth module became monolithic, 800 lines" \
--action "Split into middleware + handler + validator" \
--result "Each file < 200 lines, tests isolated"| Flag | Required | Description |
|---|---|---|
--context | yes | Situation or context |
--action | yes | Action taken |
--result | yes | Result or outcome |
--memory-type | no | decision (default), pattern, bugfix, context, antipattern |
--tags | no | Comma-separated tags |
--project | no | Project identifier |
engram store \
--context "Tokens expired silently" \
--action "Added validation middleware with structured logging" \
--result "Auth failures surface immediately with error codes" \
--memory-type bugfix \
--tags "auth,middleware" \
--project api-serverengram search
Searches for relevant records using hybrid search (vector + full-text).
engram search --query "auth middleware architecture"| Flag | Default | Description |
|---|---|---|
--query | — (required) | Search query |
--limit | 10 | Maximum results |
--project | — | Filter by project |
engram search --query "error handling patterns" --limit 5 --project my-apiengram judge
Rates a memory's quality. Results train the Q-Learning router.
engram judge --memory-id "abc-123-def" --score 0.8| Flag | Required | Description |
|---|---|---|
--memory-id | yes | UUID of the memory to judge |
--query | no | Query that found this memory |
--score | no | Explicit score from 0.0 to 1.0 |
engram status
Shows system status: memory count, index size, pending judgments.
engram statusengram status --format textengram consolidate
Manages memory consolidation. Three subcommands:
engram consolidate preview
Finds deduplication candidates without making changes.
engram consolidate preview
engram consolidate preview --stale-days 30 --min-score 0.5engram consolidate analyze
Analyzes candidates with LLM and returns recommendations.
engram consolidate analyzeengram consolidate apply
Applies recommendations: merge, delete, archive.
engram consolidate apply| Flag | Default | Description |
|---|---|---|
--stale-days | from config (90) | Stale threshold (days) |
--min-score | from config (0.3) | Minimum score |
engram train
Manages self-learning through the trainer.
engram train generate
Runs the trainer to generate insights from memory patterns.
engram train generateengram train list
Lists active insights.
engram train listengram train delete
Deletes an insight by ID. Only works for records with type insight.
engram train delete --id "insight-uuid"engram version
Shows the engram version.
engram version
engram version --format text