REST API β base URL: https://greendial.org Β· All endpoints return JSON unless noted.
GreenDial is a personal health platform powered by Doc, a primary AI coordinator, and a team of specialist health agents. Doc guides conversations, builds the user's health profile, and routes domain-specific questions to the right agent. When a message matches two or more agent domains, Cross AI synthesizes perspectives from multiple specialists in parallel.
Agents also run on a server-side cron schedule (08:00 UTC daily), generating personalized check-in notifications for subscribed users. Each agent has its own dedicated chat tab in the UI, with a profile-building onboarding interview on first activation.
Authentication is username + passphrase for the app; HTTP Basic Auth for third-party integrations.
| ID | Name | Domain |
|---|---|---|
| diet | π₯ Diet | Nutrition, eating habits, weight management, hydration |
| exercise | πͺ Exercise | Fitness, movement, workouts, injury prevention |
| protect | π‘οΈ Protect AI | Immune resilience + disease prevention, screenings, risk factors |
| sleep | π΄ Sleep | Sleep quality, insomnia, circadian rhythm, sleep hygiene |
| mental_health | π§ Mind | Stress, anxiety, depression, mindfulness, resilience |
| relationships | π Relationships | Social connection, communication, loneliness, caregiving |
| environment | π Environment | Air quality, ergonomics, home/workplace health, nature |
| custom | βοΈ Custom | User-defined system prompt β any health topic |
| cross_ai | π Cross AI | Multi-domain synthesis β activated when 2+ domains match |
1. Via Doc (chat-triggered) β Doc checks keyword lists and emits **CALL_AGENT**. Single-domain β specialist. Two or more domains β Cross AI runs matched agents in parallel threads and synthesizes.
2. Via agent direct chat β Users open an agent's tab; the server routes to POST /chat/agent/{agent_id}. Each agent maintains its own transcript separate from Doc.
3. Via crontab (scheduled) β agent_runner.py at 08:00 UTC daily. Per-user, per-agent, 20-hour debounce. Results land in the notification bell.
| Field | Type | Description |
|---|---|---|
| username | string | Required |
| password | string | Required (passphrase) |
| create_new | bool | Set true to register |
| hipaa_waiver_accepted | bool | Required when registering |
| profile | object | Optional initial profile on signup |
user_id to persist profile updates.
| Field | Type | Description |
|---|---|---|
| text | string | User's message |
| user_id | string | Optional β links to saved profile |
| session_id | string | Optional β pass back to continue session |
"init": true (or empty text) to trigger the agent's welcome message and begin onboarding.
| Field | Type | Description |
|---|---|---|
| text | string | User's message. Empty or omitted β triggers intro. |
| user_id | string | Optional β for profile persistence |
| session_id | string | Optional session token |
| init | bool | Set true to request welcome message without saving a user turn |
username, settings, profile. Nested objects are merged.
| Field | Description |
|---|---|
| primary_concern | Main health focus |
| health_conditions | Diagnoses, chronic conditions |
| medications | Current medications and supplements |
| allergies | Drug or food allergies |
| age | Age |
| weight | Weight |
| height | Height |
| location | City / region |
| diet_type | Diet style (e.g. keto, vegan, Mediterranean) |
| exercise_frequency | How often they exercise |
| exercise_type | Type of exercise |
| sleep_hours | Average nightly sleep |
| sleep_quality | Self-rated sleep quality |
| stress_level | Self-rated stress level |
| goals | Health goals |
| avatar | Emoji string or base64 data URL for profile picture |
| notes | Free-form notes |
Written by agents during onboarding and chat. Merged into the same profile object.
| Field | Agent |
|---|---|
| diet_type, dietary_restrictions, nutrition_goals, food_allergies | π₯ Diet |
| fitness_goals, fitness_level, exercise_limitations, preferred_workout_time | πͺ Exercise |
| immune_concerns, supplements, autoimmune_conditions, family_history, smoking_status, last_checkup, screenings_due | π‘οΈ Protect AI |
| sleep_issues, bedtime, wake_time, sleep_aids, sleep_disorders | π΄ Sleep |
| mental_health_concerns, therapy_status, coping_strategies, mindfulness_practice | π§ Mind |
| relationship_status, social_support, loneliness_level, relationship_goals | π Relationships |
| living_environment, environmental_concerns, workplace_setup, climate_region | π Environment |
| Field | Values | Description |
|---|---|---|
| doc_style | questioning Β· professional Β· friendly | Doc's conversational tone |
| notifications_enabled | true Β· false | All notifications on/off |
| agent_subscriptions | array of agent IDs | Which agents send periodic check-ins and get chat tabs |
| agent_prefs | object | Per-agent preference overrides, e.g. {"sleep": {"goal_hours": 8}} |
| custom_agent_prompt | string (max 2000) | System prompt for the Custom agent |
Manage agent subscriptions. Subscribed agents generate daily notifications via cron and appear as chat tabs in the UI. First activation triggers a 3-turn onboarding interview that fills domain-specific profile fields.
immunity, disease_prevention) are transparently migrated to protect.
| Field | Type | Description |
|---|---|---|
| subscriptions | string[] | Agent IDs. Unrecognized IDs silently dropped. |
| agent_prefs | object | Per-agent preferences (merged with existing) |
| custom_agent_prompt | string | System prompt for the Custom agent (max 2000 chars) |
agent_runner.py β 08:00 UTC daily, 20-hour debounce per user per agent.
Logs to /var/log/greendial_agents.log. Manual run:python3 agent_runner.py --agent protect --user user_alice --dry-run
Use Authorization: Basic <base64(username:passphrase)> for machine-to-machine profile sync.
Machine-readable specs for tooling, code generation, and AI agents that interact with this API.
| File | URL | Format |
|---|---|---|
| OpenAPI 3.1 | /spec/openapi.yaml | Full endpoint schemas, request/response models |
| Arazzo 1.0 | /spec/arazzo.yaml | Workflow descriptions: chat dispatch, cron notifications, onboarding, profile updates |
Doc is the primary coordinator. Its prompt is assembled dynamically each turn from profile state, conversation stage, and optional agent context.
**PROFILE_UPDATE** {"field": "value"} β persists health data**CALL_AGENT** {"agent": "sleep"} β triggers a specialist sub-call
All agents (Doc and specialists) detect message length and tone from each user turn and inject a style-matching instruction. Very short messages get terse replies; detailed messages get thorough ones. Casual phrasing gets casual responses.
GreenDial is open source. Questions? mickeyshaughnessy@gmail.com