Both memtomem (LTM) and memtomem-stm (STM) use pydantic-settings with env_prefix + env_nested_delimiter="__". Nested settings use double underscore — MEMTOMEM_EMBEDDING__PROVIDER, not MEMTOMEM_EMBEDDING_PROVIDER.
This public reference tracks the complete memtomem 0.3.12 and memtomem-stm 0.1.41 configuration surfaces. Options are intentionally mirrored here rather than reduced to a curated subset.
Texts per local FastEmbed/ONNX inference batch; runtime-mutable
8
MEMTOMEM_EMBEDDING__MAX_SEQUENCE_TOKENS
Actual-token cap per local ONNX input; 0 restores the model limit. Restart after changing it and force-reindex existing content so vectors use one policy.
1024
MEMTOMEM_EMBEDDING__ONNX_CPU_MEM_ARENA
Reuse ONNX CPU allocations. Restart required; this allocator-only switch does not require re-indexing.
false
MEMTOMEM_EMBEDDING__MAX_CONCURRENT_BATCHES
Max parallel embedding batches
4
MEMTOMEM_EMBEDDING__THREADS
ONNX Runtime thread cap (0 = ORT default)
4
MEMTOMEM_EMBEDDING__PROGRESS_THRESHOLD
Emit per-chunk progress only when a file produces more chunks than this threshold; 0 always emits
Directories reactively re-indexed by the long-running memtomem-server file watcher (JSON list). Pre-existing files are not auto-scanned — seed them once with mm index <dir>, then the watcher picks up further edits. Populated by mm init when you opt in to AI agent memory enrollment.
["~/.memtomem/memories"] plus selected provider folders
MEMTOMEM_INDEXING__PROJECT_MEMORY_DIRS
Project-tier memory roots under .memtomem/memories or .memtomem/memories.local
Deprecated one-shot migration trigger. Existing configs convert detected provider directories into explicit memory_dirs, persist them, and flip this field to false; new installs skip the migration. Use mm init --include-provider ... for new configuration.
true compatibility default
MEMTOMEM_INDEXING__EXCLUDE_PATTERNS
.gitignore-syntax patterns (JSON list) that stack on top of the built-in credential denylist (oauth_creds.json, credentials*, id_rsa*, *.pem, *.key, .ssh/**, …). User !negation cannot override the built-in secret patterns.
[]
MEMTOMEM_INDEXING__TARGET_CHUNK_TOKENS
Greedy semantic-pack target for short sibling sections. Set 0 to disable the pack pass.
384
MEMTOMEM_INDEXING__CHUNK_OVERLAP_TOKENS
Token overlap between adjacent chunks
0
MEMTOMEM_INDEXING__STRUCTURED_CHUNK_MODE
JSON/YAML/TOML chunking mode: original or recursive
original
MEMTOMEM_INDEXING__PARAGRAPH_SPLIT_THRESHOLD
Split long prose into paragraphs above this token count
800
MEMTOMEM_INDEXING__STARTUP_BACKFILL
On server start, run a one-shot scan over memory_dirs to catch files added while the server was down
false
MEMTOMEM_INDEXING__AUTO_SUMMARIZE
Generate AI per-source summaries when LLM is configured
prod (standard Simple/Advanced pages, including Namespaces under Settings) / dev (also adds maintainer pages: Sessions, Search Runs, Quality Lab, Working Memory, Procedures, Health Report, Redaction). mm web --mode and mm web --dev override this at launch.
prod
MEMTOMEM_WEB__HOST
Bind address for mm web; overridden by --host
127.0.0.1
MEMTOMEM_WEB__PORT
Bind port for mm web; overridden by --port
8080
MEMTOMEM_WEB__CSRF_ENFORCE
Enforce CSRF protection on mutating Web UI endpoints. Disable only as an emergency rollback.
Traces session command execution to a JSONL file and, optionally, to Langfuse. Off by default. payload_mode defaults to metadata, which records no payload body; redacted keeps a secret-masked body, and full keeps the entire body.
Variable
Description
Default
MEMTOMEM_SESSION_TRACE__ENABLED
Enable session execution tracing
false
MEMTOMEM_SESSION_TRACE__JSONL_ENABLED
Write to the JSONL sink
true
MEMTOMEM_SESSION_TRACE__JSONL_PATH
JSONL output file path
~/.memtomem/traces/session-traces.jsonl
MEMTOMEM_SESSION_TRACE__LANGFUSE_ENABLED
Emit traces to the Langfuse sink
false
MEMTOMEM_SESSION_TRACE__LANGFUSE_PUBLIC_KEY
Langfuse public key
""
MEMTOMEM_SESSION_TRACE__LANGFUSE_SECRET_KEY
Langfuse secret key
""
MEMTOMEM_SESSION_TRACE__LANGFUSE_HOST
Langfuse host URL
""
MEMTOMEM_SESSION_TRACE__SAMPLING_RATE
0.0–1.0. Fraction of sessions recorded
1.0
MEMTOMEM_SESSION_TRACE__PAYLOAD_MODE
metadata (no body) / redacted (secret-masked body) / full (entire body)
metadata
MEMTOMEM_SESSION_TRACE__MAX_PAYLOAD_CHARS
Char cap on payload retained in a trace
10000
Setting langfuse_enabled=true requires the langfuse extra installed and both the public and secret keys set; otherwise startup validation fails.
STM settings are organized into root fields plus PROXY__*, SURFACING__*, FORMATION__*, HOOK__*, DAEMON__*, and LANGFUSE__*. Compression, caching, metrics, auto-indexing, and extraction all live under PROXY__.
~/.memtomem/stm_proxy.json loads ProxyConfig only. Root, surfacing, formation, hook, daemon, and Langfuse settings are environment/default-only; placing those blocks in the JSON file has no effect. proxy.consumer_model propagation into surfacing budget resolution is the documented exception.
Daemon handshake, ownership lock, and detached log directory
~/.memtomem
MEMTOMEM_STM_LOG_LEVEL
Log level
WARNING
MEMTOMEM_STM_LOG_FILE
Optional rotating log file; files use 0600, 2 MiB rotation, and three backups
unset
MEMTOMEM_STM_ADVERTISE_OBSERVABILITY_TOOLS
When true, advertises eight observability/admin tools (stm_proxy_stats, stm_proxy_health, stm_proxy_cache_clear, stm_surfacing_stats, stm_selection_stats, stm_compression_stats, stm_progressive_stats, stm_tuning_recommendations). The four model-facing tools remain visible when false.
false
MEMTOMEM_STM_FORMATION__ENABLED
Advertise the opt-in stm_memory_propose tool. This flag alone controls advertisement; upstream LTM support for review-first proposals is checked at call time (an incompatible core returns formation_unsupported).
false
MEMTOMEM_STM_FORMATION__MAX_CONTENT_CHARS
Maximum review-first candidate content size; larger proposals are rejected
How MCP tool annotations affect caching: conservative, strict, or ignore
conservative
Cache schema 4 stores the canonical MCP content envelope, including structuredContent and _meta. On an incompatible older schema, STM performs its documented one-time cache reset rather than serving a mixed envelope.
Run indexing in the background, off the request path
false
MEMTOMEM_STM_PROXY__AUTO_INDEX__MIN_CHARS
Minimum response size to index
2000
MEMTOMEM_STM_PROXY__AUTO_INDEX__MEMORY_DIR
Output directory
~/.memtomem/proxy_index
MEMTOMEM_STM_PROXY__AUTO_INDEX__NAMESPACE
Namespace for auto-indexed memories
proxy-{server}
The bundled mms server reads from LTM but, by design, does not write back to it. These auto_index and extraction fields are therefore accepted as valid config but have no effect on its behavior.
An STM-native filter that decides, at tool-advertisement time, which of an upstream’s tools the agent gets to see. Tools that fail consistently, carry credentials, or duplicate another tool’s name are kept out of the advertised list. Health signals are evaluated once at proxy startup, so the advertised set stays stable for the session.
Variable
Description
Default
MEMTOMEM_STM_PROXY__EXPOSURE__PROFILE
strict (signal rules hard-reject) / review (demote in ranking instead of rejecting, recorded in telemetry) / explore (signal rules off)
strict
MEMTOMEM_STM_PROXY__EXPOSURE__HEALTH_WINDOW_HOURS
Look-back window over the metrics store for per-tool health
24.0
MEMTOMEM_STM_PROXY__EXPOSURE__HEALTH_MIN_CALLS
Minimum calls in the window before health is judged; below this a tool is presumed healthy
Records one selection + execution entry per proxied call as JSONL, and BM25-ranks the advertised tool set against the call’s query signal. Ranking is recorded into telemetry only — it never changes exposure.
Consults a separate tool-graph MCP server for cross-server authorization / data-flow eligibility and feeds the verdict into the exposure filter as an extra rule source. Off by default. The graph server is consulted, never proxied — the client never sees its tools.
Variable
Description
Default
MEMTOMEM_STM_PROXY__TOOLGRAPH__ENABLED
Enable the external tool-graph eligibility provider
false
MEMTOMEM_STM_PROXY__TOOLGRAPH__SOURCE
Policy source: live stdio consult or signed bundle file
stdio
MEMTOMEM_STM_PROXY__TOOLGRAPH__BUNDLE_PATH
Local policy-bundle path used when source=bundle
~/.memtomem/toolgraph/policy-bundle.json
MEMTOMEM_STM_PROXY__TOOLGRAPH__COMMAND
Launch command for the stdio tool-graph MCP server
toolgraph
MEMTOMEM_STM_PROXY__TOOLGRAPH__ARGS
Command args (JSON list)
["serve"]
MEMTOMEM_STM_PROXY__TOOLGRAPH__ENV
Extra environment for the graph server (e.g. NEO4J_*, JSON object)
null
MEMTOMEM_STM_PROXY__TOOLGRAPH__AGENT_ID
Identity (registered in the graph) that eligibility is authorized against
stm-proxy
MEMTOMEM_STM_PROXY__TOOLGRAPH__SERVER_NAME_MAP
Map STM upstream names to graph server identities (JSON object)
{}
MEMTOMEM_STM_PROXY__TOOLGRAPH__QUERY_PROFILE
Profile passed to the graph consult
strict
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_UNREACHABLE
Graph unreachable: open (advertise per STM-native rules) / closed (withhold every tool the graph did not bless)
open
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_TOOL_NOT_FOUND
Candidate not in the graph: open / closed
open
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_AGENT_NOT_FOUND
agent_id unknown (usually a typo): fail_start / open / closed
fail_start
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_PROTOCOL_ERROR
Graph response contract violation: fail_start / open / closed
fail_start
MEMTOMEM_STM_PROXY__TOOLGRAPH__RISK_PENALTY_SCALE
Ranking-demotion multiplier for eligible-but-risky tools
These live on per-upstream UpstreamServerConfig entries in ~/.memtomem/stm_proxy.json (set per server, not via individual scalar env vars). Every accepted field is listed below.
Field
Description
Default
command
stdio server executable
""
args
stdio server arguments
[]
env
additional server environment
null
cwd
server working directory
null
prefix
required namespace segment used in composed tool names
required
transport
stdio, sse, or streamable_http
stdio
url
endpoint for a network transport
""
headers
static headers for a network transport
null
compression
default compression strategy for this upstream
auto
max_result_chars
result character budget
8000
max_result_tokens
optional token-equivalent result budget
null
chars_per_token
optional per-upstream character/token estimate
null (inherits proxy)
token_estimation_mode
optional static / unicode estimator override
null (inherits proxy)
retention_floor
optional minimum compression-retention fraction
null (inherits proxy)
llm
per-upstream LLM compressor settings
null
selective
selective-compressor settings
null
hybrid
hybrid-compressor settings
null
progressive
cursor-based progressive-delivery settings
null
cleaning
pre-compression cleaning settings
null
tool_overrides
per-tool ToolOverrideConfig map
{}
auto_index
override the global accepted compatibility setting
null
extraction
override the global accepted compatibility setting
null
cache
override response caching
null
cache_ttl_seconds
override response-cache TTL
null
expose_in_profiles
exposure profiles allowed for the upstream
null
surfacing_enabled
Opt this upstream’s responses in/out of proactive surfacing. false suppresses surfacing for every tool on this server.
true
max_retries
reconnect/call retries after the first attempt
3
reconnect_delay_seconds
initial reconnect delay
1.0
max_reconnect_delay_seconds
reconnect backoff ceiling
30.0
connect_timeout_seconds
upstream connection timeout
30.0
call_timeout_seconds
Per-attempt timeout for session.call_tool(). On timeout the session is force-reset and the retry loop proceeds.
90.0
overall_deadline_seconds
Total wall-clock budget across all retry attempts. Prevents call_timeout × (max_retries+1) worst-case blowout.
180.0
circuit_max_failures
failures before opening this upstream’s circuit
3
circuit_reset_seconds
open-circuit reset interval
60.0
max_description_chars
per-upstream tool-description cap
200
strip_schema_descriptions
per-upstream nested schema-description stripping
false
origin
Import-provenance block written by mms add --import/mms init and used by mms eject; CLI JSON output redacts the stored original entry.
Each tool_overrides.<tool> accepts compression, max_result_chars, max_result_tokens, chars_per_token, token_estimation_mode, retention_floor, and the llm, selective, hybrid, progressive, and cleaning blocks above. It also accepts every field below.
Whether LTM should rerank surfaced candidates; null delegates to LTM configuration
false
MEMTOMEM_STM_SURFACING__SCALE_GATED_MIN_SCORE
Apply score_scale-aware normalization before the minimum-score gate
true
MEMTOMEM_STM_SURFACING__LTM_MCP_TRANSPORT
LTM MCP transport: stdio, sse, or streamable_http
stdio
MEMTOMEM_STM_SURFACING__LTM_MCP_COMMAND
MCP command launching the LTM server for stdio transport
memtomem-server
MEMTOMEM_STM_SURFACING__LTM_MCP_ARGS
Args for the LTM command (JSON list)
[]
MEMTOMEM_STM_SURFACING__LTM_MCP_URL
LTM endpoint URL for sse / streamable_http
""
MEMTOMEM_STM_SURFACING__LTM_MCP_HEADERS
Optional static headers for network LTM transport (JSON object)
null
Surfacing applies only to calls routed through STM or supported host hooks. It is not a provider-memory layer and does not silently inject into unrelated direct MCP calls.
Minimum retained fraction for built-in Bash output compression
0.65
MEMTOMEM_STM_HOOK_SURFACE_TOOLS
Direct-read comma-separated canonical hook-tool allowlist, separate from the nested settings model. Host adapters map names such as Claude Read / Bash to read / shell.
read,grep,glob,shell
MEMTOMEM_STM_DAEMON__HOST
Local daemon bind address; keep it loopback-only
127.0.0.1
MEMTOMEM_STM_DAEMON__ALLOW_NON_LOOPBACK
Explicitly permit a non-loopback daemon bind address
false
MEMTOMEM_STM_DAEMON__IDLE_TIMEOUT_SECONDS
Stop the daemon after this many idle seconds; 0 disables idle shutdown
900.0
MEMTOMEM_STM_DAEMON__MAX_PENDING_REQUESTS
Bound admitted hook and standalone surfacing requests
Setting MEMTOMEM_STM_LANGFUSE__ENABLED=true without the [langfuse] extra installed raises a ValueError at startup (fail-fast since v0.1.16). Install the extra first, or leave enabled=false. The old silent-disable-with-WARNING behavior is gone, so a typo no longer leaves tracing quietly off.