Triage Lab is an open-source interactive triage console for exploring clinical intake, structured prioritisation, and evaluation inside a simulated emergency-department workflow.
It combines a Next.js frontend with a Python OpenReward environment. A user can describe a case in free text, answer short follow-up questions, run test or manual batches, and inspect archived episode rollouts.
- It treats triage as a structured decision problem, not a generic chatbot interaction.
- It pairs a polished UI with a runnable evaluation environment and archived trajectories.
- It can be used as both a product prototype and an agent-evaluation sandbox.
- It is also published on OpenReward: openreward.ai/WMK-15/triage-lab
The OpenReward listing is the public footprint of the environment side of the project: a compact benchmark surface for testing how well agents classify and reason under triage-style constraints.
The app currently supports four workflows:
Chat triage: collect a free-text intake, ask follow-up questions, and produce a structured triage recommendation.Test batch: run a predefined evaluation batch against the Python harness.Manual single: enter one patient directly and run the backend on that case.Manual multi: enter multiple patients and evaluate them as a batch.
Results are rendered in three distinct regions:
Thinking: intermediate reasoning and tool activity.Decision: structured triage output with severity and progress.Evaluation: per-patient scoring and summary metrics when ground truth is available.
Past runs are stored under triage-nurse/runs/ and can be browsed in /episodes.
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS v4
- shadcn/ui
- Python 3.11
- OpenReward
app/
api/
triage/
assess/route.ts follow-up question and triage assessment API
intake/route.ts intake suggestion API
preview/route.ts batch preview API
run/route.ts launch a backend episode
tasks/route.ts list available evaluation tasks
episodes/[id]/route.ts episode payload API
episodes/ archived runs UI
page.tsx main triage console
components/
triage/ feature UI components
ui/ shadcn/ui primitives
dataset/ triage reference data and documentation
lib/
triage/
runtime.ts Next.js <-> Python bridge and dataset logic
types.ts shared app types
triage-nurse/
src/triage_nurse/ OpenReward environment and harness
tests/ backend tests
runs/ archived episode outputs
- The frontend collects intake text or manual patient data.
- The Next.js API layer matches the case against local reference datasets and/or builds a task spec.
- The runtime ensures the Python environment server is available.
- The harness runs an episode and writes rollout artifacts to
triage-nurse/runs/<episode_id>/. - The UI reads those artifacts back and renders thinking steps, decisions, and evaluation details.
- Node.js 20+
- npm
- Python 3.11
uv
npm install
npm run devOpen http://localhost:3000.
cd triage-nurse
uv venv --python 3.11
uv pip install -e ".[dev]"
cp .env.example .envAdd one provider key to triage-nurse/.env:
OPENAI_API_KEY, orANTHROPIC_API_KEY
The app can auto-start the environment server when needed. If you want to run the backend directly during development:
cd triage-nurse
uv run python -m triage_nurse.triage_envFrontend:
npm run dev
npm run build
npm run lintBackend:
cd triage-nurse
just install
just serve-env
just run-harness
just test
just lintEquivalent uv commands are also available in triage-nurse/README.md.
The repository includes several local dataset files under dataset/.
combined-triage-reference.csvemergency-triage-cleaned.csvsymptom-triage-reference.csvmimic-iv-ed-triage.csvmimic-iv-ed-diagnosis.csvmimic-iv-ed-edstays.csv
These files are used for intake matching, task construction, and evaluation support. See dataset/README.md for schema notes, quality caveats, and field descriptions.
Triage Lab is open source, and contributions are welcome.
If you want to help, issues and pull requests that improve the product, environment, evaluation flow, or documentation are all useful.
See CONTRIBUTING.md for setup, workflow, and PR guidance.
When contributing:
- Keep changes small and focused.
- Prefer minimal abstractions over speculative structure.
- Run the relevant frontend or backend checks before opening a PR.
- Avoid committing secrets or local
.envfiles.
This is an active experimental codebase. The interface is polished enough to explore, but the project is still evolving in a few important ways:
- the environment and scoring loop are still experimental
- dataset matching is heuristic rather than semantic retrieval
- some parts of the developer and contribution experience are still evolving
This project is licensed under the MIT License. See LICENSE.
Built by SerHackers.dev, engineers at Serac Group.