Configuration¶
Every MEMCAL_* knob lives in ~/.memcal/.env (one key=value per line) and is
editable from the web UI's Settings tab, which writes that file, preserves
hand-written lines, and applies immediately. Clearing a field restores the
built-in default. memcal setup configures providers and sources; --advanced
also exposes tuning settings.
Precedence¶
.env files merge checkout → store → working directory, later winning — so the
working directory outranks the store. Publishing keys read the store file plus
the environment (checkout and working-directory files excluded). A
blank value counts as absent. The Settings tab warns when another file shadows
the store.
Settings¶
memcal setup asks for provider/model, iMessage connection, and disabled sources,
with an optional credentials step. --advanced walks through all settings.
Saved values are defaults and changes appear before saving; an unchanged rerun
writes nothing. Enter keeps a value, ? shows its help, and - resets it. Use --section
to configure just provider, imessage, brief, collect, dream, merge,
publish, or credentials. Source credentials are hidden while typing.
Provider¶
| Key | Default | Meaning |
|---|---|---|
MEMCAL_LLM_PROVIDER |
codex |
codex, claude-code, antigravity, grok, openrouter, or openai-compatible |
MEMCAL_FALLBACK_PROVIDER |
empty (disabled) | Optional second provider after a primary completion fails |
MEMCAL_FALLBACK_MODEL |
fallback provider default | Explicit model ID for the second provider |
MEMCAL_OPENAI_BASE_URL |
empty | API base URL for openai-compatible, such as https://host/v1 |
MEMCAL_PROPOSE_MODEL |
provider native | Night-traffic proposer — the main cost |
MEMCAL_SWEEP_MODEL |
provider native | Stale-row and question revisitor |
MEMCAL_MATCH_MODEL |
provider native | Merge arbitrator for real conflicts |
MEMCAL_REASONING_EFFORT |
model default | low, medium, or high |
MEMCAL_MAX_PARALLEL |
8 (1–64) |
In-flight model requests |
MEMCAL_LLM_COMMAND_TIMEOUT |
900 (30–7200s) |
CLI-provider timeout |
MEMCAL_CODEX_COMMAND / MEMCAL_CLAUDE_COMMAND / MEMCAL_AGY_COMMAND / MEMCAL_GROK_COMMAND |
codex / claude / agy / grok |
Absolute path safest under launchd |
Provider natives: Codex → gpt-6-luna, Claude Code → claude-sonnet-5,
Antigravity → gemini-3.8-flash-high, Grok → grok-4.5. Authenticate the
selected CLI first (codex login, claude auth login, a signed-in agy
session, grok signed in to your xAI account); OpenRouter needs
OPENROUTER_API_KEY. Memcal checks that the command exists; the CLI itself
reports authentication trouble on the first real completion. Unknown model names stay valid — catalogs change faster
than validation lists.
OpenRouter defaults to openai/gpt-6-luna. Propose, sweep, and merge use the
provider default only when their model settings are unset; saved choices keep
working. See OpenAI's GPT-6 Luna model documentation.
For openai-compatible, set MEMCAL_OPENAI_BASE_URL, OPENAI_COMPAT_API_KEY, and
an explicit model ID. This backend sends standard chat-completion requests with
the requested JSON schema, without OpenRouter routing or cache fields. HTTPS is
required except for local development endpoints on localhost.
Grok Build is installed with npm i -g @xai-official/grok (or the installer at
https://x.ai/cli/install.sh); grok --oauth signs in through the browser. Avoid
brew install grok — that is an unrelated formula.
Grok runs Grok Build's headless mode
(--output-format json) as a plain completion — its tools, subagents, plan mode
and web search are all switched off. The packed prompt rides in a temp file
(--prompt-file) so a large propose wave never crosses the shell argument limit;
the output schema is passed inline as the --json-schema literal.
Optional fallback¶
Configure the primary and fallback independently in Settings (or the store .env):
MEMCAL_LLM_PROVIDER=codex
MEMCAL_FALLBACK_PROVIDER=openrouter
MEMCAL_FALLBACK_MODEL=openai/gpt-6-luna
OPENROUTER_API_KEY=your-key
Fallback is off by default. Enabling it permits the same prompt and source messages
to be sent to the second provider, with that provider's charges and privacy terms.
It runs once after the primary transport exhausts its retries or timeout; successful
primary calls keep using the primary. The fallback model must belong to the fallback
provider. Clear MEMCAL_FALLBACK_PROVIDER to disable it. Failed fallback calls remain
errors, and usage includes both providers. Configure MEMCAL_LLM_COMMAND_TIMEOUT to
control how long a CLI request can take before fallback.
Brief¶
| Key | Default | Meaning |
|---|---|---|
MEMCAL_DAYS_BACK |
3 (0–90) |
Backward window |
MEMCAL_DAYS_FORWARD |
30 (1–365) |
Forward window from today |
MEMCAL_BRIEF_TOKEN_CAP |
1500 (200–20000) |
Whole-brief budget |
Collection¶
| Key | Default | Meaning |
|---|---|---|
MEMCAL_SPOOL_HORIZON_DAYS |
30 (1–365) |
Older lines archive but never queue for the model |
MEMCAL_COLLECT_INTERVAL_MINUTES |
5 (1–1440, minutes) |
How often a checked source becomes due for ingest --due |
MEMCAL_DISABLED_SOURCES |
empty = all on | Comma-separated sources to skip in ingest all, due checks, Collect, and the nightly pull; explicit memcal ingest <name> still runs |
MEMCAL_EMAIL_BACKFILL_DAYS |
0 = horizon |
First mail reach, then watermark |
MEMCAL_PLATFORM_MUTE |
show |
show, ask, or mute muted-chat evidence policy |
MEMCAL_IMESSAGE_BACKEND |
chatdb |
bluebubbles (server) or chatdb (local database). See iMessage |
MEMCAL_IMESSAGE_FALLBACK |
on | With the BlueBubbles backend, read local chat.db when the server is unreachable; off = hard failure |
MEMCAL_BLUEBUBBLES_LOCATION |
auto |
auto (infer from URL), local, or remote — decides whether the app may be opened |
MEMCAL_BLUEBUBBLES_AUTOSTART |
on | Open a down local BlueBubbles server (hidden) during the nightly pass |
MEMCAL_WHATSAPP_AUTOSTART |
off | Open WhatsApp hidden for dream, nightly, or explicit collection |
MEMCAL_WHATSAPP_AUTOSTART_BACKGROUND |
off | Also allow opening during periodic ingest --due message checks; requires autostart |
MEMCAL_WHATSAPP_CLOSE_AFTER |
on | Close after collection only when Memcal opened it |
MEMCAL_WHATSAPP_WAIT_SECONDS |
30 (0–300) |
Maximum wait for the local WhatsApp database |
MEMCAL_UNRESOLVED_ACTIVE_DAYS |
21 (1–365) |
Hide inactive unnamed senders from naming queues and diagnostics |
MEMCAL_ITEM_BUDGET |
20000 |
Lines per pass |
MEMCAL_ITEMS_PER_ENTITY |
2000 |
Lines per bundle |
MEMCAL_COLD_START_WAVES |
4 (1–20) |
Wave count for large first passes |
Dream packing¶
| Key | Default | Meaning |
|---|---|---|
MEMCAL_PACK_BUNDLES |
6 |
Bundles per propose batch |
MEMCAL_PACK_TOKENS |
12000 |
Token budget per batch |
MEMCAL_PACK_STRATEGY |
size |
size or affinity |
MEMCAL_AFFINITY_NEAR_DAYS |
3 |
Near-window for affinity packing |
MEMCAL_PROMPT_VERSION |
v2 |
v2 or v1 |
MEMCAL_PROPOSE_STAGES |
off | Comma list enabling staged extraction |
MEMCAL_BUNDLE_FORMAT |
v1 |
v1 or v2-quiet-stream |
MEMCAL_DREAM_NAMING |
on | Name a nameless sender a row was drawn from (identity) |
MEMCAL_FRESHNESS_GUESS_NUDGE_DAYS |
5 (0–90) |
Distinct active days before a guessed name's freshness hint asks to confirm it; 0 never asks |
Merge¶
| Key | Default | Meaning |
|---|---|---|
MEMCAL_SAME_EVENT_TOKENS |
2 |
Shared title words to merge |
MEMCAL_SAME_EVENT_POOR_TOKENS |
1 |
Threshold without participants/location |
Publishing (off until named)¶
| Key | Default | Meaning |
|---|---|---|
MEMCAL_PUBLISH_CALENDAR |
off | macOS calendar name for confirmed events |
MEMCAL_PUBLISH_REMINDERS |
off | Reminders list for due tasks |
MEMCAL_REMIND_DEADLINES |
on | Internal deadline timestamps |
Scripted setup:
memcal setup --provider codex
memcal setup --provider claude-code
memcal setup --provider antigravity
memcal setup --provider grok
memcal setup --provider codex --model gpt-6-luna
memcal setup --provider openrouter --api-key "sk-or-..."
memcal setup --provider openai-compatible --model YOUR_MODEL --base-url https://host/v1