Back to projects

Case study / 09

PillSense

Medication support that stays honest about what happened and what did not.

PillSense connects a mobile medication companion, a browser-controlled physical dispenser, computer-vision observations, and caregiver-facing agent investigations. Its core boundary is deliberate: device movement, camera activity, and patient confirmation are different forms of evidence. The prototype supports a synthetic medication workflow; it does not provide medical advice or infer ingestion.

  • Next.js
  • React
  • TypeScript
  • Convex
  • Clerk
  • Arduino UNO R4 WiFi
  • Web Bluetooth
  • Python
  • OpenCV
  • MediaPipe
  • Anthropic Claude
  • Cartesia
  • Fetch.ai uAgents
  • Agentverse
  • ASI:One ACP
BLE dispenserVoice + visionHuman-reviewed agents

Condensed product demo · synthetic medication workflow · no clinical claims

Evidence, not inference

Movement and observation remain distinct from a patient report.

Human stays in control

Dispensing, case resolution, and refill follow-up require explicit action.

Bounded investigation

The coordinator receives scoped tools, a call budget, and validated outputs.

Uncertainty stays visible

Unknown outcomes are reconciled instead of silently retried or guessed.

One workflow, explicit boundaries

Patient experienceSchedule, scan, voice
Convex stateReminders, cases, evidence
Physical deviceAuthorized BLE movement
Care coordinatorCase-scoped evidence tools
Caregiver reviewAcknowledge and follow up

Engineering decisions

DecisionWhyTradeoff
Keep every evidence source semantically separate.Motor completion, a hand-near-mouth gesture, and a patient report describe different events.The UI and data model carry more states instead of presenting one convenient adherence status.
Require explicit human authorization around consequential actions.The prototype should not silently dispense, change instructions, retry an uncertain command, or resolve a care case.The workflow adds confirmation and review steps before physical or caregiver actions.
Bound the care coordinator to case-scoped read-only tools.Agent investigations need inspectable evidence, a five-call budget, case-version validation, and server-side result checks.The agent cannot freely browse patient data or mutate medication, inventory, or device state.

Under the hood

Device / Observation

  • Arduino Uno R4 WiFi and stepper-driven carousel
  • Web Bluetooth command and result reconciliation
  • OpenCV + MediaPipe observations remain non-clinical evidence

Product / State

  • Next.js 16 and React 19 patient/caregiver surfaces
  • Convex reminder lifecycle, cases, inventory, and audit state
  • Clerk identity with role-scoped access

Voice / Agents

  • Cartesia conversational medication companion
  • Claude Vision reviewed label extraction
  • Claude coordinator plus Fetch.ai AgentChatProtocol transport

The evidence model

Every signal says something useful. None is allowed to say more than it observed.

SignalWhat it meansWhat it does not mean
Motor DONEThe commanded step sequence completedDose taken
Gesture observedThe configured motion appeared near the cameraMedication ingested
Patient TAKEN reportThe patient explicitly reported completionIndependent physical verification
Agent findingScoped evidence supports caregiver follow-upPermission to dispense or change instructions

System checks

  • Motor completion never marks a dose as taken.
  • Only an explicit patient report resolves ingestion state.
  • Agent tools are case-scoped, read-only, and capped at five calls.
  • Uncertain device commands are reconciled without automatic retries.
Inspect coordinator tests

Next

Add release and position sensing, improve observation reliability, host the coordinator for unattended availability, and validate the experience with real accessibility research before any clinical use.