One Python project. FastAPI runs the process-mining engine and serves the dashboard — the UI shows real, engine-computed numbers, not mock data.
cd cadence
pip install -r requirements.txt
python run.pyThat's it — no Node, no build step. The dashboard is dependency-free HTML/CSS/JS with hand-rolled SVG charts.
Browser (dashboard) ──fetch──► FastAPI ──► engine (mining, ROI, analytics)
SVG charts /api/* real computed results
GET /→ the dashboardGET /api/overview→ KPIs, trend, activity mix, app usage, process mapGET /api/workflows→ mined workflow templates + stepsGET /api/automation→ ranked automation opportunities (feasibility/ROI/risk)GET /api/analytics→ team comparison, focus/switch/rework, heatmapPOST /api/assistant→ grounded natural-language answers + a chart
Every payload is built at startup by pushing a synthetic dataset through the
actual engine functions (merge_executions_into_template,
generate_recommendation, team_metrics, classify_activity, ...).
cadence/
├── run.py # python run.py
├── requirements.txt
└── app/
├── main.py # FastAPI: API + serves the UI
├── engine/ # the process-mining engine (pure logic)
│ ├── models.py
│ ├── capture_and_vision.py
│ ├── workflow_and_mining.py
│ ├── automation_and_analytics.py
│ └── assistant_rag.py
├── services/
│ └── data.py # builds API payloads by running the engine
└── static/
├── index.html
├── styles.css
└── app.js # dashboard + SVG charts, calls /api/*
The agent runs on the monitored machine, separate from the server:
pip install mss # cross-platform screenshots
# Windows: pip install psutil pywin32 macOS: pip install pyobjc Linux: sudo apt install xdotool
cd cadence/agent
python capture_agent.pyIt refuses to start until you set "consent_confirmed": true in
agent/config.json, and it skips excluded apps/sites before taking any
screenshot. Each tick: detect active window → should_capture? → grab → (mask →
OCR → vision on the backend). Deploying screen capture on people usually carries
legal duties (notice, consent, DPIA under GDPR) — the consent gate is real.
- Live capture: replace the synthetic generator in
services/data.pywith your event store; the desktop agent feedscapture_and_vision.py(screenshot → mask → OCR → mask PII → vision action detection). - Real assistant:
services/data.answer()is a local grounded responder — swap it forengine/assistant_rag.answer_question()with your LLM + FAISS. - Persistence: point the API at PostgreSQL instead of the in-memory
DATA.
Analytics are team-level only. team_metrics enforces a cohort floor
(MIN_COHORT = 5) and refuses to report below it; there is no per-individual
scoring function anywhere in the engine.