Automated feedback loop that connects signals and answers to dynamic scores — suggesting improvement paths for students and patients

Adaptive Systems · Research & Proof-of-concept

A Bayesian-driven feedback loop that connects patient signals and quiz answers to dynamic health and mastery scores — suggesting what to do next

Research based · proof-of-concept validated on ASSISTments, EdNet and NHANES 2017–2020 · live demo built on n8n, Firestore, and Gemini · based on research by Uday Shankar Bhowal · GitHub · Read ATS publication · August 2026

Healthcare AI is having a moment. As of January 2026, roughly 40 million health-related queries a day are going through ChatGPT Health, 260-plus physicians across 60 countries are helping shape it, and seven major health systems — Stanford, UCSF, AdventHealth, HCA, and others — are already live with it. Analysts project the market will grow from about $56B in 2026 to $1.03T by 2034. Most of that push is built around one idea: give every patient static, comprehensive guidance, generated once and handed over.

AHOE — the Adaptive Health Orchestration Engine — starts from a different idea. Instead of one static plan, it continuously estimates how a patient is actually responding, over time, and adjusts. It’s a proof-of-concept validated against 15,560 patients in the NHANES 2017–2020 dataset, with publication pending. This post walks through how it thinks, and then does something a little unusual: shows the exact same architecture, rebuilt from scratch, running a live study coach for students instead of a care plan for patients.

Animated diagram comparing the AHOE healthcare pipeline to the Adaptive Study Coach education pipeline Two identical five-stage pipelines stacked vertically, with small dots animating along the arrows to show data moving stage to stage and looping back as feedback. Top row, healthcare: patient data feed, orchestrator, memory graph, recommendation engine, clinician dashboard. Bottom row, education: quiz answer, n8n orchestrator, Firestore, Gemini, Gmail. Healthcare — AHOE Patient data feed Orchestrator Memory graph Recommendation engine Clinician dashboard ↻ outcome feeds back into next state update Education — Adaptive Study Coach Quiz answer n8n orchestrator Firestore Gemini Gmail ↻ every answer feeds back into tomorrow’s mastery estimate

Watch the dots move: same five stages, same feedback loop — only the boxes’ names and the domain change.

How AHOE thinks

Four steps, repeated every cycle, for every patient.

1. State estimation

Continuously estimate each patient’s underlying health state from whatever signals are available, dynamically.

2. Selective orchestration

Only escalate or act when the state changes meaningfully — avoiding constant, indiscriminate intervention.

3. Per-patient policy optimization

Learn what actually works for this specific patient, not the population average.

4. Continuous feedback

Every outcome updates the model — the system gets sharper over time, not static.

Validated against real data, that logic holds up: state estimation reaches a 0.9743 AUC, the selective step cuts compute by 76.1% versus acting on every signal, and the resulting policy shows 31% lower GainVar than baseline. AHOE is still research in progress with publication pending — it isn’t running live anywhere yet. What is buildable today is the underlying conceptual architecture behind it, and that’s the second half of this post.

Same architecture, rebuilt for studying (Published Research and n8n Production pipeline)

Swap “personalized care for patients” for “personalized practice for students” and the shape doesn’t change. The Adaptive Study Coach is that rebuild — open, inspectable, and running on Google Sheets, n8n, Firestore, and the Gemini / OpenAI API, with retrieval-augmented generation layered on top. Same four steps, different tools underneath:

1. State estimation Bayesian knowledge tracing

A real, closed-form update to each skill’s mastery probability after every attempt.

2. Selective orchestration Confidence threshold

AI feedback only fires once confidence crosses a threshold — otherwise, the student gets a clarifying question instead.

3. Per-student policy optimization Thompson sampling

Real beta-distribution draws pick which skill the student should practice next.

4. Continuous feedback

Every answer updates the model — tomorrow’s recommendation is sharper than today’s.

The Bayesian knowledge tracing update: p_new = p_obs + (1 - p_obs) × 0.15, where mastery starts at a default of 0.3, p_transit = 0.15 (chance of learning after an attempt), p_slip = 0.10 (chance of a wrong answer despite knowing it), and p_guess = 0.20 (chance of a right answer despite not knowing it).

Side by side

