Skip to content

Environment Variables

Both memtomem (LTM) and memtomem-stm (STM) use pydantic-settings with env_prefix + env_nested_delimiter="__". Nested settings use double underscoreMEMTOMEM_EMBEDDING__PROVIDER, not MEMTOMEM_EMBEDDING_PROVIDER.

Resolution order (highest priority first): CLI flags → environment variables → config file → built-in defaults.

This public reference tracks the memtomem 0.3.10 and memtomem-stm 0.1.38 configuration surfaces.

VariableDescriptionDefault
MEMTOMEM_STORAGE__BACKENDStorage backendsqlite
MEMTOMEM_STORAGE__SQLITE_PATHSQLite database file path~/.memtomem/memtomem.db
MEMTOMEM_STORAGE__COLLECTION_NAMELogical collection namememories
VariableDescriptionDefault
MEMTOMEM_EMBEDDING__PROVIDERnone / onnx / ollama / openainone (keyword-only until mm init runs)
MEMTOMEM_EMBEDDING__MODELModel name for the chosen provider""
MEMTOMEM_EMBEDDING__DIMENSIONVector dimension (must match model)provider-specific
MEMTOMEM_EMBEDDING__BASE_URLOllama / OpenAI-compatible endpoint
MEMTOMEM_EMBEDDING__API_KEYAPI key for paid providers
MEMTOMEM_EMBEDDING__BATCH_SIZETexts per embedding batch64
MEMTOMEM_EMBEDDING__MAX_CONCURRENT_BATCHESMax parallel embedding batches4
MEMTOMEM_EMBEDDING__THREADSONNX Runtime thread cap (0 = ORT default)4
MEMTOMEM_EMBEDDING__PROGRESS_THRESHOLDEmit per-chunk progress only when a file produces more chunks than this threshold; 0 always emits32
VariableDescriptionDefault
MEMTOMEM_INDEXING__MEMORY_DIRSDirectories reactively re-indexed by the mm 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_DIRSProject-tier memory roots under .memtomem/memories or .memtomem/memories.local[]
MEMTOMEM_INDEXING__SUPPORTED_EXTENSIONSFile extensions to index (JSON list)[".md", ".json", ".yaml", ".yml", ".toml", ".py", ".js", ".ts", ".tsx", ".jsx"]
MEMTOMEM_INDEXING__MAX_CHUNK_TOKENSMaximum tokens per chunk512
MEMTOMEM_INDEXING__MIN_CHUNK_TOKENSMerge threshold for short chunks128
MEMTOMEM_INDEXING__AUTO_DISCOVERWhen true, mm init prompts to enroll AI agent memory directories into memory_dirs. Set false to skip the prompt.true
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_TOKENSGreedy semantic-pack target for short sibling sections. Set 0 to disable the pack pass.384
MEMTOMEM_INDEXING__CHUNK_OVERLAP_TOKENSToken overlap between adjacent chunks0
MEMTOMEM_INDEXING__STRUCTURED_CHUNK_MODEJSON/YAML/TOML chunking mode: original or recursiveoriginal
MEMTOMEM_INDEXING__PARAGRAPH_SPLIT_THRESHOLDSplit long prose into paragraphs above this token count800
MEMTOMEM_INDEXING__STARTUP_BACKFILLOn server start, run a one-shot scan over memory_dirs to catch files added while the server was downfalse
MEMTOMEM_INDEXING__AUTO_SUMMARIZEGenerate AI per-source summaries when LLM is configuredfalse
MEMTOMEM_INDEXING__SUMMARY_LANGUAGEOutput language for AI source summariesen
MEMTOMEM_INDEXING__SUMMARY_MAX_INPUT_CHARSMax source chars sent to the summary LLM3000
MEMTOMEM_INDEXING__SUMMARY_MAX_TOKENSSummary output token cap256

Path-glob → namespace mappings that auto-tag files at index time, so you don’t pass namespace= on every mem_index call.

VariableDescriptionDefault
MEMTOMEM_NAMESPACE__RULESJSON list of {path_glob, namespace} objects. pathspec.GitIgnoreSpec patterns, case-insensitive. {parent} and {ancestor:N} placeholders expand from the matched file path. Resolution order: explicit namespace= param → rules (first match) → enable_auto_nsdefault_namespace.[]
MEMTOMEM_NAMESPACE__DEFAULT_NAMESPACEDefault namespace for new chunksdefault
MEMTOMEM_NAMESPACE__ENABLE_AUTO_NSDerive namespace from a file’s immediate parent folder when no explicit namespace or rule appliesfalse

