EpicGym01

The health record
as an RL environment.

EpicGym is a local recreation of the Epic EHR interface. Agents open charts, review allergies, sign orders and write notes for synthetic patients. A grader scores the workflow completed; those scores are the reward signal for RL and evaluation.

Synthetic data02

No real patients.
No real records.

Charts are JSON fixtures, validated on load and versioned in the repository. Layouts follow reference charts observed read-only under authorisation. Identities, contact details and clinical content are independently synthetic.

Schema v1 for one chart, v2 for a cohort of up to 200
A seed fixes every generated ID; reset and replay are exact
Server binds 127.0.0.1; no credentials, no external services
Interface03

Ten activities,
recreated at
1345 × 768.

Patient Lookup, Patient Lists, Chart Review, Problem List, Allergies, Orders, Notes, History, Immunisations, Demographics. Seven chart-review tabs, a resizeable split, one chart tab per patient, facet filters, and order signing that blocks until the allergy list is reviewed.

EpicGym Training environmentSynthetic chart · session default · seed 42 Dr Sim CLINICIAN · SIM Hospital
Alex MORGAN
Patient Lists
Patient Lookup
Mx. Alex MORGAN
Female, 34 y.o., 12/03/1992
MRN: SIM-10002

ALLERGIES
Penicillin · Latex
PROBLEM LIST
Asthma
Iron-deficiency anaemia
Migraine
CARE TEAM
Dr Sim CLINICIAN
Chart Review
Problem List
Allergies
Orders
Notes
History
Immunisations
Demographics
Encounters
Notes
Labs
Imaging
Meds
Synopsis
Investigations
FiltersProgress NotesLettersConsults12 notes
DateSummaryAuthor
02/09/2026Progress Notes · Asthma reviewDr S CLINICIAN
14/07/2026Progress Notes · Follow-upDr S CLINICIAN
03/06/2026Letter · Respiratory clinicDr R KHAN
21/04/2026Progress Notes · AnaemiaDr S CLINICIAN
09/02/2026ED Provider NotesDr M ORTIZ
18/11/2025Progress Notes · MigraineDr S CLINICIAN
30/09/2025Discharge SummaryDr M ORTIZ
12/08/2025Progress Notes · Annual reviewDr S CLINICIAN
Progress Notes · 02/09/2026
Signed · Dr Sim CLINICIAN · Respiratory Medicine
History
Reviewed for asthma. Reports two night-time wakings per week since July. Using salbutamol most days. No admissions. Non-smoker.

Examination
Chest clear. Peak flow 380 L/min (predicted 440).

Assessment
Suboptimal asthma control on current step.

Plan
Step up inhaled corticosteroid. Full blood count and Urea and electrolytes. Review in 6 weeks.
Summary
Encounter
Office Visit
Department
Respiratory
Status
Signed
Linked orders
FBC · U&E
EpicGym Alex MORGANseed 42
Mx. Alex MORGAN
34 y.o.
SIM-10002
ALLERGIES
Penicillin
Chart Review Orders Notes
02/09 Asthma
14/07 Follow-up
03/06 Letter
21/04 Anaemia
Progress Notes
Two night-time wakings per week. Chest clear. Step up ICS; FBC and U&E.
Viewport1345 × 768
Header / sidebar65px / 161px
Activity / chart tabs44px / 23px
Canvas / panels#111111 / #28292e
Chart ReviewNotesOrders & signingProblem ListAllergiesMedicationsLabsImagingInvestigationsEncountersHistoryImmunisationsDemographicsSynopsisPatient ListsPatient Lookup
Loop04

Reset.
Step.
Reward.

Observations are the chart as JSON. Actions are the semantic operations a clinician performs. env.browser_url opens the exact session the agent is driving.

examples/complete_task.py gymnasium
import json from epicgym import EpicGymEnv env = EpicGymEnv(scenario_id="order-labs") obs, info = env.reset(seed=42) print(env.browser_url) # open it to watch this session obs, reward, done, trunc, info = env.step( json.dumps({"type": "review", "section": "allergies"}) ) chart = json.loads(obs) trajectory = env.trajectory() env.close()
BrowserHTTPIn-processOne transition engine behind all three
The reward Δ completed goals,
0.001 per action,
+1 on completion

Undone progress returns its reward. A repeated action earns nothing. A malformed action costs 0.05 and consumes a step. Goals check workflow mechanics, not clinical judgement.

Scenarios05

Five scenarios
ship. Datasets
define their own.

The clinic-cohort fixture holds two patients with the same name; its identify-patient task requires finding the correct one, reading its note, reviewing its allergies and returning to the original tab. Checks are scoped to patient IDs, so work in the wrong chart does not count.

01sandboxUnscored exploration of the loaded chart
02chart-reviewRead the historical note; review allergies, problems and medications
03order-labsReview allergies; sign routine Full blood count and Urea and electrolytes orders
04document-visitReview problems; add Cough; sign a substantive History / Assessment / Plan note
05reconcileReview allergies; enter a patient-reported medication; complete medication review
Adapters06
Semantic

JSON in,
JSON out.

Review a section, sign an order, save a note. Actions are typed and registered with unique ownership. /step is the strict interface; /attempt records a rejected action, charges 0.05 and consumes a step.

{"type": "review", "section": "allergies"} {"type": "sign-orders"} {"type": "save-note", "template": "progress"}
Computer use

Pixels in,
clicks out.

A separate Chromium instance. Observations are a (768, 1345, 3) uint8 array plus the task prompt. Five action kinds; every pointer action is charged.

obs["pixels"] # uint8 (768, 1345, 3) kind: 0 wait 1 click 2 type 3 key 4 scroll {"kind": 1, "x": 433, "y": 93}

Node 22.12.
Python 3.10.
One machine.

npm ci && npm run dev, then open 127.0.0.1:5173. F8 opens the training console. Every mutation stays in the local simulation; no Epic credentials and no external EHR services.

or email chaiyihein@gmail.com

See the loop