Skip to main content
Every prompt the Luria pipeline runs — intake admin checklists, NSE summarization, per-domain interpretation, SIRF synthesis — lives in a single canonical reference. Each prompt is templated with Jinja2, so the same prompt text works for every patient. You fill in the placeholders at runtime from config.patient.yml and per-domain context. This guide covers what the prompt system is, when to use it, and how to extend it.
Templated prompts make patient data substitution mechanical, but they do not remove your clinical responsibility. Review every agent output before it lands in a final report.

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
If you are writing a one-off prompt for a single patient, skip the template layer and write it inline. The system is built for repeated runs.

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.
With the runtime context:
The rendered prompt becomes:

2. Conditional blocks

Use {% if %} to include a block only when a flag is set.
This is how the domain interpretation prompts conditionally pull in parent or teacher rater language without producing dead clauses when those raters are missing.

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 from config.patient.yml. You can use any of these in any prompt.
Phase B and C prompts receive additional per-domain variables (domain_name, domain_scores, has_parent_rater, validity_concerns) that are passed in by the calling agent.

Rendering a prompt at runtime

Call fill_prompt() with the name of the prompt from PROMPTS.md and the context dictionary.
The helper looks up the named section in PROMPTS.md, renders it against the context, and returns the final string ready to send to a model.

Adding a new prompt

  1. Add a new section to agents/prompts/PROMPTS.md with the required fields: Role, Worker, Task, Input, Output, and the prompt body in a fenced block.
  2. Use {{variable}} placeholders for anything that varies per patient or per run.
  3. Document any non-standard variables in the Input field so the calling agent knows what context to pass.
  4. Reference the new prompt from the calling agent by name — never inline the prompt text in code.
Keeping the prompts in one file means you can audit, diff, and version every change to the clinical reasoning the pipeline performs.
Last modified on June 3, 2026