DOI: 10.1002/psp4.70317 ISSN: 2163-8306

Context Engineering for AI ‐Assisted Pharmacometrics: A Practical Tutorial

Ari Pritchard‐Bell, Chih‐Wei Lin, William Holmes, Sameer Doshi

ABSTRACT

Large language models can execute pharmacometric workflows, but they make consequential domain‐specific errors when task instructions lack adequate details. This tutorial teaches pharmacometricians how to define self‐contained tasks that embed domain‐specific rules, verification criteria, and worked examples into each step of a pharmacometric workflow. These individual tasks are then organized into a structured task library where each task runs in a fresh LLM instance (with clean context), with information passed between tasks through shared workspace files. The tutorial covers context engineering, controlling what information reaches the LLM at each decision point, along with verification layers and methods to iteratively refine the task library. We demonstrate the approach on a synthetic population PK/PD scenario and provide the task library and implementation guide in the Supplementary Material.

More from our Archive