Example (via config.d/namespace.json, APPEND-merged):

{"namespace": {"rules": [
{"path_glob": "docs/**", "namespace": "docs"},
{"path_glob": "projects/{parent}/**", "namespace": "proj/{parent}"}
]}}

Cross-encoder reranking runs fully locally by default — no external API required.

VariableDescriptionDefault
MEMTOMEM_RERANK__ENABLEDEnable reranking of hybrid search resultsfalse
MEMTOMEM_RERANK__PROVIDERfastembed (local ONNX) / cohere (external API)fastembed
MEMTOMEM_RERANK__MODELModel name. Use jinaai/jina-reranker-v2-base-multilingual for non-English content.Xenova/ms-marco-MiniLM-L-6-v2
MEMTOMEM_RERANK__API_KEYOnly required when provider=cohere
MEMTOMEM_RERANK__OVERSAMPLEPool multiplier over response_top_k. Pool size is max(min_pool, min(max_pool, int(oversample * response_top_k))).2.0
MEMTOMEM_RERANK__MIN_POOLFloor — reranker never sees fewer candidates than this20
MEMTOMEM_RERANK__MAX_POOLCap — prevents runaway cost at large top_k200
MEMTOMEM_RERANK__TOP_KDeprecated legacy pool size; migrates to min_pool when present20
VariableDescriptionDefault
MEMTOMEM_SEARCH__DEFAULT_TOP_KDefault result count10
MEMTOMEM_SEARCH__BM25_CANDIDATESBM25 candidate pool size50
MEMTOMEM_SEARCH__DENSE_CANDIDATESDense vector candidate pool size50
MEMTOMEM_SEARCH__RRF_KReciprocal Rank Fusion constant60
MEMTOMEM_SEARCH__ENABLE_BM25Enable keyword retrievertrue
MEMTOMEM_SEARCH__ENABLE_DENSEEnable semantic vector retrievertrue
MEMTOMEM_SEARCH__RRF_WEIGHTSRRF weights for [BM25, Dense] (JSON list, REPLACE merge)[1.0, 1.0]
MEMTOMEM_SEARCH__TOKENIZERFTS tokenizer: unicode61 or kiwipiepyunicode61
MEMTOMEM_SEARCH__CACHE_TTLSearch result cache TTL in seconds30.0
MEMTOMEM_SEARCH__SYSTEM_NAMESPACE_PREFIXESNamespace prefixes hidden from default namespace=None search (JSON list, APPEND merge)["archive:", "agent-runtime:"]

Half-life decay multiplier applied to hybrid-search scores. Gradually deprioritises older chunks.

VariableDescriptionDefault
MEMTOMEM_DECAY__ENABLEDEnable time-based decay weightingfalse
MEMTOMEM_DECAY__HALF_LIFE_DAYSHalf-life in days — a chunk’s contribution halves every interval30.0

Maximal Marginal Relevance rerank. Reduces redundancy among top results and mixes in alternate angles.

VariableDescriptionDefault
MEMTOMEM_MMR__ENABLEDEnable MMR diversity rerankfalse
MEMTOMEM_MMR__LAMBDA_PARAM0.0–1.0. 0.0 = max diversity, 1.0 = max relevance0.7

Frequency-based multiplier that promotes chunks which have been accessed often.

VariableDescriptionDefault
MEMTOMEM_ACCESS__ENABLEDEnable access-frequency boostfalse
MEMTOMEM_ACCESS__MAX_BOOSTScore multiplier ceiling (must be >= 1.0)1.5

Multiplier derived from chunk metadata features (tags, size, position, …) applied on top of the search score.

VariableDescriptionDefault
MEMTOMEM_IMPORTANCE__ENABLEDEnable importance boostfalse
MEMTOMEM_IMPORTANCE__MAX_BOOSTScore multiplier ceiling (must be >= 1.0)1.5
MEMTOMEM_IMPORTANCE__WEIGHTSImportance-feature weight vector (JSON list, REPLACE merge)[0.3, 0.2, 0.3, 0.2]

Augments the original query with related tags, headings, or LLM-generated terms to improve recall. strategy=llm uses the LLM section below.

