Skip to content

Environment variables ​

Derived from .env.example and server/settings.py. Every variable maps 1:1 to a settings field (SODAMEM_ prefix, pydantic-settings).

GET /v1/admin/config reports the effective configuration of a running server, with every secret shown as set / not-set and never masked-but-printed.

Auth ​

variabledefaultmeaning
SODAMEM_API_KEY—Required. Shared secret sent as Authorization: Bearer <key> or X-API-Key. The server refuses to start without it.
SODAMEM_AUTH_DISABLEDfalseLocal-dev escape hatch. docker-compose.yml deliberately never sets it.

Do not disable auth on anything reachable off your machine

There is no silently-open default, and turning auth off is meant to stay an explicit, per-deployment choice.

Storage ​

variabledefaultmeaning
SODAMEM_DATA_ROOT/data under composeWhere stores live. Fixed by docker-compose.yml to match the named volume; set it only when running the image directly.
SODAMEM_STORE_CACHE_MAX64LRU cap on concurrently-open per-user stores. Raise it above your expected concurrent distinct users.
SODAMEM_ALLOW_PURGEfalseAllows DELETE /v1/memories/{id}?purge=true to physically erase and cascade to roles, edges and vectors.

SODAMEM_ALLOW_PURGE is off because an ordinary DELETE already archives: the memory leaves search and context while the record and its provenance stay. Turn it on only for right-to-erasure deletes — it is irreversible and it breaks the provenance of any answer that cited the fact.

Control plane ​

Operational state — async job status, named API keys, the request log — lives in its own SQLite database at <data_root>/.control/sodamem_control.db, so deleting a user's memories never takes the operator's job history with it (ADR 0001).

variabledefaultmeaning
SODAMEM_REQUEST_LOG_MAX10000Rolling cap on the persisted request log, enforced in the same transaction as each insert. 0 turns the log off entirely — a real off switch, not a very small cap.
SODAMEM_JOB_RETENTION_MAX5000Rolling cap on persisted job records. Oldest pruned first, so a job you just submitted is never the one dropped.

There is no worker-count knob. One worker is a correctness constraint, not a tuning parameter: per-user stores are SQLite without WAL, the server takes an exclusive lock on its data root, and a second process refuses to start with data_root_locked.

LLM ​

Needed for ingest extraction and POST /v1/answer. Not needed by /v1/search or /v1/context — those are the zero-LLM tier and work with everything here unset.

The same four names are what the library reads (sodamem.llm.create_provider_from_env), so an embedded process and a container are configured identically.

variabledefaultmeaning
SODAMEM_LLM_PROVIDERopenaione of openai, anthropic, deepseek, gemini
SODAMEM_LLM_MODELprovider default
SODAMEM_LLM_API_KEY—
SODAMEM_LLM_BASE_URL—only for an OpenAI-compatible endpoint that is not api.openai.com

Server ​

variabledefaultmeaning
SODAMEM_PORT8000The host port is the ports: mapping in docker-compose.yml, not this.
SODAMEM_CORS_ORIGINSunsetJSON array of exact origins — pydantic-settings parses list fields as JSON, not a comma list. Never "*" once auth is on.
bash
SODAMEM_CORS_ORIGINS=["https://your-app.example.com"]

MCP ​

variabledefaultmeaning
SODAMEM_MCP_ALLOW_WRITEunset (off)Registers add_memories and delete_memory. sodamem install writes it into the client config it generates.
SODAMEM_MCP_LOG_LEVELWARNING

CLI ​

variabledefaultmeaning
SODAMEM_API_URLhttp://127.0.0.1:8000Where sodamem install / daemon / hook look for the service.
SODAMEM_API_KEY—Also used by the CLI as --api-key's default.

Install extras ​

Not environment variables, but the same "what do I actually need" question.

extrawhat it adds
(base)data model, storage, BM25 retrieval, ingest — four dependencies, none heavy
chromavector search + the local ONNX embedder (SodaMem.open() needs this)
llmOpenAI-compatible providers (OpenAI / DeepSeek / Gemini wire format)
anthropicthe Anthropic provider, which speaks its own SDK
answerthe planner + reader answer path
serverthe HTTP service (FastAPI + uvicorn)
mcpthe MCP server surface

Base install pulls pydantic, numpy, rank-bm25, python-dateutil — and a CI gate fails the build if that list grows by accident.

Apache-2.0 licensed.