Catching gastric cancer before stage IV, using the clinic records Rwanda already collects.
Surveillance, risk flags, care coordination and an AI agent, built on a synthetic OpenMRS-style EMR.
▶ Watch the 39-second demo reel
Important
All data in this project is synthetic. No real patients, facilities or district statistics appear anywhere. The risk models are proofs of concept and are not for clinical use.
Gastric cancer cases are rising in Rwanda, and most patients are diagnosed late, when treatment options are limited and survival is poor. Hospitals already record diagnoses, lab results, endoscopy reports and demographics in their EMRs, but that data is rarely analysed to see how the disease is moving through the population or who is most at risk. Key risk factors such as H. pylori infection are often not tested or not recorded.
Early Signals shows what routine EMR data can do when it is put to work end to end. A synthetic 1.5M-person Rwandan EMR feeds an incremental analytics pipeline and three tiers of risk models. Ministry analysts see where the burden is growing. District doctors see who needs an endoscopy, and why. And once a doctor approves a care plan, the patient gets a plain-language nudge on their phone, with no diagnosis words, only advice to visit.
- Surveillance: age-standardised rates with confidence intervals, joinpoint regression, spatial clustering (LISA, Gi*, SIR), Kaplan–Meier survival and care-quality funnel plots.
- Early warning: pre-diagnostic signal curves, missed alarm symptoms, H. pylori testing gaps and diagnostic delays.
- Three tiers of risk models: a points score, XGBoost with SHAP reasons and a JAX sequence model, combined into an ensemble (AUROC 0.970 and a median lead time of 6.2 months on the synthetic test set).
- Care coordination: six care pathways, a reminder ladder, a patient app and a simulation clock that shows whether patients come back.
- Learning loop: a challenger model trained on verified outcomes, with gates and a human Promote button.
- Role-scoped by design: the ministry sees only aggregates (counts below 5 suppressed), doctors see only their facility, and patients see only their own record.
- Data videos and daily briefs: Remotion videos of a case or the national picture, and a one-page PDF brief each morning.
See Architecture for every screen and component.
| Layer | Tools |
|---|---|
| Synthetic EMR | Python 3.11, NumPy, Polars, PyArrow, OpenMRS-style MySQL schema |
| Pipeline and analytics | DuckDB (blue/green publish), statsmodels, lifelines, PySAL (libpysal, esda), SciPy |
| Machine learning | scikit-learn, XGBoost, SHAP, JAX (GRU/Transformer sequence model), APC + ETS forecasting |
| API | FastAPI, Pydantic, sqlglot (guarded NL→SQL), WebSockets |
| Dashboard | React 18, TypeScript, Vite, HeroUI, Framer Motion, ECharts, deck.gl, react-three-fiber |
| AI agent | Node 22, Hono, Vercel AI SDK, MCP (Streamable HTTP), Claude / OpenRouter / OpenAI-compatible models, Python sandbox, libSQL |
| Videos | Remotion |
| Quality | pytest, Playwright, DeepEval |
| Tooling | uv, pnpm, Make, Docker Compose, Claude Code |
cp .env.example .env
uv sync --extra dev --extra report
make dev-data # small synthetic dataset, about 15 min, no MySQL needed
make serve # dashboard http://localhost:5173, API http://localhost:8000The full 1.5M-person build, demo mode and the live MySQL loop are covered in Getting started and Setup.
| Getting started | Run it locally |
| Architecture | Components, roles, screens |
| Care loop | Care plans, patient app, forecasts, 10-step demo |
| AI agent and MCP | Agent settings and MCP connection |
| Built with Claude Code | How we built it and the repo's Claude automations |
| Tests and results | Test suites and verified numbers |
| Data, privacy and licences | Synthetic data rules and third-party licences |
| Specification and decisions | The full spec and agreed deviations |
Early Signals was built at the Anthropic AI Week Hackathon.
Team: Benjamin, Remy, Andy and Irere.
Built with Claude. The code was written almost entirely by Claude Opus 5.5 in Claude Code, with the team setting direction and reviewing the work. Along the way we used:
/goalfor long autonomous runs against a clear finish line;/loopto repeat tasks such as/validate-riskon an interval;- Claude Code on the web cloud sessions and Routines (a daily 07:00 Kigali report);
- project skills (
/validate-risk,/daily-report), hooks andCLAUDE.md; - subagents, multi-agent workflows, git worktrees,
/forkand Monitor for parallel work; - MCP, to plug the Early Signals agent into Claude Code;
/brag, which made the demo reel from real captures of the app.
Details are in Built with Claude Code.
Code is released under the MIT Licence. The 3D anatomy (Z-Anatomy / BodyParts3D, CC BY-SA) and district boundaries (geoBoundaries, CC BY 4.0) keep their own licences; see Data, privacy and licences.





