Set these in the MCP client’s server entry for the server, and in your shell for CLI commands.
Both must agree on MEMO_HOME and MEMO_KB to see the same file.
Variable Default Effect
MEMO_HOME~/.memo-mcpBase directory. Knowledge bases live in $MEMO_HOME/kb/; overrides in $MEMO_HOME/profiles.json
MEMO_KBdefaultKnowledge-base name; the file is $MEMO_HOME/kb/<name>.db. Must match ^[A-Za-z0-9._-]{1,64}$
Variable Default Effect
MEMO_MODELgranite-small-r2Embedding model id from memo-mcp model ls. Queries use this model’s vectors; missing vectors are embedded in the background at server start
MEMO_PROFILEdefaultRanking profile for the server and the UI (memo-mcp profiles show lists them). The CLI search --profile flag defaults to it
MEMO_RERANKunset 1 loads the cross-encoder reranker. Only profiles with rerank on (precise) use it. Measured slower and worse than the default; experiments only
MEMO_RERANKERms-marco-minilmReranker id to load when MEMO_RERANK=1
Variable Default Effect
MEMO_LOG_FORMATtexttext or json. Logs always go to stderr
MEMO_LOG_LEVELinfodebug, info, warn or error. Unknown values fall back to the default with one warning
MEMO_METRICS_ADDRempty (off) Same as serve --metrics-addr: serve Prometheus metrics at http://<addr>/metrics. Loopback addresses only
MEMO_QUERY_LOGunset 1 records every search in query_log and every tool call in call_log, in the same file. See Call and query logs
Variable Default Effect
MEMO_OLLAMA_URLhttp://127.0.0.1:11434Ollama endpoint for memo-mcp compact --executor ollama. Loopback only unless --allow-remote
MEMO_OLLAMA_MODELnone (required) Ollama model name for the executor. Use a non-thinking instruction model
Variable Replacement Behaviour
JOURNAL_TOKENMEMO_KBUsed as the name when MEMO_KB is unset, with a warning. Old journal files are not opened
JOURNAL_PATHMEMO_HOMEUsed as the base directory when MEMO_HOME is unset, with a warning
The model cache, ~/.cache/memo-mcp/models, is fixed per user.
SQLite pragmas are fixed: WAL, synchronous=NORMAL, busy_timeout=5000, foreign keys on.