Standalone CLI
The llm-mem binary (no -mcp suffix) is a standalone command-line interface for working with memory banks directly, without an MCP client. It reads the same config file, talks to the same backend, and operates on the same banks as the MCP server.
llm-mem [OPTIONS] [COMMAND]
When to use it
- Local testing and debugging — try a query without spinning up an MCP client
- Scripts and automation — pipe search results into other tools
- Database administration — exports, merges, consistency checks, renames
- Configuration management — generate a template config, run health checks
- Interactive exploration — drop into the REPL for ad-hoc work
Modes
| Flag | Behavior |
|---|---|
| (no args) | Start the interactive REPL |
--single | Run a single command and exit. Useful for scripts. |
--batch <file> | Execute commands from a file (one per line). See Batch mode. |
--repl | Force REPL mode even if subcommand is present. |
--config <path> | Config file path (auto-discovered if not given). |
--banks-dir <path> | Override vector_store.banks_dir. |
All commands at a glance
Document handling
upload— ingest a filebegin-upload/upload-part/process-document— multi-part upload for large filesdoc-status/list-sessions— check upload progress
Browsing
list— list memories with filtersshow— full details of a memory by IDsearch— text or semantic searchstats/layer-stats/layer-tree— bank and pyramid statisticstimeline/timeline-graph/context-resume— chronological viewsdag-export— interactive DAG visualization (HTML)
Configuration
generate-config— write a config templatehealth-check— run static + optional live config checksystem-status— backend health
Database admin
db export/db import— backup and restoredb merge— merge banksdb check/db fix— integrity check and repairdb rename— atomic renamedb export-jsonl/db import(from JSONL) — backend-independent formatdb compact— merge fragments (also prunes old versions)db prune— reclaim disk space from old LanceDB versions
Misc
list-banks— list all bankslist-devices— show available embedding/LLM devicesexport— bank export to JSONmetrics— query and cache metricsclear-backoff— reset abstraction retry timersviz— real-time TUI for processing
REPL-only
Inside the REPL, you also get use <bank> (switch active bank) and savelog (dump log buffer). Output can be formatted as table, detail, json, jsonl, or csv.
Examples
# Interactive REPL
llm-mem
# Single-command scripting
llm-mem --single search --query "JWT auth" --mode semantic --limit 5
llm-mem --single list --bank research --limit 20 --format json
llm-mem --single stats --bank default
# Database admin
llm-mem db check --all
llm-mem db fix --bank research --purge
llm-mem db export --bank default --output backups/default.db --include-sessions
llm-mem db prune --all --older-than-days 0 # reclaim disk from old versions
# Visualize
llm-mem dag-export --bank default --output graph.html --max-nodes 300
# Health & config
llm-mem health-check --live
llm-mem generate-config --output /etc/llm-mem/config.toml
Output formats
Most commands accept --format with one of:
| Value | Best for |
|---|---|
table | Human reading (default for many commands) |
detail | Single-memory views (show) |
json | Programmatic consumption |
jsonl | Streaming, line-by-line |
csv | Spreadsheets / awk |