Skip to main content
I built Luria to compress the wall-clock time of a neuropsychological evaluation without compressing the clinical care that goes into it. The agent pipeline is the part of that work that runs between visits. It handles intake parsing, transcript summarization, domain interpretation, and report assembly so you can spend your time on the patient, not on copy-paste. The pipeline is organized into five phases (A–E) that map onto the three clinical visits in a standard evaluation plus the deterministic render at the end.

Pipeline at a glance

PhaseStageClinical visitWhat it produces
AIntakeVisit 1 — NSEValidated intake folder + NSE summary
BTestingVisit 2 — NTPer-domain interpretations from scored test data
CSIRFVisit 3 — FeedbackIntegrated summary, diagnostic impression, recs
DAssemblyBetween Visits 2 and 3Composed report draft with quality review
ERenderFinalDeterministic Typst → PDF (no LLM in the loop)
Phases A–C are agent-driven. Phase D is a quality-gate assembly step. Phase E is intentionally deterministic — once the prose and tables are locked, rendering is a pure function of the source.

Phase A — Intake (Visit 1 / NSE)

Phase A turns the messy reality of an intake folder — consent forms, prior records, audio, rating scales — into a clean, redacted summary you can interpret. The agents fan out in parallel, then converge on a redaction gate before any LLM sees the composed summary.
A1 (nse_admin)

 ├──▶ A2 (nse_clinical_past)    ──┐
 ├──▶ A3 (nse_clinical_current) ──┤ parallel
 └──▶ A4 (nse_stt_transcript)   ──┘


                             A5 (nse_cod_summary)   ← PII redaction gate


                             A6 (nse_report)
StepAgentJob
A1nse_adminVerify consent, ROI, referral, and demographics are present
A2nse_clinical_pastExtract prior medical and psychiatric history
A3nse_clinical_currentExtract current rating scales and educational records
A4nse_stt_transcriptTranscribe the 60–90 minute NSE audio
A5nse_cod_summaryBuild the Chief-of-Diagnosis summary (PII-redacted)
A6nse_reportDraft the NSE narrative for the report
When to use it: Run Phase A as soon as Visit 1 ends and the intake folder is complete. A6 is the artifact you want before moving on to test selection.

Phase B — Testing (Visit 2 / NT)

Phase B reads scored test data from the cingulate pipeline and writes per-domain interpretation paragraphs. Each cognitive and neurobehavioral domain is interpreted independently, so a low-effort flag in one domain does not contaminate the others.
AgentScopeOutput
domain_textOne per domainInterpretation paragraph + validity caveats
When to use it: Run Phase B once the test scores are scored, classified, and saved to data/scores/. The output drops into the domain partials your report includes.

Phase C — SIRF (Visit 3)

SIRF stands for Summary, Interpretation, Recommendations, Feedback — the integrative work that ties the testing data back to the referral question.
AgentJob
sirf_summaryIntegrate Phase B domain interpretations into a unified summary
sirf_recsGenerate clinical recommendations grounded in the summary
When to use it: Run Phase C after Phase B is complete and you have reviewed the per-domain drafts. The output becomes the front matter of the final report — the part the referring provider actually reads first.

Phase D — Assembly

The report_assemble agent stitches the NSE narrative, score tables, domain interpretations, and SIRF output into a single Quarto-ready draft. This is also where the quality checklist runs — completeness, internal consistency, and HIPAA-style redaction checks.

Phase E — Render

The final step is a plain quarto render call against the assembled .qmd. There is no LLM in this loop. Same source, same PDF, every time — which is what you want for a clinical document that may end up in a chart, a courtroom, or a school district file. See How Luria Voice works for the rendering layer in detail.

How the visits map to the codebase

The agent code is organized by clinical visit, which mirrors how the work actually unfolds in the clinic:
FolderPhaseContents
visit1_nse/AIntake extraction prompts, NSE transcription, patient documentation
visit2_nt/BDomain interpretation prompts, score table generation, R/Python helpers
visit3_sirf/CDiagnostic frameworks, reporting standards, recommendation prompts
If you are wiring up a new clinic or extending the pipeline, start from the visit folder that matches the stage you are working on.
Last modified on June 3, 2026