VariableDescriptionDefault
MEMTOMEM_QUERY_EXPANSION__ENABLEDEnable query expansionfalse
MEMTOMEM_QUERY_EXPANSION__MAX_TERMSMax additional terms to append3
MEMTOMEM_QUERY_EXPANSION__STRATEGYtags / headings / both / llmtags

Small-to-big retrieval: returns ±N adjacent chunks around each search hit. Useful for recovering fragmented context in long documents.

VariableDescriptionDefault
MEMTOMEM_CONTEXT_WINDOW__ENABLEDEnable context-window expansionfalse
MEMTOMEM_CONTEXT_WINDOW__WINDOW_SIZE±N adjacent chunks per hit (010)2

LLM (summarisation · query-expansion backend)

Section titled “LLM (summarisation · query-expansion backend)”

Shared LLM backend used by query_expansion.strategy=llm, consolidation summaries, and other LLM-powered features.

VariableDescriptionDefault
MEMTOMEM_LLM__ENABLEDEnable LLM-powered featuresfalse
MEMTOMEM_LLM__PROVIDERollama / openai / anthropic / compatible endpointollama
MEMTOMEM_LLM__MODELModel name. Empty = provider-specific default""
MEMTOMEM_LLM__BASE_URLEndpoint URLhttp://localhost:11434
MEMTOMEM_LLM__API_KEYAPI key for paid providers
MEMTOMEM_LLM__MAX_TOKENSGeneration token cap1024
MEMTOMEM_LLM__TIMEOUTRequest timeout in seconds60.0
VariableDescriptionDefault
MEMTOMEM_TOOL_MODEcore (9 names incl. mem_do) / standard (38) / full (96 current tools + deprecated mem_context_migrate alias)core
VariableDescriptionDefault
MEMTOMEM_WEB__MODEprod (polished pages only) / dev (adds maintainer pages: Sessions, Namespaces, Health Report). mm web --mode and mm web --dev override this at launch.prod
VariableDescriptionDefault
MEMTOMEM_POLICY__ENABLEDRun PolicyScheduler (auto_archive / auto_promote / auto_expire / auto_tag)false
MEMTOMEM_POLICY__SCHEDULER_INTERVAL_MINUTESScheduler tick interval60.0
MEMTOMEM_POLICY__MAX_ACTIONS_PER_RUNCumulative action cap per scheduled policy run100
MEMTOMEM_WEBHOOK__ENABLEDEnable outbound webhooks for memory eventsfalse
MEMTOMEM_WEBHOOK__URLWebhook target URL
MEMTOMEM_WEBHOOK__EVENTSEvent types to send (JSON list, APPEND merge)["add", "delete", "search"]
MEMTOMEM_WEBHOOK__SECRETHMAC signing secret
MEMTOMEM_WEBHOOK__TIMEOUT_SECONDSHTTP timeout10.0

Background job that periodically groups near-duplicate memories and compresses them into archive summaries.

VariableDescriptionDefault
MEMTOMEM_CONSOLIDATION_SCHEDULE__ENABLEDRun the consolidation schedulerfalse
MEMTOMEM_CONSOLIDATION_SCHEDULE__INTERVAL_HOURSScheduler interval (hours)24.0
MEMTOMEM_CONSOLIDATION_SCHEDULE__MIN_GROUP_SIZEMinimum group size to consolidate3
MEMTOMEM_CONSOLIDATION_SCHEDULE__MAX_GROUPSMax groups processed per run10

Background loop for periodic health checks, orphan-record cleanup, and automatic maintenance.

