Sprout is an AI health coach API that research teams can connect to their own apps. RENEW Scleroderma, a Michigan Medicine study app, uses it for participant coaching. It answers questions using a health library and draws on a participant's goals and past conversations to help them work through day-to-day challenges.
I designed and built the API, retrieval pipeline, long-term memory, and evaluation system.
- Role
- System design & AI engineering2025 - present
- With
- Michigan Medicine
- Stack
- Python, FastAPI, LangGraph, PostgreSQL, pgvector, DeepEval, promptfoo
RAG pipeline
A classifier decides whether a message needs information from the health library. When it does, the classifier rewrites it into a search query. Conversational turns go straight to a reply.
Search is hybrid. Vector search matches the meaning of a question, keyword search matches clinical terms, and reciprocal rank fusion merges the two lists. A patient asking "what helps with cold hands?" and a clinician asking about first-line management of Raynaud's phenomenon reach the same passages. Each chunk is embedded with its document's title, because most of the corpus is journal articles with generic section headings.
A small model then grades each passage from 0 to 10 against the question, dropping anything below 4. I used these grades because the fused search scores describe rank, making them difficult to use as a relevance cutoff. When no passage clears the threshold, the coach explains that its library doesn't cover the question and suggests asking the care team.
Replies cite their sources, and medical facts have to come from the retrieved text.
Can you have scleroderma antibodies before developing symptoms, and how long before symptoms typically appear?
- Rewritten search
- presence of scleroderma (systemic sclerosis) antibodies before symptom onset and typical time interval before clinical symptoms appear
Rerank 4 of 20 passages kept
- Autoantibody tests[1] passage 62
- Disease subsets[2] passage 10
- Autoantibody patterns[3] passage 15
- Raynaud phenomenon[1] passage 32
from 5 documents, 3 kept
Reply
The sources I have say certain systemic-sclerosis-specific autoantibodies can appear several months to years before the clinical onset of systemic sclerosis. [1]
What the sources don’t provide is a single “typical” time interval from antibodies to symptoms for most people.
- [1]Systemic Sclerosis (Scleroderma)2 passages, cited
- [2]Drug Treatment of Scleroderma, Springer Nature1 passage, cited
- [3]Advances in pathogenesis and treatment of systemic sclerosis1 passage, not cited
Long-term memory
The coach keeps context between conversations in layers. Each conversation becomes a dated summary of what the person reported and what helped. Patterns inferred from those summaries go into a ledger that tracks confidence and age, merges duplicates, and retires stale entries. A periodic review revisits the whole ledger.
I kept the clinical summary from study assessments separate from these conversation memories. That gives the coach both an established health background and a record of how the participant has been doing recently.
Evals
I built evaluation suites around specific questions: does retrieval find useful sources, does a correction carry into the next conversation, and does the coach stop using an interpretation a participant rejected?
The harness runs fixed conversation cases and scores them with a judge model separate from the chat model. Comparisons turn off one source of context at a time to measure its effect. Memory experiments replay the same transcript across designs so that the comparison comes from the memory system, rather than differences in the conversations.
I read the saved responses alongside the scores, because an automated judge can miss problems. The suites run on DeepEval and promptfoo.
- Software behavior
- Does each request receive the intended context?
- 442 tests, 5 live
- Retrieval and answers
- Does the reply stay within the retrieved evidence?
- 28 cases
- Summaries and routing
- Does a correction survive into a fresh conversation?
- 65 cases
- Coaching inferences
- Does a rejected interpretation stop shaping replies?
- 20 cases
- Safety
- Does the reply follow the required response behavior?
- 20 cases
System design
Sprout runs as a FastAPI service. LangGraph coordinates each conversation turn, PostgreSQL with pgvector stores the health library and conversation memory, and model calls go through the university's UMGPT gateway.
Each task has its own model setting and fallback, including message classification, reranking, summaries, and memory review. I can change the model for one task without changing the others.
Retrieval, clinical context, memory, and app context can each be enabled per request. This lets study teams use the same service with different research protocols.