Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

mnem reads config from three sources, in priority order:

  1. Environment variables - MNEM_* (highest precedence)
  2. Per-repo config - <repo>/.mnem/config.toml
  3. User-global config - ~/.mnem/config.toml

Defaults

# .mnem/config.toml
[embed]
provider = "onnx"
model = "all-MiniLM-L6-v2"

[store]
backend = "redb"        # "redb" | "in-memory"

[retrieve]
top_k = 10
vector_cap = 256

Common environment overrides

VariableEffect
MNEM_EMBED_PROVIDERonnx / ollama / openai / mock
MNEM_EMBED_MODELmodel name (e.g. all-MiniLM-L6-v2)
MNEM_EMBED_BASE_URLfor ollama / openai providers
MNEM_EMBED_API_KEY_ENVname of env var holding the API key
MNEM_ORT_INTRA_THREADSpin ONNX runtime thread count (bench harness)
MNEM_BENCHenable bench-only label scoping
MNEM_HTTP_ALLOW_NON_LOOPBACKallow mnem http to bind 0.0.0.0 (Docker)

Provider switching

Embedder, sparse encoder, reranker, and LLM are all configured via provider:model strings - no code change to switch from local ONNX to hosted Cohere.

[embed]
provider = "cohere"
model = "embed-english-v3.0"
api_key_env = "COHERE_API_KEY"

See Embedding providers for the full provider matrix.