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 underscore — MEMTOMEM_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 complete memtomem 0.6.8 and memtomem-stm 0.6.1 configuration surfaces. Options are intentionally mirrored here rather than reduced to a curated subset.

VariableDescriptionDefault
MEMTOMEM_STORAGE__BACKENDStorage backend"sqlite"
MEMTOMEM_STORAGE__SQLITE_PATHSQLite database file path"~/.memtomem/memtomem.db"
MEMTOMEM_STORAGE__COLLECTION_NAMELogical collection name"memories"
VariableDescriptionDefault
MEMTOMEM_EMBEDDING__PROVIDERnone / onnx / ollama / openai"none"
MEMTOMEM_EMBEDDING__MODELModel name for the chosen provider""
MEMTOMEM_EMBEDDING__DIMENSIONVector dimension (must match model)0
MEMTOMEM_EMBEDDING__ONNX_VARIANTLocal ONNX precision: fp32, int8-arm64, int8-avx2, int8-avx512, or int8-avx512-vnni. Changing it requires a restart and an explicit index migration."fp32"
MEMTOMEM_EMBEDDING__ONNX_ARTIFACT_PATHDirectory holding a locally exported quantized artifact with a checksummed manifest.json. Required for every non-fp32 variant; there is no automatic fallback.""
MEMTOMEM_EMBEDDING__BASE_URLOllama / OpenAI-compatible endpoint""
MEMTOMEM_EMBEDDING__API_KEYAPI key for paid providers""
MEMTOMEM_EMBEDDING__BATCH_SIZETexts per embedding batch64
MEMTOMEM_EMBEDDING__ONNX_BATCH_SIZETexts per local FastEmbed/ONNX inference batch; runtime-mutable8
MEMTOMEM_EMBEDDING__MAX_SEQUENCE_TOKENSActual-token cap per local ONNX input; 0 restores the model limit, except under the E5 profile noted below. Restart after changing it and force-reindex existing content so vectors use one policy.1024
MEMTOMEM_EMBEDDING__ONNX_CPU_MEM_ARENAReuse ONNX CPU allocations. Restart required; this allocator-only switch does not require re-indexing.false
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

Effective defaults under the ONNX E5 profile. With PROVIDER=onnx and no MODEL, Core selects multilingual-e5-small and fills in DIMENSION=384, MAX_SEQUENCE_TOKENS=512, THREADS=2 and ONNX_BATCH_SIZE=4 for every one of those you leave unset. The Default column above is the declared default, which is what applies outside that profile. Inside it, a DIMENSION other than 384 and a MAX_SEQUENCE_TOKENS other than 512 are rejected at startup rather than adjusted — including the declared 0 and 1024, if you set them explicitly.

