Last EHR: Open-source AI agent layer for Medplum and FHIR<br>The open-source AI agent layer for Medplum and FHIR<br>A permissioned AI agent over your patient chart. Bring your own FHIR backend and model key. It is a layer, not an EHR: it runs on top of Medplum and stores no patient data of its own.<br>GitHubView on GitHubLive demo
How it works<br>Last EHR is a thin, open-source layer over a FHIR backend you already control. Clone it, point it at your Medplum, and bring your own model key.
Runs on your FHIR backend
Point it at your own Medplum, hosted or self-hosted. Last EHR talks to it over FHIR and keeps no copy of your data.
Bring your own model key
OpenAI or Anthropic, your key and your spend. Switch models with a single environment variable.
Permissioned by your AccessPolicy
The agent runs as the signed-in user, scoped by Medplum's access controls. It can't see what you can't.
Self-host, Apache-2.0
Clone it and run it in minutes. Apache-2.0 licensed, and no account is required to get started.
New to the concept? Learn what a headless EHR is →
AI Agents<br>The agent reads the chart and, with your approval, writes to it. Add a note. Record an observation. Every write needs explicit confirmation before it is saved.<br>It runs as the signed-in user and is scoped by your Medplum AccessPolicy. It searches patients, opens a chart, and renders the results as cards. You can see every tool call it makes.<br>Writes are gated. The agent proposes a change, you approve it, and only then does it reach the chart. Nothing changes without a click.
A thin agent layer over your FHIR backend<br>Last EHR runs on top of your Medplum project and adds one thing: a chat agent with four FHIR tools. It searches patients, opens a chart (conditions, allergies, medications, observations, immunizations, notes), adds a free-text note, and records an observation. The two write tools are approval-gated: the agent proposes, an approval card shows exactly what will be saved, and nothing reaches the chart until you click Approve. Every call runs as the signed-in user, bounded by your Medplum AccessPolicy, and the layer stores no patient data of its own. The same four tools also run as an MCP server, read-only by default, for Claude Desktop, Claude Code, or any MCP client.<br>Read how approval-gated writes work, how the agent turns FHIR resources into chart context, and how to add the agent to your Medplum project. New to the architecture? Start with what a headless EHR is.
Self-host it, or join the hosted waitlist<br>Last EHR is free and open source under Apache-2.0. A managed tier with hosted Medplum and a signed BAA is in development. Leave your email to join the waitlist.
Notify me<br>The code is open source. Get it on GitHub.
GitHubGitHub@lastehr
© 2026 Last EHR. A personal open-source project, Apache-2.0, built in the open.