The Problem
In China, 267 million people are over 60 — the world's largest elderly population. Most live apart from adult children who have moved to cities for work. This is 空巢老人 — the empty-nest elderly — a documented national social crisis. In the US, 53 million adults are unpaid caregivers spending 24 hours per week on coordination. 1.6 million preventable medication errors occur in home care annually — most caused by communication failures between families, professional caregivers, and doctors who share no common system. The core failure is not effort. It is infrastructure.
What We Built
CareSync AI is a multi-role elderly care coordination platform connecting four types of users — Family Caregivers, Professional Caregivers, Doctors, and Administrators — around a single elderly patient in one AI-powered system. Live application: https://app-bp089v0zbu2p.appmedo.com Demo credentials:
- Family Caregiver: [email protected] / Demo1234!
- Professional Caregiver: [email protected] / Demo1234!
- Doctor: [email protected] / Demo1234!
- Admin: [email protected] / Demo1234! ## How We Structured Conversations with MeDo We built CareSync AI using a deliberate 7-prompt multi-turn strategy, each prompt building on the last: Prompt 1 — Database Architecture: We described all 12 Supabase tables with full foreign key relationships and row-level security policies. MeDo created the complete schema with SECURITY DEFINER helper functions that enforce care-team-scoped data access. Prompt 2 — Authentication & Role Routing: We specified the exact role-detection mechanism — query caregivers table after login, read the role column, redirect accordingly. MeDo built 4 completely distinct dashboard shells with correct color schemes per role. Prompts 3-5 — Role-Specific Dashboards: Each dashboard was built in isolation, then integrated. This allowed us to test each role independently before connecting the cross-role data flows. Prompt 6 — Admin + Polish: Split into 6A (admin dashboard with backend-secured user creation via Edge Function) and 6B (global polish pass — notifications, loading skeletons, empty states, mobile responsive). Prompt 7 — Seed Data: Complete demo dataset including patient Margaret Chen, care team, 4 medications, 3 visit logs with AI summaries, one unresolved interaction alert, and a doctor-approved care plan. ## The Most Impressive Feature MeDo Helped Create The Prescription Scanner Pipeline — the single most powerful moment in the entire application:
- Family member uploads a photo of a prescription bottle
- MeDo's native PaddleOCR reads the text from the image
- ERNIE (via MeDo's native LLM gateway) extracts structured JSON: drug name, dosage, frequency, prescribing doctor
- Form fields auto-populate — zero manual typing
- ERNIE checks the new drug against all of Margaret's existing medications
- If a high or critical interaction is found: an alert is created in the database AND a message is automatically sent to the doctor's dashboard
- The entire pipeline takes under 30 seconds This is not a chatbot wrapper. This is two Baidu AI tools working in sequence to solve a genuine patient safety problem. ## How We Used Plugins and API Integrations PaddleOCR (Baidu AI Studio): Used for prescription photo text extraction. Connected via MeDo's native plugin system — no external API key required. Text output feeds directly into the ERNIE processing step. ERNIE via MeDo Native LLM Gateway: Used at four structurally load-bearing points:
- Visit report generation (transforms caregiver observations into clinical summaries)
- Prescription data extraction (converts OCR text into structured JSON)
- Drug interaction analysis (checks new medications against patient history)
- Care plan generation (synthesizes 30 days of patient data into a structured clinical document) All ERNIE calls use MeDo's platform-managed gateway (INTEGRATIONS_API_KEY) — no external Baidu Qianfan credentials needed. Supabase (via MeDo): 12-table relational database with 36 RLS security policies. Row-level security restricts each user role to their patient assignment scope — a doctor can only query records where their caregiver ID appears in care_team_assignments. ## The AI-Powered Moments
- Clinical documentation at scale: ERNIE generates a structured visit summary in under 10 seconds from caregiver form inputs — replacing 45-90 minutes of manual writing per caregiver per day
- Prescription intelligence: PaddleOCR + ERNIE in sequence turns a phone photo into a populated medication form with interaction analysis — zero typing required
- Drug interaction detection: Every new medication is automatically checked against the patient's complete history. High/critical interactions trigger automatic doctor notification
- Care plan synthesis: ERNIE synthesizes patient profile, last 5 visit summaries, and current medications into a structured 30-day care plan with 5 sections ## Challenges We Faced Challenge 1 — ERNIE integration method: MeDo initially generated code calling Baidu's external Qianfan API directly, which required a separate API key unavailable in our region. We identified this and prompted MeDo to switch to its native LLM gateway instead, which uses platform-managed credentials. This surgical fix preserved all AI functionality. Challenge 2 — visit_type enum mismatch: The visit log form was submitting "home_visit" but the database enum only accepted "routine", "emergency", or "medical". We caught this during testing and applied a targeted fix to the VisitLogModal component without regenerating the entire dashboard. Challenge 3 — Cross-role notification filtering: The Edge Function filtering care team recipients by assigned_role was using the full enum value "family_caregiver" while the database stored the shortened value "family". We identified the mismatch and updated both the filter logic and the database records. ## Real-World Impact
- 90+ minutes of documentation time saved per professional caregiver per day
- Automated drug interaction detection on every new prescription
- 267 million elderly people in China + 53 million caregivers in the US represent the addressable market
- Architecture scales from single-family use to care agencies managing 50+ patients without modification ## What's Next
- Wearable device integration for automatic vitals sync
- Multi-language support using Baidu's translation capabilities
- Agency management tier for home care companies
- Predictive health alerts from vital trend analysis
Built With
- ernie-(baidu-ai-studio)
- medo
- node.js
- paddleocr-(baidu-ai-studio)
- react
- supabase
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.