VariableDescriptionDefault
MEMTOMEM_HEALTH_WATCHDOG__ENABLEDRun the health watchdogfalse
MEMTOMEM_HEALTH_WATCHDOG__HEARTBEAT_INTERVAL_SECONDSHeartbeat interval60.0
MEMTOMEM_HEALTH_WATCHDOG__DIAGNOSTIC_INTERVAL_SECONDSDiagnostic-check interval300.0
MEMTOMEM_HEALTH_WATCHDOG__DEEP_INTERVAL_SECONDSDeep-scan interval3600.0
MEMTOMEM_HEALTH_WATCHDOG__MAX_SNAPSHOTSSnapshot retention cap1000
MEMTOMEM_HEALTH_WATCHDOG__ORPHAN_CLEANUP_THRESHOLDOrphan-record cleanup threshold10
MEMTOMEM_HEALTH_WATCHDOG__AUTO_MAINTENANCEPerform automatic maintenancetrue
VariableDescriptionDefault
MEMTOMEM_SCHEDULER__ENABLEDEnable cron dispatch for registered maintenance jobsfalse
MEMTOMEM_SCHEDULER__MAX_CONCURRENT_JOBSMax concurrently running scheduled jobs1
MEMTOMEM_SCHEDULER__DEFAULT_TIMEZONESchedule timezone; Phase A honors utcutc
MEMTOMEM_SCHEDULER__RUNNER_TIMEOUT_SECONDSTimeout for one scheduled job run300.0
VariableDescriptionDefault
MEMTOMEM_SESSION_SUMMARY__AUTOAuto-generate an LLM summary on mem_session_end when enough chunks were addedtrue
MEMTOMEM_SESSION_SUMMARY__MIN_CHUNKSMinimum chunks before auto-summary runs5
MEMTOMEM_SESSION_SUMMARY__MAX_SUMMARY_TOKENSOutput token cap500
MEMTOMEM_SESSION_SUMMARY__MAX_INPUT_CHARSSkip auto-summary above this assembled input size60000
MEMTOMEM_SESSION_SUMMARY__MAX_SUMMARY_LINKSCap summary-to-source chunk links50
MEMTOMEM_SESSION_SUMMARY__EXPANSION_LOOKUP_TOP_KSession-summary chunks considered for search rescue3
MEMTOMEM_SESSION_SUMMARY__EXPANSION_SCORE_THRESHOLDMinimum summary score for rescue expansion0.3
MEMTOMEM_SESSION_SUMMARY__EXPANSION_RESCUE_WEIGHTRRF input weight for rescued source-file hits0.5

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.

VariableDescriptionDefault
MEMTOMEM_SESSION_TRACE__ENABLEDEnable session execution tracingfalse
MEMTOMEM_SESSION_TRACE__JSONL_ENABLEDWrite to the JSONL sinktrue
MEMTOMEM_SESSION_TRACE__JSONL_PATHJSONL output file path~/.memtomem/traces/session-traces.jsonl
MEMTOMEM_SESSION_TRACE__LANGFUSE_ENABLEDEmit traces to the Langfuse sinkfalse
MEMTOMEM_SESSION_TRACE__LANGFUSE_PUBLIC_KEYLangfuse public key""
MEMTOMEM_SESSION_TRACE__LANGFUSE_SECRET_KEYLangfuse secret key""
MEMTOMEM_SESSION_TRACE__LANGFUSE_HOSTLangfuse host URL""
MEMTOMEM_SESSION_TRACE__SAMPLING_RATE0.0–1.0. Fraction of sessions recorded1.0
MEMTOMEM_SESSION_TRACE__PAYLOAD_MODEmetadata (no body) / redacted (secret-masked body) / full (entire body)metadata
MEMTOMEM_SESSION_TRACE__MAX_PAYLOAD_CHARSChar cap on payload retained in a trace10000

Setting langfuse_enabled=true requires the langfuse extra installed and both the public and secret keys set; otherwise startup validation fails.

VariableDescriptionDefault
MEMTOMEM_LOG_LEVELDEBUG / INFO / WARNING / ERRORINFO
MEMTOMEM_LOG_FORMATLog format
VariableDescriptionDefault
MEMTOMEM_HOOKS__TARGET_SCOPEScope for memtomem-managed Claude Code settings hooks: user, project_shared, or project_localuser
MEMTOMEM_CONTEXT_GATEWAY__KNOWN_PROJECTS_PATHWeb UI project registry for Context Gateway~/.memtomem/known_projects.json
MEMTOMEM_CONTEXT_GATEWAY__EXPERIMENTAL_CLAUDE_PROJECTS_SCANDecode ~/.claude/projects/<encoded> directory names back into project roots and scan them (includes unverified candidates)false
MEMTOMEM_CONTEXT_GATEWAY__AUTO_DISPLAY_CONFIGURED_PROJECTSAuto-display a scanned project only when its root carries a recognized runtime marker (.claude/.gemini/.codex/.agents/.kimi/.memtomem)true
MEMTOMEM_CONTEXT_GATEWAY__USER_TIER_ENABLEDForward-compat field gating writes to the User tier (host-global artifacts). While false, the User tier is hidden from discovery responsesfalse
ProviderGPUCostNotes
onnxNoFreeBuilt-in via fastembed. ~270 MB on first run
ollamaNoFreeRequires Ollama. ollama pull nomic-embed-text
openaiNoPaidRequires API key

