Agentic QAD
Saama · 2026 — Present
A multi-agent pipeline turns an SME's plain-language clinical data quality check description into a verified validation script. This reduced the time to add a new scenario from days to a few hours.
- LangGraph
- LLM routing
- Vector DB
- pytest
Details
Agentic QAD
Saama · 2026 — Present
Problem
QAD's production harness worked because every scenario ran as deterministic code, but that reliability came at a cost: each new scenario needed a developer, a requirements discussion with the SME who owns the business logic, and then a few days of iterating on the script until it behaved correctly. SMEs describe scenarios in loose clinical language and can't write the code themselves. Agentic QAD, a multi-agent system that turns an SME's plain-language description into a verified Python validation script.
Approach
Built a multi-agent system, it starts by Data Profiling Module which understands the context, parses study protocols for candidate checks and profile the study data. With these contents, Standardization Agent hold clarification rounds with the Data Managers via chat mode for data quality check scenario generation, using memory so no question is asked twice, until the scenario becomes a structured, code-ready specification. Before any code is written, a data contract and constrained pseudocode pin down exactly which columns exist, so agents can't invent them. The Code Generation Agent reuses helper functions from a closed set of known auxiliary cases, including one that calls an LLM for clinical judgment.
Verification is where the design matters most. A Testing Agent writes 10 strategic tests without ever seeing the code, everything runs in a sandbox after security checks, and a specialist 'Swarm Agent' repairs the script in case of failures. Scripts that fail more than 20% of tests are killed, not patched endlessly, and the time to add one scenario has dropped from days to a few hours. Simple and medium scenarios pass on the first attempt; complex ones still struggle, which is pushing us toward iterative code generation with Data Managers.
What i learnt: Code generation was quarter of the effort; Standardization: turning vague clinical text into a precise spec was major part of the effort. Every decision an agent has to guess becomes a bug, so the real work is closing those gaps before the first line of code is written.
Outcome
When an LLM writes code instead of making decisions, its output becomes something you can test before it touches data. But agents can only verify code against a spec. Only a human can confirm the spec is right.