Skip to content

salimcodes/olumide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Olumide

An autonomous chronic disease management agent that lives in WhatsApp.

A 24/7 nurse for hypertensive and diabetic African patients. Multi-agent architecture (Orchestrator + Clinical Reasoning + Device + Family Circle + Doctor Liaison) running on top of OpenClaw, with optional Arduino home station and a clinician dashboard.

The full product spec is in docs/olumide_spec.md. The demo storyboard is Section 15 there.

Architecture (one paragraph)

WhatsApp message lands on the FastAPI webhook → MessageRouter resolves phone → patient → OpenCLAW orchestrator classifies severity (LLM) → selects an agent (Orchestrator persona for routine; Clinical Reasoning for anything clinical) → agent runs through the OpenClaw SDK with the Bamidele patient profile injected as ground truth → Clinical's strict-JSON actions[] get dispatched in parallel (asyncio.gather) to the device bridge, family-circle notifier, and clinician note writer.

Single-patient demo (Chief Bamidele Adeyemi, 62, hypertensive + T2DM). Multi-patient, encryption audit chains, voice transcription, MQTT, and real pharmacy/HMO integrations are scaffolded but not wired for the demo.

Quick start

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env  # fill in OpenClaw + Anthropic; add WhatsApp/ngrok for live webhook

Then in three terminals:

# T1 - the agent
.venv/bin/uvicorn app:app --reload --port 8000

# T2 - the fake Arduino bridge (renders device commands in color)
.venv/bin/python tests/fake_bridge.py

# T3 - open the demo console
xdg-open http://localhost:8000/sim          # WhatsApp-style chat
xdg-open http://localhost:8000/dashboard/   # Dr. Chuks's view

/sim shows three panels: Chief Bamidele's chat (left), Funmi's family alerts (right), and the live multi-agent log (bottom). Type a message (or use the quick buttons), and watch the system fire agent calls, device commands, family notifications, and clinician notes in parallel.

For the live WhatsApp path, keep the FastAPI app on port 8000 and run:

scripts/start_whatsapp_tunnel.sh

Use the printed https://.../webhook URL as the Meta WhatsApp callback URL with verify token olumide_verify.

Endpoints

Path Purpose
GET /health health probe
GET /sim WhatsApp-style demo console
POST /sim/message send a message as Bamidele, get the agent reply + trace
POST /sim/reset wipe clinician notes + circle log between takes
GET /dashboard/ Dr. Chuks's live clinician dashboard
GET /webhook WhatsApp Cloud API verification
POST /webhook WhatsApp Cloud API messages (production path)
POST /webhook/device Arduino bridge events (RFID taps, button presses)

Demo scenario (~4 min)

  1. Morning routine — "Good morning Olumide" → warm reply addressing him as "sir."
  2. Vitals report — "BP 138/86, fasting glucose 122" → interpretation referencing the 14-day trend.
  3. Symptom triage — "I'm feeling small dizzy and shaky" then "glucose 68" → Tier 3 hypoglycemia. Within seconds, in parallel:
    • Sim chat replies with mild_hypo_protocol (3-4 glucose tablets / OJ / biscuits).
    • Fake bridge prints CMD: ESCALATE with red LED + alert buzzer + LCD lines LOW SUGAR / TAKE SUGAR NOW.
    • Funmi's WhatsApp panel gets a Tier 3 alert.
    • Dashboard gains a same-day clinician note draft for Dr. Chuks.
  4. Multi-agent log reveal — bottom panel of /sim shows the full trace: severity → agent → tier → actions dispatched → reasoning. Project this for Scene 4.
  5. Commercial close — slides only.

Repo layout

app.py                          FastAPI entrypoint, webhooks, /sim
config/patient_bamidele.yaml    single-patient profile (ground truth)
docs/olumide_spec.md            full product spec
dashboard/index.html            Dr. Chuks dashboard (polls JSON)
static/sim.html                 WhatsApp-style demo console
tests/fake_bridge.py            Arduino simulator + REPL on :8765
olumide/
  agents/
    base.py                     OpenClaw _llm_call wrapper (existing)
    primary_care.py             Orchestrator persona (warm, patient-facing)
    clinical_reasoning.py       Strict-JSON tier + actions emitter
    profile_loader.py           YAML -> system prompt injection
    prompts/
      orchestrator.md
      clinical.md
  orchestrator/openclaw.py      severity classification + agent select +
                                parallel action dispatch
  tools/
    device.py                   reminder / escalate / lcd / log_dose
    clinician.py                draft_clinician_note -> dashboard JSON
    circle.py                   notify_circle_member with consent scope
  integrations/device_bridge.py async httpx client to Arduino bridge
  context/store.py              encrypted SQLite patient store (existing)
  ingestion/router.py           phone -> patient + media handling (existing)
  seed.py                       upsert Bamidele from YAML at startup

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors