cleandataengineering.aiDrug-Safety Agent on Databricks, drawn simply
You are here: End to end › One real run

Drug-Safety Agent on Databricks · End to end · One real run

One real run, worked

This is a real run of one investigation. The router, the data, the tools, the statistics and every check are the real ones. The model's three replies are scripted, so the page builds offline and costs nothing.

The requestIs there a signal for lisinopril and angioedema?
Router decidesinvestigate, answered by loop; drug lisinopril, event ANGIOEDEMA
Loop3 steps, ended: goal_reached, spend $0.0000
Tool called: signal_stats{"drug": "lisinopril", "event": "ANGIOEDEMA", "cases": 7015, "prr": 12.321083342766578, "ror": 12.57741899676185, "ror_ci95": [12.257628102982356, 12.905552957804035], "screens_as_signal": true, "note": "Screening statistic from s…
Tool called: label_mentions{"drug": "lisinopril", "event": "ANGIOEDEMA", "on_label": true, "in_boxed_warning": false, "label_version": "20261001", "evidence": [{"section": "warnings", "term": "angioedema", "quote": "subject to a variety of adverse reactions…
Grounding checkno problems: every number equals a tool result
What the scientist readsDraft assessment, not yet decided by a person. lisinopril and ANGIOEDEMA: Reports of angioedema with lisinopril are reported far more often than for other drugs. Reports with both: 7015. PRR: 12.32. The event is on the label. Uncertainty: Spontaneous reports cannot show that the drug causes the event. Recommendation: The label already warns of this; no further action suggested.

The three model answers in this run are scripted so the page builds offline and costs nothing. The data, the tools, the statistics, the router and every check are the real ones.

The same run as a call stack

CALL STACK · START TO FINISHGOES IN → COMES OUT1Open the source: src/drugsafety/entrypoint.py:85handlesrc/drugsafety/entrypoint.py:85in: the scientist's wordsout: a Reply2Open the source: src/drugsafety/router.py:92routesrc/drugsafety/router.py:92in: the wordsout: intent = investigate, answered by the loop3Open the source: src/drugsafety/hagent.py:87investigatesrc/drugsafety/hagent.py:87in: drug, event, a model, a tool clientout: a Draft4Open the source: src/drugsafety/hagent.py:87loop.run (library)src/drugsafety/hagent.py:87in: goal and standing instructionout: tool calls, then a JSON reply5Open the source: src/drugsafety/hagent.py:133_parsesrc/drugsafety/hagent.py:133in: the model's reply textout: a body, or a list of problems6Open the source: src/drugsafety/hagent.py:141groundingsrc/drugsafety/hagent.py:141in: a Draftout: a list of mismatches (empty = clean)7Open the source: src/drugsafety/entrypoint.py:34_say_draftsrc/drugsafety/entrypoint.py:34in: the checked bodyout: the sentence the scientist reads
Each box is a function; indented boxes are called by the one above.