VariableDescriptionDefault
MEMTOMEM_INDEXING__MEMORY_DIRSDirectories 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"]
MEMTOMEM_INDEXING__PROJECT_MEMORY_DIRSProject-tier memory roots under .memtomem/memories or .memtomem/memories.local[]
MEMTOMEM_INDEXING__READ_ONLY_MEMORY_DIRSRoots memtomem indexes and searches but never rewrites. Must be disjoint from the writable roots.[]
MEMTOMEM_INDEXING__SUPPORTED_EXTENSIONSFile extensions to index (JSON list)[".js",".json",".jsx",".md",".py",".toml",".ts",".tsx",".yaml",".yml"]
MEMTOMEM_INDEXING__MAX_CHUNK_TOKENSMaximum tokens per chunk512
MEMTOMEM_INDEXING__MIN_CHUNK_TOKENSMerge threshold for short chunks128
MEMTOMEM_INDEXING__AUTO_DISCOVERDeprecated 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
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__INDEX_MASKING_MANIFEST_PATHOwner-reviewed masking manifest naming exact source paths, content SHA-256 values, and complete-block line spans. A changed source or an invalid manifest falls back to the normal privacy guard, and masked chunks are read-only. It does not enable automatic masking.""
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__CHUNK_MODEL_TOKENSComposed retrieval-input ceiling, including special tokens8192
MEMTOMEM_INDEXING__CHUNK_CONTEXT_TOKENSSeparate budget for the heading and description prefix512
MEMTOMEM_INDEXING__HARD_MAX_CHUNK_TOKENSExact body ceiling; 0 disables hard-budget mode. Requires a matching local tokenizer.0
MEMTOMEM_INDEXING__CHUNK_TOKENIZER_PATHLocal tokenizer.json for the embedding model, so hard-budget mode downloads no model""
MEMTOMEM_INDEXING__CHUNK_INPUT_PREFIXExact model-role prefix counted in the final input token budget (E5 uses passage: ). Restart required.""
MEMTOMEM_INDEXING__ENRICH_CHUNK_CONTEXTAdd cached LLM descriptions to the chunk context. Requires hard-budget mode.false
MEMTOMEM_INDEXING__STRUCTURED_CHUNK_MODEJSON/YAML/TOML chunking mode: original or recursive"original"
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__WATCHER_BACKENDWatch backend: auto polls on macOS and uses native events elsewhere; native or polling override it"auto"
MEMTOMEM_INDEXING__WATCHER_DEBOUNCE_MSQuiet period before automatic re-indexing, 1–30000 ms5000
MEMTOMEM_INDEXING__WATCHER_MAX_WAIT_MSMaximum event-collection window, 1–30000 ms, even under continuous edits30000
MEMTOMEM_INDEXING__AUTO_SUMMARIZEGenerate AI per-source summaries when LLM is configuredfalse
MEMTOMEM_INDEXING__SUMMARY_LANGUAGEOutput language for AI source summaries"en"
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_ns → default_namespace.[]
MEMTOMEM_NAMESPACE__DEFAULT_NAMESPACEDefault namespace for new chunks"default"
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) / local (sentence-transformers CrossEncoder, local). local needs sentence-transformers installed separately; no memtomem extra includes it. MEMTOMEM_RERANK__MODEL then takes a sentence-transformers model name (e.g. cross-encoder/ms-marco-MiniLM-L-6-v2). fastembed is usually preferable"fastembed"
MEMTOMEM_RERANK__MODELModel name; its form depends on the provider (a fastembed catalog ID, a Cohere Rerank model, or a sentence-transformers model name). With fastembed, for non-English content use onnx-community/gte-multilingual-reranker-base (341 MB; memtomem registers it with fastembed itself, so it needs no setup). jinaai/jina-reranker-v2-base-multilingual still works but is 1.1 GB and its model license (CC-BY-NC-4.0) does not allow commercial use. The Korean-optimized preset leaves reranking off, so pair the model with MEMTOMEM_RERANK__ENABLED=true"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
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,1]
MEMTOMEM_SEARCH__TOKENIZERFTS tokenizer: unicode61 or kiwipiepy"unicode61"
MEMTOMEM_SEARCH__CACHE_TTLSearch result cache TTL in seconds30
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

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 / llm"tags"

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 (0–10)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 endpoint"ollama"
MEMTOMEM_LLM__MODELModel name. Empty = provider-specific default""
MEMTOMEM_LLM__BASE_URLEndpoint URL"http://localhost:11434"
MEMTOMEM_LLM__API_KEYAPI key for paid providers""
MEMTOMEM_LLM__MAX_TOKENSGeneration token cap1024
MEMTOMEM_LLM__TIMEOUTRequest timeout in seconds60
VariableDescriptionDefault
MEMTOMEM_TOOL_MODEcore (9 names incl. mem_do) / standard (38) / full (100 current tools; no deprecated aliases)core
VariableDescriptionDefault
MEMTOMEM_WEB__MODEprod (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__HOSTBind address for mm web; overridden by --host127.0.0.1
MEMTOMEM_WEB__PORTBind port for mm web; overridden by --port8080
MEMTOMEM_WEB__CSRF_ENFORCEEnforce CSRF protection on mutating Web UI endpoints. Disable only as an emergency rollback.true
VariableDescriptionDefault
MEMTOMEM_POLICY__ENABLEDRun PolicyScheduler (auto_archive / auto_promote / auto_expire / auto_tag)false
MEMTOMEM_POLICY__SCHEDULER_INTERVAL_MINUTESScheduler tick interval60
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

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
MEMTOMEM_CONSOLIDATION_SCHEDULE__MIN_GROUP_SIZEMinimum group size to consolidate3
MEMTOMEM_CONSOLIDATION_SCHEDULE__MAX_GROUPSMax groups processed per run10
VariableDescriptionDefault
MEMTOMEM_WARMUP__ENABLEDPre-load local embedding/reranker models in a background task at MCP server startup. Remote providers are skipped.false

Background loop for periodic health checks and automatic maintenance. Missing sources are held out of search rather than deleted; purging their chunks is an explicit mm gc orphan-sources --apply.

VariableDescriptionDefault
MEMTOMEM_HEALTH_WATCHDOG__ENABLEDRun the health watchdogfalse
MEMTOMEM_HEALTH_WATCHDOG__HEARTBEAT_INTERVAL_SECONDSHeartbeat interval60
MEMTOMEM_HEALTH_WATCHDOG__DIAGNOSTIC_INTERVAL_SECONDSDiagnostic-check interval300
MEMTOMEM_HEALTH_WATCHDOG__DEEP_INTERVAL_SECONDSDeep-scan interval3600
MEMTOMEM_HEALTH_WATCHDOG__MAX_SNAPSHOTSSnapshot retention cap1000
MEMTOMEM_HEALTH_WATCHDOG__ORPHAN_CLEANUP_THRESHOLDMissing-source count at which auto-maintenance holds them (no chunks are deleted)10
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 utc"utc"
MEMTOMEM_SCHEDULER__RUNNER_TIMEOUT_SECONDSTimeout for one scheduled job run300
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
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_local"user"
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

User-tier writes are protected by explicit host-write confirmation; there is no USER_TIER_ENABLED configuration field.

These process-level variables are not part of the layered config.json / config.d model.

VariableDescriptionDefault
MEMTOMEM_WIKI_PATHOverride the wiki store location~/.memtomem-wiki
MEMTOMEM_FASTEMBED_CACHEOverride the ONNX / FastEmbed model cache (checked before FASTEMBED_CACHE_PATH)~/.memtomem/cache/fastembed
MEMTOMEM_INDEX_DEBOUNCE_QUEUEOverride the file-watcher debounce queue filestate directory
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 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.

VariableDescriptionDefault
MEMTOMEM_STM_DATA_DIRDaemon handshake, ownership lock, and detached log directory"~/.memtomem"
MEMTOMEM_STM_LOG_LEVELLog level"WARNING"
MEMTOMEM_STM_LOG_FILEOptional rotating log file; files use 0600, 2 MiB rotation, and three backupsnull
MEMTOMEM_STM_ADVERTISE_OBSERVABILITY_TOOLSWhen true, advertises the stm_admin dispatcher and its eight observability/admin actions (proxy_stats, proxy_cache_clear, proxy_health, surfacing_stats, selection_stats, compression_stats, progressive_stats, tuning_recommendations). The five 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
MEMTOMEM_STM_FORMATION__MAX_CONTENT_CHARSMaximum review-first candidate content size; larger proposals are rejected2000
VariableDescriptionDefault
MEMTOMEM_STM_PROXY__ENABLEDMaster switch for the proxy pipelinefalse
MEMTOMEM_STM_PROXY__CONFIG_PATHProxy JSON configuration path"~/.memtomem/stm_proxy.json"
MEMTOMEM_STM_PROXY__UPSTREAM_SERVERSComplete upstream-server map as a JSON object; the file-backed form is usually easier to maintain{}
MEMTOMEM_STM_PROXY__DEFAULT_COMPRESSIONDefault compression strategy"auto"
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
MEMTOMEM_STM_PROXY__MAX_DESCRIPTION_CHARSCap on the client-visible tool description, [proxied] prefix included. The effective budget for an upstream is min(server, global), so raising this alone does not widen a stricter per-server value.4000
MEMTOMEM_STM_PROXY__STRIP_SCHEMA_DESCRIPTIONSRemove nested JSON-schema descriptions from advertised toolsfalse
MEMTOMEM_STM_PROXY__ADVERTISE_CONTEXT_QUERYAdvertise the optional _context_query argument used for relevance scoringfalse
MEMTOMEM_STM_PROXY__HOST_DESCRIPTION_CAPExplicit host description limit, proxy prefix and hints included. Unset means unknown, so no host limit is inferred. Applied at the next advertisement; restart to apply it reliably.null
MEMTOMEM_STM_PROXY__RECOVER_UPSTREAM_DESCRIPTIONAlso return the text a description_override replaced. Off by default, because recovery hands the overridden upstream text back to the one reader the override was written for.false
MEMTOMEM_STM_PROXY__CONSUMER_MODELClient model identifier used to resolve its context-window budget""
MEMTOMEM_STM_PROXY__CONTEXT_BUDGET_RATIOFraction of the consumer context window available to a proxied result0.05
MEMTOMEM_STM_PROXY__CHARS_PER_TOKENStatic character-to-token estimate used for token budgets3.5
MEMTOMEM_STM_PROXY__TOKEN_ESTIMATION_MODEToken estimate mode: static or Unicode-aware unicode"static"
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/proxy_cache.db"
MEMTOMEM_STM_PROXY__CACHE__MAX_ENTRIESCache eviction ceiling10000
MEMTOMEM_STM_PROXY__CACHE__TOOL_ANNOTATION_POLICYHow MCP tool annotations affect caching: conservative, strict, or ignore"conservative"

Cache schema 5 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.

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 index2000
MEMTOMEM_STM_PROXY__AUTO_INDEX__MEMORY_DIROutput directory"~/.memtomem/proxy_index"
MEMTOMEM_STM_PROXY__AUTO_INDEX__NAMESPACENamespace 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.

VariableDescriptionDefault
MEMTOMEM_STM_PROXY__EXTRACTION__ENABLEDStage 4b EXTRACT (fact extraction)false
MEMTOMEM_STM_PROXY__EXTRACTION__STRATEGYExtraction strategy: none, llm, heuristic, or hybrid. An LLM reply is parsed only as a whole JSON fact array (a markdown fence is stripped); a reply wrapped in prose, an empty one, or an array whose entries are all malformed falls back to heuristic extraction"llm"
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__PROVIDERExtraction LLM provider: openai, anthropic, or ollamaopenai
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__MODELExtraction LLM modelgpt-4.1-mini
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__API_KEYExtraction LLM API key""
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__BASE_URLExtraction LLM endpoint override""
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__SYSTEM_PROMPTExtraction system-prompt templatebuilt-in template
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__MAX_TOKENSExtraction LLM output-token cap500
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__LLM_TIMEOUT_SECONDSExtraction LLM timeout60.0
MEMTOMEM_STM_PROXY__EXTRACTION__LLM__PRIVACY_SCAN_ENABLEDScan content before sending it to a remote extraction LLMtrue
MEMTOMEM_STM_PROXY__EXTRACTION__MAX_FACTSMaximum extracted facts per response10
MEMTOMEM_STM_PROXY__EXTRACTION__MIN_RESPONSE_CHARSMinimum response size eligible for extraction500
MEMTOMEM_STM_PROXY__EXTRACTION__DEDUP_THRESHOLDExtracted-fact similarity threshold0.92
MEMTOMEM_STM_PROXY__EXTRACTION__MEMORY_DIRExtracted-fact output directory"~/.memtomem/extracted_facts"
MEMTOMEM_STM_PROXY__EXTRACTION__NAMESPACEExtracted-fact namespace template"facts-{server}"
MEMTOMEM_STM_PROXY__EXTRACTION__BACKGROUNDRun extraction outside the request pathtrue
MEMTOMEM_STM_PROXY__EXTRACTION__MAX_INPUT_CHARSMaximum response text considered for extraction20000

Proxy → Metrics / feedback / relevance scorer

Section titled “Proxy → Metrics / feedback / relevance scorer”
VariableDescriptionDefault
MEMTOMEM_STM_PROXY__METRICS__ENABLEDRecord call metricstrue
MEMTOMEM_STM_PROXY__METRICS__DB_PATHProxy metrics SQLite path"~/.memtomem/proxy_metrics.db"
MEMTOMEM_STM_PROXY__METRICS__MAX_HISTORYMaximum retained metrics rows10000
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__SCORERScorer backend"bm25"
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__EMBEDDING_PROVIDEREmbedding provider for semantic relevance scoring"ollama"
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__EMBEDDING_MODELRelevance embedding model"nomic-embed-text"
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__EMBEDDING_BASE_URLRelevance embedding endpoint"http://localhost:11434"
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__EMBEDDING_TIMEOUTRelevance embedding request timeout10
MEMTOMEM_STM_PROXY__COMPRESSION_FEEDBACK__ENABLEDPersist stm_compression_feedbacktrue
MEMTOMEM_STM_PROXY__COMPRESSION_FEEDBACK__DB_PATHCompression feedback SQLite path"~/.memtomem/stm_feedback.db"
MEMTOMEM_STM_PROXY__COMPRESSION_FEEDBACK__RETENTION_DAYSCompression feedback retention90
MEMTOMEM_STM_PROXY__PROGRESSIVE_READS__ENABLEDRecord progressive-delivery read telemetry (surfaces via stm_admin(action="progressive_stats"))true
MEMTOMEM_STM_PROXY__PROGRESSIVE_READS__DB_PATHProgressive-read telemetry SQLite path"~/.memtomem/stm_feedback.db"
MEMTOMEM_STM_PROXY__PROGRESSIVE_READS__RETENTION_DAYSProgressive-read telemetry retention90
MEMTOMEM_STM_PROXY__LOCK_TIMEOUT_SECONDSInternal lock-acquisition ceiling; a timeout signals a deadlock/stuck holder rather than a slow upstream30

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
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
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__SOURCEPolicy source: live stdio consult or signed bundle file"stdio"
MEMTOMEM_STM_PROXY__TOOLGRAPH__BUNDLE_PATHLocal policy-bundle path used when source=bundle"~/.memtomem/toolgraph/policy-bundle.json"
MEMTOMEM_STM_PROXY__TOOLGRAPH__COMMANDLaunch command for the stdio tool-graph MCP server"toolgraph"
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 against"stm-proxy"
MEMTOMEM_STM_PROXY__TOOLGRAPH__SERVER_NAME_MAPMap STM upstream names to graph server identities (JSON object){}
MEMTOMEM_STM_PROXY__TOOLGRAPH__QUERY_PROFILEProfile passed to the graph consult"strict"
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 / closed"open"
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_AGENT_NOT_FOUNDagent_id unknown (usually a typo): fail_start / open / closed"fail_start"
MEMTOMEM_STM_PROXY__TOOLGRAPH__ON_PROTOCOL_ERRORGraph response contract violation: fail_start / open / closed"fail_start"
MEMTOMEM_STM_PROXY__TOOLGRAPH__RISK_PENALTY_SCALERanking-demotion multiplier for eligible-but-risky tools1
MEMTOMEM_STM_PROXY__TOOLGRAPH__TIMEOUT_SECONDSPer-consult timeout5
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"
MEMTOMEM_STM_PROXY__TOOLGRAPH__CONSULT_CACHE_MAX_SCOPESMaximum cached tool-set scopes64

A typed backend_unavailable result follows on_unreachable; unknown or malformed result envelopes follow on_protocol_error.

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.

FieldDescriptionDefault
commandstdio server executable""
argsstdio server arguments[]
envadditional server environmentnull
cwdserver working directorynull
prefixrequired namespace segment used in composed tool namesrequired
transportstdio, sse, or streamable_httpstdio
urlendpoint for a network transport""
headersstatic headers for a network transportnull
compressiondefault compression strategy for this upstreamauto
max_result_charsresult character budget. Omitted, the server inherits the global default_max_result_chars; any stated value, 8000 included, applies. A token budget outranks it8000
max_result_tokensoptional token-equivalent result budgetnull
chars_per_tokenoptional per-upstream character/token estimatenull (inherits proxy)
token_estimation_modeoptional static / unicode estimator overridenull (inherits proxy)
retention_flooroptional minimum compression-retention fraction; applies even when the global min_result_retention is 0, and an explicit 0 opts this level outnull (inherits proxy)
llmper-upstream LLM compressor settingsnull
selectiveselective-compressor settingsnull
hybridhybrid-compressor settingsnull
progressivecursor-based progressive-delivery settingsnull
cleaningpre-compression cleaning settingsnull
tool_overridesper-tool ToolOverrideConfig map{}
auto_indexoverride the global accepted compatibility settingnull
extractionoverride the global accepted compatibility settingnull
cacheoverride response cachingnull
cache_ttl_secondsoverride response-cache TTLnull
expose_in_profilesexposure profiles allowed for the upstreamnull
surfacing_enabledOpt this upstream’s responses in/out of proactive surfacing. false suppresses surfacing for every tool on this server.true
max_retriesreconnect/call retries after the first attempt3
reconnect_delay_secondsinitial reconnect delay1.0
max_reconnect_delay_secondsreconnect backoff ceiling30.0
connect_timeout_secondsupstream connection timeout30.0
call_timeout_secondsPer-attempt timeout for session.call_tool(). On timeout the session is force-reset; another attempt requires replay-safe tool policy and remaining retry/deadline budget.90.0
overall_deadline_secondsTotal wall-clock budget across all retry attempts. Prevents call_timeout × (max_retries+1) worst-case blowout.180.0
circuit_max_failuresfailures before opening this upstream’s circuit3
circuit_reset_secondsopen-circuit reset interval60.0
max_description_charsper-upstream tool-description cap; the effective budget is min(server, global)4000
strip_schema_descriptionsper-upstream nested schema-description strippingfalse
originImport-provenance block written by mms add --import/mms init and used by mms eject; CLI JSON output redacts the stored original entry.null

The same sub-config shapes are used under an upstream and, where noted, inside each tool_overrides.<tool> entry.

Block / fieldDescriptionDefault
llm.provideropenai, anthropic, or ollamaopenai
llm.modelsummarization modelgpt-4.1-mini
llm.api_keyprovider API key""
llm.base_urlprovider endpoint override""
llm.system_promptsummary prompt template containing {max_chars}built-in template
llm.max_tokenssummary output-token cap500
llm.llm_timeout_secondssummary timeout; timeout falls back to truncate60.0
llm.privacy_scan_enabledscan before a remote LLM calltrue
selective.max_pendingin-flight selection record cap100
selective.pending_ttl_secondspending selection TTL300.0
selective.json_depthJSON outline depth1
selective.min_section_charsminimum retained section size50
selective.pending_storememory or sqlitememory
selective.pending_store_pathSQLite pending-selection path~/.memtomem/pending_selections.db
hybrid.head_charspreferred leading-content budget5000
hybrid.tail_modetoc or truncatetoc
hybrid.min_toc_budgetminimum table-of-contents budget200
hybrid.min_head_charsminimum leading-content budget100
hybrid.head_ratiofraction assigned to leading content0.6
progressive.chunk_sizecharacters per progressive chunk4000
progressive.max_storedpending progressive payload cap200
progressive.ttl_secondspending payload TTL1800.0
progressive.include_structure_hintinclude remaining-content structure metadatatrue
cleaning.enabledenable the cleaning stagetrue
cleaning.strip_htmlremove HTML markuptrue
cleaning.deduplicateremove duplicate blockstrue
cleaning.collapse_linkscollapse verbose linkstrue

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.

FieldDescriptionDefault
auto_indexoverride accepted auto-index compatibility confignull
extractionoverride accepted extraction compatibility confignull
cacheoverride cachingnull
cache_ttl_secondsoverride cache TTLnull
hiddennever advertise this toolfalse
description_overridereplace the advertised descriptionnull
expose_in_profilesexposure profiles allowed for this toolnull
VariableDescriptionDefault
MEMTOMEM_STM_SURFACING__ENABLEDEnable proactive surfacing from LTMtrue
MEMTOMEM_STM_SURFACING__USE_DAEMONRoute standalone surfacing through the shared daemon, with no private fallbackfalse
MEMTOMEM_STM_SURFACING__WARMUP_ENABLEDWarm the LTM client in the backgroundtrue
MEMTOMEM_STM_SURFACING__FEEDBACK_DB_PATHSurfacing feedback and dedup SQLite path"~/.memtomem/stm_feedback.db"
MEMTOMEM_STM_SURFACING__MIN_SCOREGlobal result-score floor on the RRF scale, applied unless a per-tool pin or the scale gate overrides it0.017
MEMTOMEM_STM_SURFACING__MAX_RESULTSMax retrieved memories injected per call. Pinned context returned by the core’s context_compose is added separately and does not count toward this limit3
MEMTOMEM_STM_SURFACING__MIN_RESPONSE_CHARSSkip surfacing on tiny responses5000
MEMTOMEM_STM_SURFACING__MIN_QUERY_TOKENSMin tokens in extracted query3
MEMTOMEM_STM_SURFACING__COOLDOWN_SECONDSMinimum interval between repeated surfacing work5
MEMTOMEM_STM_SURFACING__TIMEOUT_SECONDSLTM surfacing request timeout3
MEMTOMEM_STM_SURFACING__INJECTION_MODEPlacement: prepend, append, or section"append"
MEMTOMEM_STM_SURFACING__SECTION_HEADERHeading used by section injection mode"## Relevant Memories"
MEMTOMEM_STM_SURFACING__DEFAULT_NAMESPACEOptional namespace used when a tool rule does not override itnull
MEMTOMEM_STM_SURFACING__EXCLUDE_TOOLSTool-name denylist (JSON list)[]
MEMTOMEM_STM_SURFACING__WRITE_TOOL_PATTERNSPatterns classified as write tools and therefore not surfaced by default (JSON list)["*write*","*create*","*delete*","*push*","*send*","*remove*"]
MEMTOMEM_STM_SURFACING__CONTEXT_TOOLSPer-tool enabled, query_template, namespace, min_score, and max_results overrides (JSON object){}
MEMTOMEM_STM_SURFACING__DEDUP_TTL_SECONDSCross-session dedup window604800
MEMTOMEM_STM_SURFACING__FEEDBACK_ENABLEDAccept stm_surfacing_feedbacktrue
MEMTOMEM_STM_SURFACING__MAX_SURFACINGS_PER_MINUTEProcess-local surfacing rate limit15
MEMTOMEM_STM_SURFACING__CACHE_TTL_SECONDSIn-process surfacing result cache TTL60
MEMTOMEM_STM_SURFACING__CIRCUIT_MAX_FAILURESConsecutive LTM failures before opening the circuit3
MEMTOMEM_STM_SURFACING__CIRCUIT_RESET_SECONDSOpen-circuit reset interval60
MEMTOMEM_STM_SURFACING__AUTO_TUNE_ENABLEDPer-tool threshold auto-tuningtrue
MEMTOMEM_STM_SURFACING__AUTO_TUNE_MIN_SAMPLESMinimum feedback samples before tuning20
MEMTOMEM_STM_SURFACING__AUTO_TUNE_SCORE_INCREMENTThreshold adjustment step0.002
MEMTOMEM_STM_SURFACING__AUTO_TUNE_SCORE_FLOORDefault lower auto-tune bound; validation widens it to include an explicit min_score0.005
MEMTOMEM_STM_SURFACING__AUTO_TUNE_SCORE_CEILINGDefault upper auto-tune bound; validation widens it to include an explicit min_score. At run time raises are also capped at the batch’s attainable reference (see Feedback Loop)0.05
MEMTOMEM_STM_SURFACING__INCLUDE_SESSION_CONTEXTInclude available session context in the generated querytrue
MEMTOMEM_STM_SURFACING__FIRE_WEBHOOKAsk LTM to fire its configured webhook for surfaced resultstrue
MEMTOMEM_STM_SURFACING__MAX_INJECTION_CHARSTotal injected-memory character cap3000
MEMTOMEM_STM_SURFACING__CONTEXT_WINDOW_SIZEAdjacent LTM chunks requested around each hit0
MEMTOMEM_STM_SURFACING__RESULT_CONTENT_MAX_CHARSContent cap per structured result500
MEMTOMEM_STM_SURFACING__PREVIEW_MAX_CHARSContent cap per compact preview300
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__STATS_RETENTION_DAYSAggregated surfacing-stat retention90
MEMTOMEM_STM_SURFACING__PERSIST_QUERY_TEXTStore raw query text when true; store sha256:<16-hex> digests when falsetrue
MEMTOMEM_STM_SURFACING__OPPORTUNITIES_ENABLEDRecord one surfacing_opportunities row per call that entered surfacing, labelled with how it ended (surfaced, skipped and why, errored, cancelled). Rows carry the shape of the arguments (their number, a path’s depth and, for a common file type, its extension), never their keys or values; false turns the log off completely. Only engines with a feedback tracker write them (the daemon, and the proxy with feedback_enabled)true
MEMTOMEM_STM_SURFACING__OPPORTUNITIES_SAMPLE_RATEShare of opportunity rows kept (0.0–1.0); dropped rows are counted in stm_surfacing_stats but not stored. A call that drew a holdout arm is never sampled out, so 0.0 can still store rows while HOLDOUT_RATE is above 01.0
MEMTOMEM_STM_SURFACING__HOLDOUT_RATEShare of eligible injections withheld at random to measure whether surfacing changes what the agent does next. Values outside [0, 0.5] are clamped, not rejected. Only Claude Code hook calls carrying both tool_use_id and session_id are eligible; the proxy path never withholds0.0
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__CONSUMER_MODELSurfacing-specific consumer model; empty inherits proxy.consumer_model""
MEMTOMEM_STM_SURFACING__RESULT_FORMATLTM response mode: compact or structured"structured"
MEMTOMEM_STM_SURFACING__RERANKPer-call rerank request sent to the core for surfacing searches: false skips the rerank stage, true asks for the configured reranker, none sends no request and leaves it to core configuration. Sent only to cores that advertise per-call rerankfalse
MEMTOMEM_STM_SURFACING__SCALE_GATED_MIN_SCORESkip the global or auto-tuned min_score for batches whose score_scale is a recognized non-RRF scale, and pause auto-tuning for them. A per-tool min_score still applies; scores are not rescaledtrue
MEMTOMEM_STM_SURFACING__LTM_MCP_TRANSPORTLTM MCP transport: stdio, sse, or streamable_http"stdio"
MEMTOMEM_STM_SURFACING__LTM_MCP_COMMANDMCP command launching the LTM server for stdio transport"memtomem-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

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.

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__METRICS_ENABLEDRecord size/timing-only hook metricstrue
MEMTOMEM_STM_HOOK__COMPRESSION__ENABLEDEnable built-in Bash updatedToolOutput compressionfalse
MEMTOMEM_STM_HOOK__COMPRESSION__MAX_CHARSTarget char budget for Bash output replacement16000
MEMTOMEM_STM_HOOK__COMPRESSION__MIN_RETENTIONMinimum retained fraction for built-in Bash output compression0.65
MEMTOMEM_STM_HOOK_SURFACE_TOOLSDirect-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__HOSTLocal daemon bind address; keep it loopback-only"127.0.0.1"
MEMTOMEM_STM_DAEMON__ALLOW_NON_LOOPBACKExplicitly permit a non-loopback daemon bind addressfalse
MEMTOMEM_STM_DAEMON__IDLE_TIMEOUT_SECONDSStop the daemon after this many idle seconds; 0 disables idle shutdown900
MEMTOMEM_STM_DAEMON__MAX_PENDING_REQUESTSBound admitted hook and standalone surfacing requests32
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

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.

Defaults above are schema declarations before initialization presets. mm init may change the provider, dimension, and memory directories. OTLP and Langfuse are independent opt-ins. Pass environment variables to the child MCP process and reconnect.

VariableDescriptionDefault
MEMTOMEM_ENTITY_BOOST__ENABLEDEnable query-entity score boostingfalse
MEMTOMEM_ENTITY_BOOST__MAX_BOOSTMaximum entity score multiplier1.5
MEMTOMEM_ENTITY_BOOST__MIN_CONFIDENCEMinimum entity confidence0
MEMTOMEM_ENTITY_BOOST__QUERY_ENTITY_TYPESEntity types used for query matching["date","person","technology"]
MEMTOMEM_INDEXING__EXTRACT_ENTITIESExtract entities during indexingtrue
MEMTOMEM_RERANK__TIMEOUT_SReranker timeout in seconds30
VariableDescriptionDefault
MEMTOMEM_STM_DAEMON__MAX_CONCURRENT_LTM_OPSConcurrent LTM operation limit4
MEMTOMEM_STM_OTLP__ENABLEDOptional OTLP export: enabledfalse
MEMTOMEM_STM_OTLP__ENDPOINTOptional OTLP export: endpoint""
MEMTOMEM_STM_OTLP__FLUSH_TIMEOUT_SECONDSOptional OTLP export: flush timeout seconds5
MEMTOMEM_STM_OTLP__HEADERSOptional OTLP export: headers{}
MEMTOMEM_STM_OTLP__MAX_EXPORT_BATCH_SIZEOptional OTLP export: max export batch size512
MEMTOMEM_STM_OTLP__MAX_QUEUE_SIZEOptional OTLP export: max queue size2048
MEMTOMEM_STM_OTLP__SAMPLING_RATEOptional OTLP export: sampling rate1
MEMTOMEM_STM_OTLP__SCHEDULE_DELAY_MSOptional OTLP export: schedule delay ms5000
MEMTOMEM_STM_OTLP__TIMEOUT_SECONDSOptional OTLP export: timeout seconds10
MEMTOMEM_STM_PARENT_LIVENESS_GRACE_SECONDSParent-liveness grace period in seconds900
MEMTOMEM_STM_PARENT_LIVENESS_POLL_SECONDSParent-liveness polling interval; 0 disables polling0
MEMTOMEM_STM_PROXY__EXTRACTION__LLMOptional LLM extraction configuration; null disables this overridenull
MEMTOMEM_STM_PROXY__MAX_UPSTREAM_BYTESDecoded compact-JSON response limit including metadata, non-text and error content; not a wire-size or peak-memory limit41943040
MEMTOMEM_STM_PROXY__RELEVANCE_SCORER__EMBEDDING_CACHE_SIZEEmbedding relevance cache entry limit256
MEMTOMEM_STM_TEARDOWN_WATCHDOG_SECONDSShutdown watchdog deadline in seconds60

Cache schema 5 uses length-prefixed key framing and Unicode serialization. Older cache rows are discarded on initialization; this is separate from deleting LTM memories.