config.patient.yml and per-domain context.
This guide covers what the prompt system is, when to use it, and how to extend it.
What the prompts system is
The prompts system has three pieces that work together:
The reference is the single source of truth. If a prompt is not in
PROMPTS.md, it is not part of the pipeline.
When to use templated prompts
Reach for the prompts system when you need to:- Run the same prompt across many patients without rewriting the prose each time
- Add an optional clause (for example, a parent rater block) that only fires when a flag is set
- Loop over a variable-length list (domain scores, evaluation dates, validity flags)
- Keep clinic-specific identity (clinician name, clinic name, ROI defaults) in one config file
Where prompts live in the pipeline
The reference is organized by the same phases described in the agent pipeline.The three Jinja2 patterns you actually need
You do not need to learn the full Jinja2 language. Three patterns cover every Luria prompt.1. Variable substitution
Wrap any variable name in double curly braces.2. Conditional blocks
Use{% if %} to include a block only when a flag is set.
3. For loops
Use{% for %} to iterate over lists — multiple evaluation dates, a panel of validity flags, or a set of domain scores.
Standard context variables
The runtime always passes a baseline set of variables loaded fromconfig.patient.yml. You can use any of these in any prompt.
domain_name, domain_scores, has_parent_rater, validity_concerns) that are passed in by the calling agent.
Rendering a prompt at runtime
Callfill_prompt() with the name of the prompt from PROMPTS.md and the context dictionary.
PROMPTS.md, renders it against the context, and returns the final string ready to send to a model.
Adding a new prompt
- Add a new section to
agents/prompts/PROMPTS.mdwith the required fields: Role, Worker, Task, Input, Output, and the prompt body in a fenced block. - Use
{{variable}}placeholders for anything that varies per patient or per run. - Document any non-standard variables in the Input field so the calling agent knows what context to pass.
- Reference the new prompt from the calling agent by name — never inline the prompt text in code.