docs: fix drift in Health Monitoring - #274
Draft
jack-arturo wants to merge 1 commit into
Draft
Conversation
- HEALTH_MONITOR_AUTO_RECOVER and HEALTH_MONITOR_CHECK_INTERVAL are not read by health_monitor.py; both are CLI flags (--auto-recover, --interval) - document the real HEALTH_MONITOR_EMAIL var and the CLI-overrides-env behavior - correct the webhook payload shape (level/title/message/details/system) - /startup-recall returns critical_lessons + system_rules with hardcoded limits and no recent-memory fallback; fix the broken jq example - /analyze runs 6 queries with a shared try/except, not 7 with per-query isolation; correct component list, sequence diagram, and use-case fields Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EXhZREMSHTSqk3bhiNaX4k
Deploying automem-website with
|
| Latest commit: |
100eb87
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://acc92f56.automem-website.pages.dev |
| Branch Preview URL: | https://docs-audit-operations-health-ncto.automem-website.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs-accuracy audit of
/docs/operations/health(never previously reviewed). This page had more provable drift than the 5-fix cap allows; the top 5 by severity are fixed, the rest are listed under Follow-ups.HEALTH_MONITOR_AUTO_RECOVERdocumented as an env var in 3 places (Railway service env block, "Enable via environment variable", Configuration Reference table, plus a troubleshooting step)health_monitor.pynever reads it. Auto-recovery comes only from--auto-recover, threaded throughHealthMonitor(auto_recover=args.auto_recover). Setting the env var does nothing.--auto-recoveras the only switch, including in the troubleshooting stepautomem@8ff266e:scripts/health_monitor.py#L59,automem@8ff266e:scripts/health_monitor.py#L404HEALTH_MONITOR_CHECK_INTERVALdocumented as an env var (default300) in 2 places--interval, argparse default300.automem@8ff266e:scripts/health_monitor.py#L374{alert_type, drift_percent, falkordb_count, qdrant_count, timestamp, service_url}send_alert()posts{level, title, message, details, timestamp, system}. None of the five documented keys other thantimestampexist; drift values live underdetails.levelvaluesautomem@8ff266e:scripts/health_monitor.py#L173/startup-recall: "Returns matching memories up to the configured limit", "Falls back to recent memories if tag-filtered results are insufficient", examplejq '.memories | length'LIMIT 10andLIMIT 5. No fallback exists. Response keys arecritical_lessonsandsystem_rules— there is nomemorieskey, so the documented command printsnull.jqpathautomem@8ff266e:automem/api/recall.py#L2690,automem@8ff266e:automem/api/recall.py#L2728/analyze: "executes 7 independent Cypher queries", each "wrapped in a try-except block"; components listed as total count / type distribution / entity frequency (top 20) / confidence in 0.1 buckets / activity by hour / tag frequency / relationship counts. Use-case table citesmemories_by_type,top_entities,top_tags,relationships[...]try/except— a failure returns HTTP 500, not a partial result. Real keys:memory_types,patterns,preferences,temporal_insights,entity_frequency(top 50, read frommetadataentities/keywords/topics),confidence_distribution(low/medium/high, not 0.1 buckets). No total-count, tag-frequency, or relationship component exists.GET /graph/statsautomem@8ff266e:automem/api/recall.py#L2742,automem@8ff266e:automem/api/recall.py#L2865,automem@8ff266e:automem/api/graph.py#L438Also surfaced the real-but-undocumented
HEALTH_MONITOR_EMAIL(accepted, logged, but email sending is a TODO) and noted that--drift-threshold/--critical-threshold/--webhookoverride their env vars.Verified correct and untouched: the
/healthresponse example and all field/status tables,vector_dimensionssemantics, the 200/500 response-code table, therailway.jsonhealthcheck block,HEALTH_MONITOR_DRIFT_THRESHOLD=5andHEALTH_MONITOR_CRITICAL_THRESHOLD=50, the drift formula, andscripts/recover_from_qdrant.py.This page has no source-note permalinks (its
:::noteis a provenance note about two merged source documents), so there was nothing to repin.Verified against: automem@8ff266e62e65cb2e81719a765b05f64a2361a127
Questions
< 1%/1-5%/5-50%/> 50%, but the Drift Thresholds table directly above it says Normal is< 5%and Warning is5-50%. The code has exactly two thresholds (5 and 50), so the flowchart's1%boundary has no basis — but I could not tell whether the sub-1% band is a deliberate operator heuristic, so I left it alone.Unverified
.github/workflows/backup.ymlin the architecture diagram. I did not confirm what that workflow schedules, so the "Scheduled Checks" label is left as-is.Follow-ups
Real drift found but beyond the 5-fix cap:
enrichment.queue_depthis defined as "Total jobs in queue (pending + inflight)" — it isenrichment_queue.qsize(), which drops a job the moment the worker claims it, so inflight jobs are excluded.MATCH (m:Memory) RETURN count(m); the handler callscount_falkor_memories(), which excludesRECALL_EXCLUDED_TYPES. Same finding as PR docs: fix drift in Health & Analytics #270 onreference/api/health./healthas feeding off the sync worker (HealthEndpoint --> SyncWorker);/healthcomputes its own counts inline viaautomem/sync/accounting.pyand does not consult the worker.null/unknownwhen Qdrant is down — accurate — but omits thatstatusalso becomesdegradedonsync_status == "drift_detected"with both stores up.Generated by Claude Code