How to automate medication reconciliation with AI Agents
.png)
Medication reconciliation is one of the most error-prone processes in clinical care.
Up to 40% of medication errors happen during care transitions, and roughly 20% of those result in patient harm. So what does it look like to actually solve this with AI agents?
Medication reconciliation is the clinical process of creating an accurate list of all medications a patient is taking and comparing it against current orders at key care transitions (admission, transfer between units, discharge). The goal is to catch omissions, duplications, dose errors, and potential drug interactions. Doing this manually is time-consuming and error-prone, contributing to adverse drug events, readmissions, and clinician burnout.
Imagine the following scenario: a patient with diabetes, hypertension, and chronic kidney disease is admitted and has conflicting medication lists from two specialists, pharmacy records that don't match her EHR, and an over-the-counter NSAID she didn't mention that interacts with her other drugs. A pharmacist has to reconcile all of this under time pressure across multiple systems and phone calls. One missed step and the patient ends up on a dangerous combination. This is exactly the kind of multi-source, conditional reasoning problem that agents are built for.
How AI agents on Corti can tackle medication reconciliation
Corti's Agentic Framework provides healthcare developers with production-ready infrastructure to build AI agents for complex clinical workflows, such as medication reconciliation. Unlike general-purpose LLM tools, Corti agents are purpose-built for healthcare with orchestration, guardrails, auditability, and compliance baked in from the start.
Here's how to build a medication reconciliation agent using Corti:
1. Start with the Medication Reconciliation Agent template
Corti provides a pre-configured Medication Reconciliation Agent in its Agent Library that reviews medications against clinical records. This agent comes bundled with specialized Experts, modular AI components that handle specific tasks like searching drug databases, performing medical calculations, and retrieving clinical knowledge. You can deploy this agent as-is or customize it to your workflow.

2. Combine reasoning with domain expertise
The Corti framework uses a multi-agent architecture where an orchestrator coordinates specialized Experts. For a medication reconciliation workflow, you could configure your agent to leverage a whole host of experts, including:
- DrugBank Expert for comprehensive, up-to-date drug intelligence
- Medical Calculator Expert for reliable dose calculations
- Web Search Expert to pull the latest clinical guidance
- Custom Experts you build via Model Context Protocol (MCP) to connect your EHR, pharmacy systems, or proprietary data sources
Each Expert is a pre-configured agent with tightly scoped domain intelligence. The orchestrator ensures your agent retrieves accurate information from trusted sources rather than hallucinating, validates each action, and maintains full audit trails for every decision.
3. Define your workflow and context
Medication reconciliation involves collecting data from multiple sources (EHR medication lists, pharmacy records, patient interviews), normalizing drug terminology, comparing lists, identifying discrepancies, and producing a reconciled list. With Corti, you configure your agent's system prompt to define this workflow, then pass relevant patient context with each request, including structured FHIR medication resources, so the agent works with rich, domain-specific data at runtime.
Here's an example of what this looks like in practice, a reconciliation summary produced by the pre-configured Corti Medication Reconciliation Agent:
.png)
4. Deploy with built-in governance
Healthcare AI requires more than orchestration; it requires guardrails. Corti agents run under a central orchestrator that validates each action, enforces execution rules, and ensures agents cannot act outside their defined scope. The framework logs every decision and tool invocation with replayable traces and structured logs, giving you the transparency and auditability required for both safety and regulatory compliance. Where needed, agents can pause for human approval before proceeding.
5. Integrate and iterate
Use the Corti Console to authenticate via OAuth, create your agent, configure which Experts it should use, and send messages to test the workflow. The framework adheres to the Agent-to-Agent (A2A) specification for interoperability and supports MCP for connecting to any compatible system. Start with a prototype that handles one segment of medication reconciliation, then extend it into a robust production system.
The Corti SDK is available for Node.js and browser environments, with full API reference documentation at docs.corti.ai. Example integration:
import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
// Send patient context and medication data
const response = await client.agents.messageSend(agentId, {
message: {
role: "user",
parts: [{
kind: "text",
text: "Reconcile medications for this patient at admission"
}],
messageId: crypto.randomUUID(),
kind: "message"
}
});
Why build it this way?
An agentic system is ideal for medication reconciliation because the task involves variable inputs, conditional reasoning, multi-source data integration, and clinical judgment, not simple text generation. By encoding reasoning, tool usage, and workflow orchestration into governed agents, you get a reliable, scalable solution that helps providers deliver safer care with less administrative overhead, all while maintaining the control and compliance healthcare demands.
Check out the Medication Reconciliation pre-configured agent in action, working through complex cases.
Explore the Corti Agentic Framework, browse the Agent Library, and start building medication reconciliation agents that are production-ready from day one.

