Skip to content

docs: fix drift in Environment Variables - #272

Draft
jack-arturo wants to merge 1 commit into
mainfrom
docs/audit-getting-started-environment-variables-20260729
Draft

docs: fix drift in Environment Variables#272
jack-arturo wants to merge 1 commit into
mainfrom
docs/audit-getting-started-environment-variables-20260729

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

Automated docs-accuracy audit of getting-started/environment-variables. Two rows documented variables the service never reads.

Claim Current state Fix Evidence
Caution: "PORT=8001 is mandatory on Railway. Flask defaults to port 5000 if unset, causing ECONNREFUSED errors" runtime_wiring.py reads int(os.environ.get("PORT", "8001")) — AutoMem's own default is 8001, and Flask's 5000 default is never reached. Caution replaced with the actual default behavior (downgraded to a tip, since there is nothing to warn about). automem@8ff266e:automem/runtime_wiring.py#L82
LOG_LEVEL | No | INFO | "Python logging level" LOG_LEVEL appears nowhere in the repository. app.py calls configure_logging(level=logging.INFO) with a hardcoded literal, and configure_logging takes the level as a keyword argument with no env lookup. Setting LOG_LEVEL does nothing. Row removed; replaced with prose stating the level is fixed at INFO and how to actually change it. automem@8ff266e:app.py#L97, automem/runtime_environment.py#L9-L14
FLASK_ENV | No | production | "Flask environment mode" Neither FLASK_ENV nor FLASK_DEBUG is referenced in any non-test source file. app.run() hardcodes debug=False. Setting it has no effect. Row removed; the replacement prose says explicitly that debug mode and hot reload are unavailable. Repo-wide grep -rn "FLASK_ENV|FLASK_DEBUG" --include=*.py returns no non-test hits at 8ff266e
SEARCH_WEIGHT_RELEVANCE — "LLM-scored relevance (disabled by default)" The weight multiplies memory["relevance_score"], which comes from the consolidation decay cycle (access patterns + age). No LLM is involved. Description rewritten to name the real signal and keep the experimental/no-op framing. automem@8ff266e:automem/utils/scoring.py#L212-L215, #L260
JIT_ENRICHMENT_ENABLED — "Run enrichment inline on store (just-in-time)" The flag gates jit_enrich_lightweight, which is wired in as jit_enrich_fn and invoked from the recall path for results the background worker has not enriched yet. It does not run on store. Description corrected to recall-time enrichment of unenriched results. automem@8ff266e:automem/runtime_wiring.py#L56, automem/api/recall.py#L2443

The PORT fix closes out the last instance of the "Flask defaults to 5000" myth on this docs site — prior audits removed it from operations/troubleshooting, overview, deployment/railway, platforms/chatgpt, and platforms/claude-web.

Spot-checked and confirmed correct, left untouched: the three-source config-loading priority order (process env wins because load_dotenv() does not override existing vars, project .env is loaded before ~/.config/automem/.env); CLASSIFICATION_MODEL default gpt-4o-mini; RECALL_EXCLUDED_TYPES default MetaPattern; RECALL_RELATION_LIMIT 5; and the AUTOMEM_LOG_LEVEL MCP-client row, which is genuinely read by src/index.ts.

This page has no source-note block, so there were no permalinks to repin.

Verified against: automem@8ff266e62e65cb2e81719a765b05f64a2361a127
Verified against: mcp-automem@946f9e5ed1385b632efd2e5b250d064bcc4295e8

Questions

  • Removing both rows leaves the "API Server" section with prose and no table. Keeping the heading preserves the anchor and gives the negative answer a home ("no, there is no LOG_LEVEL"), which seemed more useful than deleting the section — but if you would rather drop the heading entirely, say so and I will.
  • Should a real LOG_LEVEL env var be added to the service instead? The docs promising one suggests it was intended. That is a code change, not a docs fix, so it is out of scope here.

Unverified

None — every row touched in this PR was located in source, and the two removals are backed by repo-wide absence rather than an inability to find the code.

Follow-ups

None on the variables audited. The tables were checked row-by-row against automem/config.py; the remaining defaults matched.


Generated by Claude Code

- PORT defaults to 8001 in AutoMem; drop the Flask-defaults-to-5000 myth
- remove fabricated LOG_LEVEL and FLASK_ENV rows; neither is read
- SEARCH_WEIGHT_RELEVANCE weights consolidation decay, not LLM scoring
- JIT_ENRICHMENT_ENABLED runs inline on recall, not on store

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EiTAbgmncBDToAzqj71wka
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying automem-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: f3a919d
Status: ✅  Deploy successful!
Preview URL: https://0a9e7b34.automem-website.pages.dev
Branch Preview URL: https://docs-audit-getting-started-e.automem-website.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants