Case study 04
Household Medicine Management Assistant
I built Open Family Medicine Cabinet, an open-source, privacy-first household medicine inventory and safety assistant.
The assistant helps a family understand what is already available at home, filter out expired items, distinguish adult and child suitability and recognize situations where self-care is not appropriate.
It is intentionally not an AI doctor. It does not diagnose, prescribe medication or recommend dosages. Its role is narrower and more operational: organize the household inventory, make relevant information easier to retrieve and preserve a clear safety boundary.
The problem
A home medicine cabinet often grows without a reliable system. Medicines are stored in different places, expiry dates are forgotten, similar products are confused and caregivers may not remember which items were intended for adults or children.
A generic AI assistant does not solve this safely. It may suggest products the household does not own, invent medical guidance or hide uncertainty behind a confident answer.
The system therefore needed to combine flexible natural-language input with deterministic inventory rules and explicit escalation.
What I built
The assistant works through Telegram and accepts text or voice descriptions. The workflow is:
- 1
User request
The family member describes a practical need in natural language.
- 2
Input structuring
The AI layer converts the request into structured symptom and category fields.
- 3
Household inventory lookup
The system reads the family-owned inventory from Google Sheets.
- 4
Deterministic matching
Rule-based fuzzy matching compares the structured request with active inventory items and known synonyms.
- 5
Safety filtering
Expired items are excluded, adult/child suitability is checked and doctor-only items receive a warning.
- 6
Red-flag check
Potentially urgent situations are escalated instead of being handled as a normal medicine search.
- 7
Clear response
The bot shows relevant inventory information and the limits of what it can safely do.
Google Sheets remains the source of truth, which makes the inventory understandable and editable without a separate administration interface.
Guardrails
Why AI does not make the decision
The AI component is used only to structure text or voice input. It does not choose a medicine.
The final matching is deterministic and based on the household inventory, explicit categories, active status, expiry date, suitability fields and predefined safety rules. This separation reduces the risk that a language model invents an item or turns a vague request into an unsupported medical recommendation.
When the system is uncertain, the correct behavior is to ask for clarification or escalate — not to guess.
Privacy and safety controls
The project was designed around a narrow data boundary:
- no central project database of medical conversations;
- no logging of sensitive symptom text;
- a user-controlled Google Sheet as the inventory source;
- secrets stored only in deployment environment variables;
- webhook validation for Telegram requests;
- expired medicines excluded from matching;
- explicit adult/child suitability fields;
- red-flag and doctor-only classifications;
- clear “no diagnosis, no prescription, no dosage” boundaries;
- visible errors when the inventory source is unavailable.
The serverless Telegram flow also avoids relying on local conversational state for critical choices. Inline callback data carries the necessary selection safely across requests.
Result
The assistant is deployed as a working Telegram bot and the project is available as an open-source repository.
The household inventory can be maintained through a familiar spreadsheet rather than a custom medical database. Text and voice requests are converted into structured searches, while deterministic rules remain responsible for inventory matching and safety filtering.
The project was also prepared for external review with an English README, MIT license, security policy, documented safety model, demo flows and roadmap. The verified test suite contained 43 passing tests at the grant-readiness stage.
The result is a practical household operations tool: useful enough for everyday medicine-cabinet management, but deliberately constrained so that convenience does not become unsafe medical authority.
My role
I defined the product boundary, designed the Telegram workflow and structured the inventory model. I separated language understanding from deterministic matching, added privacy and red-flag controls and prepared the project for open-source review.
This case applies the same thinking I use in financial automation: define the source of truth, limit what the automated layer is allowed to decide and make exceptions visible.
Stack
- Python
- FastAPI
- Telegram webhooks
- Google Sheets
- Voice/text NLU
- RapidFuzz
- Pydantic
- Vercel
- Automated tests
Proof
Open source under MIT, with the safety model written down as a document rather than implied by the code.
Safety model on GitHubKey lesson
In sensitive workflows, the best use of AI is often not to make the final decision. It is to reduce input friction while deterministic rules, user-owned data and clear escalation boundaries remain in control.