Aletheia

Aletheia configuration reference: environment variables, settings and data directory

Aletheia (aletheia-mem) is configured in two ways: environment variables read at start-up, and a small set of runtime settings stored in the hub database. This page lists both, and the files that appear in the data directory.

Defaults come from src/config.mjs and src/hub/settings.mjs. Command output on this page was produced on 2026-10-29 by version 0.1.10 in a temporary home and data directory. A command shown without output was not run.

Set an environment variable

Set a variable in the shell that starts the command, or in the service unit that starts the server. A hook command runs with the environment of the host that starts it. If you use a custom ALETHEIA_DATA_DIR, set it in the host's environment too, or hooks write to the default directory.

$ ALETHEIA_DATA_DIR=/srv/aletheia ALETHEIA_PORT=37800 aletheia-server

Server and network

VariableDefaultMeaning
ALETHEIA_HOST127.0.0.1Bind address for aletheia-server. A non-loopback value turns on dashboard login. --host overrides it.
ALETHEIA_PORT37790Dashboard and API port. aletheia doctor checks /healthz on this port.
ALETHEIA_BEHIND_TLSunset1 says a reverse proxy ends TLS. --behind-tls does the same.
ALETHEIA_API_KEYemptyWhen set, the /v1 API and the /mcp route on the main server need Authorization: Bearer <key>.
ALETHEIA_EXTRACTION_WORKERunset1 starts the extraction worker when the server is embedded elsewhere. aletheia-server always starts it.
ALETHEIA_AUTO_REFRESHtruefalse turns off the periodic model refresh. It runs only when a provider is set.
ALETHEIA_REFRESH_CHECK_MS600000How often the server checks whether a refresh is due.
ALETHEIA_POLL_MS1000How often the server re-reads the claude-mem database for the Activity page.

Paths and files

VariableDefaultMeaning
ALETHEIA_DATA_DIR~/.aletheiaEverything Aletheia writes lives here. If only ~/.work-view-local exists, that folder is used.
ALETHEIA_HUB_DB<data>/hub.dbThe main store.
ALETHEIA_SYNC_DB<data>/sync.dbThe sync hub's log, tokens and audit.
ALETHEIA_SYNC_CLIENT_DB<data>/sync-client.dbThis device's replica, outbox and cursor.
ALETHEIA_SYNC_HOST, ALETHEIA_SYNC_PORT127.0.0.1, 37791Where bin/aletheia-sync.mjs listens.
ALETHEIA_TEAM_DB<data>/team.dbTeams, members and the shared board.
ALETHEIA_ALERTS_DB<data>/alerts.dbAlert rules and their delivery queue.
ALETHEIA_WATCH_DB<data>/watcher.dbTranscript offsets for aletheia watch.
ALETHEIA_ERASURE_KEY<data>/erasure.keyThe HMAC key that signs erasure receipts.
CLAUDE_MEM_DB~/.claude-mem/claude-mem.dbThe claude-mem database. It is only read.
ALETHEIA_LEDGER_DIR<data>/ledgerLedger files used by the model refresh and bin/ledger.mjs.
ALETHEIA_RULES_FILE<data>/MY-RULES.mdThe older rules file that the Load in Claude Code action points at.
ALETHEIA_CLAUDE_MD~/.claude/CLAUDE.mdThe file that action appends one @<rules file> line to.

Capture and privacy

VariableDefaultMeaning
ALETHEIA_EXCLUDED_PROJECTSemptyComma-separated project keys that are never captured. Matching is exact and case-insensitive. * excludes every project.
ALETHEIA_TOOLunsetMCP stdio only. Names the caller in saved memories.
ALETHEIA_CWDthe working directoryMCP stdio only. Sets the default project.

Redaction has no switch. See Privacy and redaction.

Extraction and model providers

With no provider, Aletheia extracts facts with a rule-based extractor and makes no model call. See Model providers.

