Architecture Overview
Technical architecture of AutoDoctor across agent, persistence, reporting, API service, and dashboard layers, including runtime boundaries and data flow.
Categories:
Who This Is For
- Developers extending diagnostics/remediation modules.
- Operators debugging interactions between agent and API.
High-Level Components
agent/: PowerShell orchestration, modules, telemetry, SQLite writesagent/core/report.ps1: HTML, JSON, Markdown, and optional PDF report generationserver/api/: FastAPI app, SQLite query layer, service wrapperserver/dashboard/: static dashboard + Chart.js polling clientconfig/: INI template and runtime configinstaller/: build and Inno packaging scripts
Execution Flow
- Agent entrypoint (
AutoDoctor.ps1) initializes paths and DB. - Module engine executes collection modules, then validation/history/anomaly/correlation.
- Root cause and remediation run, then results are persisted.
- HTML, JSON, Markdown, and optional PDF reports are generated.
- Telemetry JSON and
latest_run.jsonare written. - API reads SQLite + metadata + report JSON and serves endpoints.
- Dashboard polls API every 5 seconds.
AutoDoctor.ps1
-> module engine
-> rootcause + remediation
-> SQLite writes + telemetry snapshots
-> report generation (HTML / JSON / MD / PDF)
-> latest_run.json
-> FastAPI endpoints
-> dashboard UI
Service Runtime Flow
- Service wrapper (
autodoctor_service.py) resolves runtime paths and mode. - Child API process starts from bundled binary or source script depending on mode.
- API binds host/port based on precedence (registry -> INI -> env -> defaults).
Key Design Characteristics
- Local-first storage and runtime
- SQLite as shared state between writer (agent) and reader (API)
- Report JSON as a second read model for higher-level dashboard summaries
- Configurable service registration mode for constrained environments
- Clear separation of collection (agent) and presentation (API/dashboard)