Inspiration

Pharmacies in Kenya, especially small independent ones, often lose money in two quiet ways: running out of critical stock without noticing, or letting medication sit on the shelf until it expires. Owners are usually too busy serving customers to check spreadsheets or manually audit inventory every day. I wanted to build something that watches this for them, automatically, and only speaks up when something actually needs attention.

What it does

The Pharmacy Restock & Expiry Agent checks a pharmacy's inventory every day. If any product is low on stock or nearing its expiry date, it sends the pharmacy owner a WhatsApp message summarizing exactly what needs attention. If nothing is wrong, it stays silent — no noise, no need to check a dashboard.

How we built it

The agent is built with the Strands Agents SDK, using Groq as the model provider through LiteLLM. It has two tools: check_stock_alerts, which queries a SQLite database for low-stock and near-expiry items, and send_whatsapp_alert, which sends a message via the Twilio WhatsApp API — but only when the agent decides there's something worth reporting. A Flask endpoint exposes the agent, deployed on PythonAnywhere, and a free cron job (cron-job.org) triggers it automatically every morning at 8am.

Challenges we ran into

Getting the environment stable was harder than expected on a constrained free-tier host — I hit a pydantic/litellm version incompatibility that caused the agent to crash with a cryptic "Message is not fully defined" error, traced back to a known pydantic 2.10+ regression. I also initially misconfigured the Twilio WhatsApp sender number, which silently failed message delivery until I properly joined Twilio's WhatsApp Sandbox and corrected the sender ID.

Accomplishments that we're proud of

This isn't just a hackathon demo — it's a live, working system already running daily for a real pharmacy business. It builds directly on top of an existing SaaS product I run for small pharmacies, so this agent adds real, immediate value rather than being a throwaway prototype.

What we learned

Small, focused agents that do one job well — check something, then act only when needed — are often more valuable in practice than broad, general-purpose assistants, especially for busy small business owners who don't have time to interact with a chatbot.

What's next for Pharmacy Restock & Expiry Agent

Expanding to support multiple pharmacies with different alert preferences, adding SMS as a fallback channel, and exploring AWS Bedrock/AgentCore as an alternative model backend.

Built With

Share this project:

Updates

Submission history