Full list: configuration.md in the upstream repo.

STM (memtomem-stm) — prefix MEMTOMEM_STM_

Section titled “STM (memtomem-stm) — prefix MEMTOMEM_STM_”

STM settings are organized into six sections: a flat LOG_LEVEL, plus PROXY__*, SURFACING__*, HOOK__*, DAEMON__*, and LANGFUSE__*. Compression, caching, metrics, auto-indexing, and extraction all live under PROXY__.

VariableDescriptionDefault
MEMTOMEM_STM_LOG_LEVELLog levelWARNING
MEMTOMEM_STM_ADVERTISE_OBSERVABILITY_TOOLSWhen 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__ENABLEDAdvertise 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
VariableDescriptionDefault
MEMTOMEM_STM_PROXY__ENABLEDMaster switch for the proxy pipelinefalse
MEMTOMEM_STM_PROXY__DEFAULT_COMPRESSIONDefault compression strategyauto
MEMTOMEM_STM_PROXY__DEFAULT_MAX_RESULT_CHARSPer-response char budget16000
MEMTOMEM_STM_PROXY__MAX_UPSTREAM_CHARSOOM guard on upstream response size10000000
MEMTOMEM_STM_PROXY__MIN_RESULT_RETENTIONRetention floor (0.0–1.0)0.65
VariableDescriptionDefault
MEMTOMEM_STM_PROXY__CACHE__ENABLEDEnable response cachingtrue
MEMTOMEM_STM_PROXY__CACHE__DEFAULT_TTL_SECONDSCache TTL3600
MEMTOMEM_STM_PROXY__CACHE__DB_PATHCache DB location
MEMTOMEM_STM_PROXY__CACHE__MAX_ENTRIESCache eviction ceiling
VariableDescriptionDefault
MEMTOMEM_STM_PROXY__AUTO_INDEX__ENABLEDIndex tool responses into LTMfalse
MEMTOMEM_STM_PROXY__AUTO_INDEX__BACKGROUNDRun indexing in the background, off the request pathfalse
MEMTOMEM_STM_PROXY__AUTO_INDEX__MIN_CHARSMinimum response size to index
MEMTOMEM_STM_PROXY__AUTO_INDEX__MEMORY_DIROutput directory
MEMTOMEM_STM_PROXY__AUTO_INDEX__NAMESPACENamespace for auto-indexed memoriesproxy-{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.

Proxy → Metrics / Extraction / Relevance scorer

Section titled “Proxy → Metrics / Extraction / Relevance scorer”
VariableDescriptionDefault
MEMTOMEM_STM_PROXY__METRICS__ENABLEDRecord call metricstrue
MEMTOMEM_STM_PROXY__EXTRACTION__ENABLEDStage 4b EXTRACT (fact extraction)false
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__SCORERScorer backend
MEMTOMEM_STM_PROXY__COMPRESSION_FEEDBACK__ENABLEDPersist stm_compression_feedbacktrue
MEMTOMEM_STM_PROXY__PROGRESSIVE_READS__ENABLEDRecord progressive-delivery read telemetry (surfaces via stm_progressive_stats)true
MEMTOMEM_STM_PROXY__LOCK_TIMEOUT_SECONDSInternal lock-acquisition ceiling; a timeout signals a deadlock/stuck holder rather than a slow upstream30.0

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.

VariableDescriptionDefault
MEMTOMEM_STM_PROXY__EXPOSURE__PROFILEstrict (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_HOURSLook-back window over the metrics store for per-tool health24.0
MEMTOMEM_STM_PROXY__EXPOSURE__HEALTH_MIN_CALLSMinimum calls in the window before health is judged; below this a tool is presumed healthy5
MEMTOMEM_STM_PROXY__EXPOSURE__HEALTH_ERROR_RATE_THRESHOLDUpstream-attributable error rate at or above which a tool is flagged unhealthy0.95
MEMTOMEM_STM_PROXY__EXPOSURE__REVIEW_RISK_PENALTYRanking-demotion multiplier applied to signal-flagged tools under the review profile0.5

Proxy → Selection telemetry / Tool relevance

Section titled “Proxy → Selection telemetry / Tool relevance”

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.

VariableDescriptionDefault
MEMTOMEM_STM_PROXY__SELECTION_TELEMETRY__ENABLEDEnable per-call selection/execution JSONL recordsfalse
MEMTOMEM_STM_PROXY__SELECTION_TELEMETRY__PATHJSONL log path~/.memtomem/stm_selection_log.jsonl
MEMTOMEM_STM_PROXY__SELECTION_TELEMETRY__SAMPLE_RATE0.0–1.0. Fraction of calls recorded1.0
MEMTOMEM_STM_PROXY__SELECTION_TELEMETRY__MAX_BYTESRotate the log at this size50000000
MEMTOMEM_STM_PROXY__SELECTION_TELEMETRY__MAX_BACKUPSRotated files kept (0 truncates instead)3
MEMTOMEM_STM_PROXY__TOOL_RELEVANCE__ENABLEDRecord per-call BM25 tool ranking; only takes effect when selection_telemetry is ontrue
MEMTOMEM_STM_PROXY__TOOL_RELEVANCE__TOP_NRanked candidates recorded per selection event20

Proxy → Tool-graph eligibility (optional)

Section titled “Proxy → Tool-graph eligibility (optional)”

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.

VariableDescriptionDefault
MEMTOMEM_STM_PROXY__TOOLGRAPH__ENABLEDEnable the external tool-graph eligibility providerfalse
MEMTOMEM_STM_PROXY__TOOLGRAPH__COMMANDLaunch command for the stdio tool-graph MCP servertoolgraph
MEMTOMEM_STM_PROXY__TOOLGRAPH__ARGSCommand args (JSON list)["serve"]
MEMTOMEM_STM_PROXY__TOOLGRAPH__ENVExtra environment for the graph server (e.g. NEO4J_*, JSON object)null
MEMTOMEM_STM_PROXY__TOOLGRAPH__AGENT_IDIdentity (registered in the graph) that eligibility is authorized againststm-proxy
MEMTOMEM_STM_PROXY__TOOLGRAPH__QUERY_PROFILEProfile passed to the graph consultstrict
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_UNREACHABLEGraph unreachable: open (advertise per STM-native rules) / closed (withhold every tool the graph did not bless)open
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_TOOL_NOT_FOUNDCandidate not in the graph: open / closedopen
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_AGENT_NOT_FOUNDagent_id unknown (usually a typo): fail_start / open / closedfail_start
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_PROTOCOL_ERRORGraph response contract violation: fail_start / open / closedfail_start
MEMTOMEM_STM_PROXY__TOOLGRAPH__RISK_PENALTY_SCALERanking-demotion multiplier for eligible-but-risky tools1.0
MEMTOMEM_STM_PROXY__TOOLGRAPH__TIMEOUT_SECONDSPer-consult timeout5.0
MEMTOMEM_STM_PROXY__TOOLGRAPH__CONSULT_CACHE_ENABLEDDisk-cache a successful consult’s verdicttrue
MEMTOMEM_STM_PROXY__TOOLGRAPH__CONSULT_CACHE_PATHSQLite path for the consult cache~/.memtomem/toolgraph_consult.db

These live on per-upstream UpstreamServerConfig entries in ~/.memtomem/stm_proxy.json (set per server, not via env vars). The timeout fields fall back to the defaults below for every registered upstream unless overridden.

FieldDescriptionDefault
surfacing_enabledOpt this upstream’s responses in/out of proactive surfacing. false suppresses surfacing for every tool on this server.true
originImport-provenance block. Written by mms add --import/mms init and used later by mms eject to restore the original entry to the host config.
call_timeout_secondsPer-attempt timeout for session.call_tool(). On timeout the session is force-reset and the retry loop proceeds.90.0
overall_deadline_secondsTotal wall-clock budget across all retry attempts. Prevents call_timeout × (max_retries+1) worst-case blowout.180.0
compression.llm.llm_timeout_secondsTimeout for llm_summary compression; on timeout STM falls back to truncate.60.0
VariableDescriptionDefault
MEMTOMEM_STM_SURFACING__ENABLEDEnable proactive surfacing from LTMtrue
MEMTOMEM_STM_SURFACING__MIN_SCOREMinimum relevance score0.03
MEMTOMEM_STM_SURFACING__MAX_RESULTSMax memories injected per call3
MEMTOMEM_STM_SURFACING__MIN_RESPONSE_CHARSSkip surfacing on tiny responses5000
MEMTOMEM_STM_SURFACING__MIN_QUERY_TOKENSMin tokens in extracted query3
MEMTOMEM_STM_SURFACING__DEDUP_TTL_SECONDSCross-session dedup window604800 (7 days)
MEMTOMEM_STM_SURFACING__FEEDBACK_ENABLEDAccept stm_surfacing_feedbacktrue
MEMTOMEM_STM_SURFACING__AUTO_TUNE_ENABLEDPer-tool threshold auto-tuningtrue
MEMTOMEM_STM_SURFACING__QUERY_RETENTION_DAYSDays to retain raw query text in the feedback DB before clearing the column; 0 disables cleanup30
MEMTOMEM_STM_SURFACING__PERSIST_QUERY_TEXTStore raw query text when true; store sha256:<16-hex> digests when falsetrue
MEMTOMEM_STM_SURFACING__FEEDBACK_DEMOTION_ENABLEDLocally filter memories with repeated negative feedback before injectiontrue
MEMTOMEM_STM_SURFACING__FEEDBACK_DEMOTION_NEGATIVE_THRESHOLDDistinct negative surfacing events before local demotion applies3
MEMTOMEM_STM_SURFACING__LTM_MCP_TRANSPORTLTM MCP transport: stdio, sse, or streamable_httpstdio
MEMTOMEM_STM_SURFACING__LTM_MCP_COMMANDMCP command launching the LTM server for stdio transportmemtomem-server
MEMTOMEM_STM_SURFACING__LTM_MCP_ARGSArgs for the LTM command (JSON list)[]
MEMTOMEM_STM_SURFACING__LTM_MCP_URLLTM endpoint URL for sse / streamable_http""
MEMTOMEM_STM_SURFACING__LTM_MCP_HEADERSOptional static headers for network LTM transport (JSON object)null

Injection mode (append default, plus prepend / section) is set via MEMTOMEM_STM_SURFACING__INJECTION_MODE.

VariableDescriptionDefault
MEMTOMEM_STM_HOOK__USE_DAEMONRoute mms hook surfacing through a resident local daemon instead of a fresh in-process path each calltrue
MEMTOMEM_STM_HOOK__DAEMON_TIMEOUT_SECONDSHook-to-daemon round-trip timeout2.5
MEMTOMEM_STM_HOOK__FALLBACKBehavior when daemon is unavailable: skip (skip surfacing) or cold (handle via the in-process path)skip
MEMTOMEM_STM_HOOK__AUTO_SPAWNStart a daemon asynchronously on the first eligible hook call (does not wait for it)true
MEMTOMEM_STM_HOOK__RECORD_FEEDBACK_EVENTSPersist hook surfacing feedback/query events; default keeps dedup without storing raw query textfalse
MEMTOMEM_STM_HOOK__COMPRESSION__ENABLEDEnable built-in Bash updatedToolOutput compressionfalse
MEMTOMEM_STM_HOOK__COMPRESSION__MAX_CHARSTarget char budget for Bash output replacement16000
MEMTOMEM_STM_DAEMON__HOSTLocal daemon bind address; keep it loopback-only127.0.0.1
MEMTOMEM_STM_DAEMON__IDLE_TIMEOUT_SECONDSStop the daemon after this many idle seconds; 0 disables idle shutdown900.0
VariableDescriptionDefault
MEMTOMEM_STM_LANGFUSE__ENABLEDEmit spansfalse
MEMTOMEM_STM_LANGFUSE__PUBLIC_KEYLangfuse public key
MEMTOMEM_STM_LANGFUSE__SECRET_KEYLangfuse secret key
MEMTOMEM_STM_LANGFUSE__HOSTLangfuse host URL
MEMTOMEM_STM_LANGFUSE__SAMPLING_RATE0.0–1.01.0

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.

Compression strategies (MEMTOMEM_STM_PROXY__DEFAULT_COMPRESSION)

Section titled “Compression strategies (MEMTOMEM_STM_PROXY__DEFAULT_COMPRESSION)”
StrategyUse for
autoDefault — picks per content type
hybridMarkdown (structure + summarize non-essentials)
selectiveKeep only query-relevant sections
progressiveLarge content; cursor-based delivery (zero loss)
extract_fieldsJSON dictionaries
schema_pruningLarge JSON arrays
skeletonAPI docs (schema-only)
llm_summaryLLM-based summarization (OpenAI / Anthropic / Ollama)
truncateFallback truncation
nonePass-through

Full list: configuration.md in the upstream repo.