rpm.

Agentic Intent Workflow

Typed agent workflows for clinical review · in progress

Turns a clinical note request into a typed, validated workflow of agent, deterministic and human-review tasks.

PythonFastAPIPydanticLangChainDeepAgentspytestOllamaOpenRouter

Status: early implementation, actively in progress. Intention capture is scaffolded and passing its complete-case smoke test. Incomplete, mixed and out-of-scope cases are still being built out, and the typed DAG executor is the next milestone. This page describes a prototype, not a finished system.

Ask an LLM to pull structured facts out of a clinical note and you get an answer. What you don't get is any way to separate the parts that were actually written in the document from the parts the model inferred, or any signal about which bits a human should have looked at. In a domain where being confidently wrong is the failure mode that matters, that's the whole problem.

This is a workflow-engineering prototype built around that gap. It runs entirely on synthetic data, and its scope is deliberately narrow: it extracts facts explicitly documented in a note, flags anything unsupported or ambiguous, and routes uncertainty to human review. It does not diagnose, treat, or generate billing codes for real patients.

Why healthcare, for a domain-agnostic engine

The architecture isn't clinical. Healthcare is the reference implementation because it forces the hard parts to be explicit rather than optional — grounded evidence checks, human review routing, and auditable execution traces are all non-negotiable there. Build it so it survives that, and the same shape works elsewhere.

The pipeline

Clinical note + workflow request

Structured intention capture

Domain knowledge retrieval

Typed workflow generation

Deterministic graph validation

Workflow execution
    ├── agent tasks
    ├── deterministic tasks
    ├── retrieval tasks
    └── human-review tasks

Execution trace and evaluation

Two design decisions carry most of the weight.

Intention capture is split in two. Signal extraction and intention generation are separate stages rather than one prompt. Collapsing them is convenient and makes the failure mode invisible — you can't tell whether a bad result came from misreading the note or from misunderstanding the request.

The workflow is typed and validated before anything runs. Generation produces a graph, and a deterministic validation pass checks it before execution. The point is that an agent never improvises the plan mid-run: the plan is a checkable artefact first, and the agents execute bounded tasks inside it.

Human review is a first-class task type in that graph, not an escape hatch bolted on at the end. Uncertainty routes there by design.

Where the ideas come from

The design draws on work around intention-aware, knowledge-grounded workflow generation — Workflow Intention, Work Knowledge Graphs, Large Work Models, Workflow Graphs, and graph-based workflow optimisation.

What's next

The typed DAG executor is the immediate milestone. After that, the remaining case classes — incomplete notes, mixed requests, out-of-scope requests — need to move from scaffolded to passing, which is where the guardrail behaviour actually gets tested.

All systems nominal© 2026 Ramprasad Mondal