VariableDefaultMeaning
ALETHEIA_PROVIDERnonenone, local, openai, openrouter or claude-cli.
ALETHEIA_PROVIDERSemptyAn ordered fallback chain of presets: ollama, lmstudio, llamacpp, local, openai, openrouter, claude-cli, anthropic-compatible. It replaces ALETHEIA_PROVIDER when set.
ALETHEIA_MODEcodeExtraction mode: code, chill, language-en or language-es.
ALETHEIA_OUTPUT_LANGUAGEemptyLanguage tag for facts and summaries. Empty follows the mode. aletheia language set sets it per project.
ALETHEIA_EXTRACT_MODEL, ALETHEIA_SUMMARY_MODELemptyModel for fact extraction and for summaries.
ALETHEIA_OPENAI_API_KEYemptyKey for the openai and openrouter providers.
ALETHEIA_OPENAI_BASE_URLhttps://api.openai.com/v1/chat/completionsEndpoint for OpenAI-style providers.
ALETHEIA_OPENAI_MODELemptyDefault model when no stage model is set.
ALETHEIA_LOCAL_BASE_URLhttp://127.0.0.1:11434/v1/chat/completionsEndpoint for the local provider.
ALETHEIA_ANTHROPIC_BASE_URLemptyGateway URL for the anthropic-compatible preset. It has no default.
ALETHEIA_CLAUDE_BINclaudeThe CLI the claude-cli provider runs.
ALETHEIA_PROVIDER_TIMEOUT_MS60000Time limit for one model request.
ALETHEIA_MAX_CONCURRENT1Most model requests in flight at once.
ALETHEIA_PROVIDER_COOLDOWN_MS60000How long a failing provider in a chain is skipped.
ALETHEIA_FACT_MAX_EPISODES20Most episodes in one extraction batch.
ALETHEIA_FACT_CHAR_BUDGET12000Most characters in one extraction batch.
ALETHEIA_PRICE_IN_PER_1K, ALETHEIA_PRICE_OUT_PER_1K0Your price per 1000 tokens, used for cost estimates. Aletheia sets no vendor price.
ALETHEIA_EMBED_FACTSunset1 lets aletheia compress create embeddings for new facts. Off by default, because the first use downloads a model.

Optional embeddings

Semantic search needs the optional package @huggingface/transformers. The first use downloads the model (about 35 MB per the source comment) into <HOME>/.aletheia/models. That cache is not under ALETHEIA_DATA_DIR.

Sync passphrases and test variables

Runtime settings

Runtime settings live in the settings table of hub.db, under the key ui.settings.<name>, as JSON. They survive a restart. There is no command-line command for them. Change them in the dashboard under Connections, then Settings, or with PUT /api/hub/settings. A value outside its range is refused with a 400 and a message.

KeyTypeDefaultAllowedEffect
facts.minConfidencenumber0.40.3 to 0.9Facts below this confidence are rejected when stored and by aletheia facts clean.
context.factsenumautoauto, on, offFacts in the session-start context. off lists none. on lists up to 10 active facts. auto lists a fact only if it came from a provider, has confidence 0.6 or more, or comes from a pinned observation.
rules.reviewDaysinteger907 to 730Days after which an unconfirmed rule gets a re-check flag.

These three are the only runtime settings. Version 0.1.10 also showed provider, providers, factBudget.maxEpisodes, factBudget.maxChars, redaction, excludedProjects and apiKey in the form, but no code read them, so they were removed. The provider, its chain and key, the fact budgets and the excluded projects are environment variables (see above), and redaction always runs. A value saved under one of the removed keys stays in the table and does nothing.

$ curl -s -X PUT http://127.0.0.1:37790/api/hub/settings -H "Content-Type: application/json" \
    -d '{"facts.minConfidence":0.6,"context.facts":"on","rules.reviewDays":30}'
{"settings":[...],"saved":["facts.minConfidence","context.facts","rules.reviewDays"]}
$ curl -s -i -X PUT ... -d '{"facts.minConfidence":2,"context.facts":"maybe"}'
HTTP/1.1 400 Bad Request
{"error":"facts.minConfidence must be a number between 0.3 and 0.9 context.facts must be one of auto, on, off"}

Both calls ran against a temporary server on another port. The rows were stored as ui.settings.context.facts = "on", ui.settings.facts.minConfidence = 0.6 and ui.settings.rules.reviewDays = 30.

The data directory

Aletheia keeps the data directory at mode 0700 and its databases at 0600, and repairs looser modes with a one-line message on stderr. aletheia doctor reports them. This is what a data directory held after running save, install claude-code --write, a hook that could not reach the store, alerts add, sync pair, sync status, team create, watch --once, service install --write and erase --apply:

alerts.db              spool
alerts.db-shm          sync-client.db
alerts.db-wal          sync-client.db-shm
aletheia.bundle.mjs    sync-client.db-wal
erasure-exports        sync.db
erasure-receipts       sync.db-shm
erasure.key            sync.db-wal
hub.db                 sync.db.aletheia-bak-2026-10-29T19-49-58-125Z
hub.db-shm             team.db
hub.db-wal             team.db-shm
install-manifest.json  team.db-wal
service-manifest.json  watcher.db

See Operations for backup and growth, and Data model for the tables.

Next steps