Take-home exercise
PharmaQMS: the model drafts, the code decides
A take-home with a fixed brief: a complaint-management app where a LangGraph workflow turns a pasted complaint, PDF or email into structured fields, a risk level, a reportability call and a draft root cause. What I like about my version is what the model is not allowed to decide.
26pytest tests, green in CI
9workflow nodes, 7 with a non-LLM fallback
0API keys needed to run the tests
Who decides what
- ExtractThe LLM pulls fields from the complaint.
- AssessThe LLM proposes risk and report type. Out-of-range values are rejected.
- DeadlinesPlain, tested Python computes regulatory due dates.
- StatusAn explicit transition map. Invalid jumps return 409.
- OverrideA QA override is audited and survives re-analysis.
The idea
In a regulated workflow, a wrong due date is worse than a slow one. So the model reads and drafts, and deterministic code owns anything with a consequence: deadlines, status changes and the audit trail.
Each LLM node falls back to keyword heuristics when no model is available, which means the whole pipeline, its tests and CI run without an API key.