Stage AHOE (healthcare) Adaptive Study Coach (education)
InputPatient dataQuiz answer
OrchestrationOrchestratorn8n orchestrator
MemoryMemory graphFirestore
ReasoningRecommendation engineGemini
OutputClinician dashboardGmail

Same shape. Same logic. Different domain, different use — health vs. academics.

The RAG layer, in three steps

What makes Gemini’s feedback specific instead of generic.

1. Seed the knowledge base

Twelve STEM skill documents load into a simple vector store using OpenAI’s text-embedding-3-small, stored under the key ats_skill_kb.

2. Retrieve on each run

Thompson sampling picks the next skill (say, quadratic equations), and the top three semantically similar documents come back from the vector store.

3. Inject into the Gemini prompt

Retrieved curriculum text, current mastery percentage, and the active skill merge into one structured prompt — so Gemini generates grounded, specific feedback instead of generic text.

See the pipeline run

This is the shape of the actual automation behind the study coach, with implementation names swapped for what each step does. Press run to watch one assessment answer move through it.

Press it a few times — the confidence gate picks a different path at random each run, so a couple of clicks will show you both outcomes.

New assessment answer
Read skill state
Update mastery estimate
Save updated state
Pick next skill
Retrieve context (RAG module)
Build grounded prompt
Confidence gate
Generate feedback (LLM module)
Ask clarifying question
Normalize response
Build email preview
Send to student

Sample output

Subject: Your next practice question

Nice work on the last one. Let’s try quadratic equations next — here’s a worked example to warm up with.

Where this actually pays off

The four-step loop isn't just an elegant shape — each step buys something concrete.

Fewer false alarms

Selective orchestration only acts when the state genuinely shifts, instead of firing on every new reading or every answer. That's where the 76.1% compute saving comes from — it's not a tuning trick, it's the direct result of not intervening when nothing has changed.

Personalized, not population-average

Per-patient and per-student policy optimization means the recommendation is fit to how this one person has actually responded, not to what works for most people. Two patients with the same diagnosis, or two students on the same skill, can get different guidance because their histories differ.

Compounds instead of resetting

Continuous feedback means today's outcome is tomorrow's starting point. A static plan gives the same advice on day one and day one hundred; this loop's day-one-hundred recommendation is measurably sharper — 31% lower GainVar than a baseline that doesn't update.

Inspectable end to end

Because the education build runs on open tools — n8n, Firestore, Gemini — every stage of the loop can be opened and read, rather than trusted as a black box. That's what makes it useful as a reference architecture beyond just this one demo.

How data and models actually move through it

Same four stages, mapped to what goes in, what does the reasoning, and what comes out — for both domains.

Stage Data in Model / method Output
State estimation AHOE: patient signals over time.
Study coach: correct / incorrect on a skill.
AHOE: learned state model, 0.9743 AUC.
Study coach: Bayesian knowledge tracing, closed-form update.
Updated probability of the underlying state (health status, or skill mastery).
Selective orchestration The updated state estimate. Threshold rule: act only if the state moved meaningfully; otherwise pass through. AHOE: escalate to clinician or stay quiet.
Study coach: AI feedback, or a clarifying question.
Policy optimization This patient's or student's own history, not the population's. AHOE: per-patient policy learning.
Study coach: Thompson sampling over a beta distribution.
The next action or skill to focus on.
Continuous feedback The real-world outcome of the last action. Model update — no retraining from scratch, just an incremental revision. A sharper state estimate for the next cycle.

In the study coach specifically, the RAG layer sits between policy optimization and the output — it's what turns "focus on quadratic equations" into an actual worked explanation grounded in the curriculum, rather than a generic hint.

Notes

  • AHOE proof-of-concept results (0.9743 AUC, 76.1% compute savings, 31% lower GainVar) are drawn from a pending publication and validated on NHANES 2017–2020 (15,560 patients).
  • Adaptive Study Coach demo stack: Google Sheets/Forms, n8n, Firestore, Gemini / OpenAI API, RAG via a simple vector store.
  • Healthcare-AI market context (40M daily queries, 260+ physicians, 7 health systems, $1.03T projected 2034 market) reflects January 2026 figures cited in the source presentation.

LearnHive Community

Ready to connect with fellow learners?

Share ideas, ask questions, and grow together — join the LearnHive Community today.

Join the LearnHive Community →

Leave a Reply

Your email address will not be published. Required fields are marked *

New Report

Close