Inspiration
Hospitals manage thousands of medicine batches across pharmacies, ICUs, emergency departments, operating rooms, and other departments. When inventory is not used before its expiry date, the hospital can lose money and usable medical resources are wasted.
The problem is not simply knowing that a medicine is going to expire. The harder question is:
"What should we do about it right now?"
We wanted to build an AI system that could move beyond passive alerts and help hospital teams investigate inventory risk, understand demand, and decide on the next best action.
That idea became PharmaTech.
What it does
PharmaTech is an agentic AI inventory operations platform designed to help hospitals reduce medicine-expiry waste.
Its AI agent, PharmaPilot, can:
- Analyze medicine inventory and expiry dates
- Identify high-risk batches
- Estimate expected demand
- Calculate inventory value at risk
- Prioritize which medicines require attention
- Investigate possible redistribution opportunities
- Generate actionable recommendations
- Explain the reasoning behind recommendations
- Request human approval before an operational action
- Maintain an execution trace showing the agent's workflow
Instead of simply saying:
"Medicine X expires soon."
PharmaTech aims to answer:
"Medicine X is at high risk because of its expiry date and expected consumption. Here is the recommended action and why."
How we built it
PharmaTech uses a Gemini-powered agentic workflow together with specialized tools for inventory analysis, demand estimation, risk assessment, and action planning.
The workflow follows:
Observe → Reason → Use tools → Analyze results → Plan → Request approval → Record outcome
Gemini is used for agentic reasoning and tool selection, while deterministic tools handle structured calculations and inventory analysis.
The application provides a web dashboard where users can upload inventory data, review identified risks, inspect the agent execution trace, and review recommended actions.
The demonstration uses synthetic hospital inventory data rather than real patient or hospital data.
Challenges we ran into
Our biggest challenge was making the system genuinely agentic rather than simply putting a chatbot on top of an inventory dashboard.
We wanted the AI to interact with tools, use the information returned by those tools, reason about the situation, and produce an actionable plan.
We also had to balance autonomy with safety.
Because this concept deals with hospital operations, we designed human approval as a guardrail. The agent can analyze and recommend actions, but sensitive operational actions should remain under human control.
Another challenge was making the agent's behavior understandable. We therefore created an execution trace so users can see the workflow instead of receiving an unexplained final answer.
Accomplishments that we're proud of
We are proud that PharmaTech demonstrates an end-to-end agentic workflow rather than a simple AI chatbot.
The prototype can move from raw inventory information through:
Detection → Investigation → Risk Assessment → Planning → Recommendation → Human Approval
We are particularly proud of the visible agent execution trace because it makes the AI's workflow easier to understand and evaluate.
We also designed the architecture with future hospital integrations in mind.
What we learned
We learned that building an effective AI agent is not only about choosing a powerful model.
The surrounding system matters just as much:
- What should the agent observe?
- Which tools should it have?
- What information should each tool provide?
- When should the agent ask for human approval?
- Which calculations should remain deterministic?
- How can users understand and trust the agent's recommendations?
We learned that the strongest agentic systems combine model reasoning with reliable tools and clear human oversight.
What's next for PharmaTech
Our next goal is to move from a prototype toward a production-ready hospital inventory operations platform.
Future versions could integrate with existing hospital inventory systems, barcode scanners, pharmacy workflows, real consumption data, and procurement systems.
We also want PharmaTech to continuously monitor inventory, learn demand patterns, detect unusual stock behavior, recommend inter-department transfers, and assist with purchasing decisions.
Our long-term vision is simple:
Don't wait for medicines to expire. Let an intelligent agent help hospitals act before the waste happens.
Built With
- agentic
- agents
- cloud
- gemini
- generative
- healthcare
- learning
- next.js
- typescript
Log in or sign up for Devpost to join the conversation.