Inspiration
PharmacyGuard was inspired by a simple observation: safe prescription review requires connecting multiple pieces of clinical information at the same time.
For a pharmacist, reviewing a prescription can involve checking whether the medication matches the patient's diagnosis, whether the patient has an allergy to it, whether it interacts with another medication, whether the prescribed dosage is appropriate, whether the medication is duplicated, and whether it is actually available in the pharmacy.
As a pharmacy student, this is also a challenge in learning. Pharmacy education requires students to develop clinical reasoning rather than simply memorize medications. We wanted to explore whether an AI agent could help students practice that reasoning while also giving practicing pharmacists a useful second pair of eyes.
This led to the idea for PharmacyGuard: an AI clinical verification agent designed to work with pharmacists and pharmacy students, rather than replace them.
The principle behind the project is simple:
AI should assist the clinical decision, not make the clinical decision.
The pharmacist remains responsible for the final decision, while the agent gathers evidence, performs verification checks, identifies potential issues, and explains its findings.
What it does
PharmacyGuard is an AI clinical verification agent for pharmacists and pharmacy students.
Given a prescription and the relevant patient and pharmacy information, the agent can coordinate multiple verification tools to check:
- Diagnosis–medication compatibility
- Patient allergies
- Medication interactions
- Duplicate medications
- Dosage
- Medication availability
- Pharmacy inventory and stock levels
Instead of requiring a human to perform each check independently, the agent orchestrates the available tools and brings their findings together into a structured clinical review.
For example, if a medication is prescribed, PharmacyGuard can check the diagnosis, look for relevant allergies, identify potential interactions with existing medications, check for duplicate therapy, evaluate the dosage, and determine whether the medication is available in the pharmacy.
The result is presented as a clinical verification review, giving the human a clearer picture of potential issues before they make their decision.
For pharmacy students, the same workflow can serve as a learning environment for understanding how different clinical factors come together during prescription verification.
For pharmacists, it functions as a second pair of eyes that can help reduce the cognitive burden of checking multiple factors.
PharmacyGuard is designed around a human-in-the-loop model. The agent does not independently approve prescriptions, authorize dispensing, or replace the pharmacist's professional judgment.
How we built it
PharmacyGuard uses a React 19 + TypeScript + Vite + Tailwind CSS frontend with a Python backend and SQLite-based clinical and pharmacy knowledge bases.
The AI agent is built using the Strands Agent SDK and runs through Amazon Bedrock, using Anthropic's Claude model.
Rather than relying on the language model to generate clinical facts from its own knowledge, we created dedicated verification tools backed by structured data.
The core clinical verification tools include:
allergy_checkdiagnosis_medication_checkduplicate_medication_checkmedication_interaction_checkdosage_check
The agent also interacts with pharmacy inventory information to determine medication availability and stock status.
The architecture separates evidence retrieval from AI reasoning. The tools retrieve structured information from the SQLite knowledge bases, and the AI agent reasons over those results to produce a structured review.
This approach allows the model to act as an orchestrator and reasoning layer while keeping important clinical information grounded in controlled data.
The project is also designed with the Ghanaian healthcare environment in mind, with the longer-term goal of connecting PharmacyGuard with relevant healthcare systems and Ghana Health Service platforms.
The current prototype uses synthetic/demo data rather than live patient records or production healthcare integrations.
Challenges we ran into
One of the biggest challenges was getting the Amazon Bedrock environment configured correctly. We initially encountered connectivity and model-access issues, including a ResourceNotFoundException when attempting to use the Anthropic model. Working through AWS configuration and the required Anthropic model access process was a significant part of getting the agent operational.
Another challenge was designing the agent so that it demonstrated genuine agentic behavior without allowing the language model to simply invent clinical conclusions.
We had to carefully define what each tool was responsible for, what information it could retrieve, and how the agent would use those results. This led us toward a tool-based architecture where important verification results come from structured knowledge bases rather than being generated entirely by the model.
Healthcare also introduced a different kind of challenge: deciding where the AI's responsibility should end.
It would have been easy to build a system that simply says "safe" or "unsafe." We deliberately avoided that approach because clinical decisions require professional judgment and context that an AI system should not independently assume.
Instead, PharmacyGuard is designed to surface evidence and potential concerns while keeping the pharmacist or student in control.
Accomplishments that we're proud of
We are proud that PharmacyGuard evolved beyond a traditional chatbot into a tool-using AI agent capable of orchestrating a multi-step clinical verification workflow.
The agent can coordinate several specialized verification tools and combine their results into a structured review instead of requiring the user to manually perform every check.
We are particularly proud of the human-in-the-loop architecture. PharmacyGuard demonstrates that an AI agent can take on meaningful work in a healthcare workflow while still keeping the human professional at the center of the decision.
We are also proud of building the system around evidence retrieval rather than allowing the model to independently fabricate clinical information.
Another accomplishment is creating something that has value for two different groups: pharmacists who need assistance with prescription verification and pharmacy students who need opportunities to develop clinical reasoning.
Getting the full agent workflow running with Strands and Amazon Bedrock was also an important milestone, especially after working through the AWS and model-access challenges.
What we learned
The biggest lesson we learned is that building an AI agent is about much more than connecting an LLM to a chat interface.
The real engineering challenge is designing the relationship between the model, tools, data, and human.
We learned that deterministic tools are especially important in a clinical application. The AI can reason over evidence, explain findings, and coordinate a workflow, but critical information should come from controlled and verifiable sources wherever possible.
We also learned that human-in-the-loop design needs to be part of the architecture rather than simply a statement in the user interface.
Most importantly, we learned that the strongest use of AI in a professional environment may not be replacing the expert. It can be augmenting the expert by handling information-heavy tasks while leaving judgment and accountability with the human.
What's next for PharmacyGuard
The current version is a working prototype demonstrating the core AI-powered clinical verification workflow using synthetic/demo data.
Our next goal is to move toward real-world healthcare integration, including potential EHR, HL7, and FHIR interoperability and connections with relevant Ghanaian healthcare systems.
We also want to expand the pharmacy student experience so that PharmacyGuard can become more than a prescription checker. It could become an interactive clinical reasoning environment where students can work through cases, understand why a medication may be appropriate or problematic, and learn how different clinical factors influence a prescription review.
For pharmacists, we want to improve the agent's ability to support more complex medication reviews and provide clearer evidence-backed explanations.
The long-term vision is to build PharmacyGuard into an intelligent clinical assistant that helps pharmacists work more efficiently and helps pharmacy students develop stronger clinical reasoning skills.
The goal remains the same:
Build AI that works alongside healthcare professionals, making them better informed and better supported without taking the human out of the decision.
Built With
- agent
- agents
- amazon
- amazon-web-services
- anthropic
- bedrock
- claude
- css
- decision
- fastapi
- generative
- healthcare
- human-in-the-loop
- learning
- machine
- python
- react
- sdk
- sqlite
- strands
- support
- tailwind
- technology
- typescript
- vite
Log in or sign up for Devpost to join the conversation.