Skip to main content
Get CareSupport operational and send your first coordinated care message in under 5 minutes.

Prerequisites

  • Python 3.9 or higher
  • API keys for OpenRouter (or Anthropic) and Linq
  • A phone number for testing

Quick Setup

1

Clone and install dependencies

git clone https://github.com/kanoliban/caresupport-original.git
cd caresupport-original
pip install openai anthropic python-dotenv
2

Configure environment variables

Create a .env file in the project root:
# AI Backend (OpenRouter recommended)
OPENROUTER_API_KEY=your_openrouter_key
ANTHROPIC_API_KEY=your_anthropic_key  # Optional: for direct Anthropic access

# Linq API (iMessage/SMS gateway)
LINQ_API_KEY=your_linq_api_key
LINQ_DEVICE_ID=your_device_id

# Project root
CARESUPPORT_ROOT=/path/to/caresupport-original
3

Test the SMS handler pipeline

Dry-run a message to verify everything works:
python runtime/scripts/sms_handler.py \
  --from "+16515551234" \
  --body "Can someone drive Mom to her appointment tomorrow at 2pm?" \
  --dry-run
You should see the full pipeline output including context loading, AI response, and enforcement checks.
4

Create your first family

Set up a test family directory:
mkdir -p fork/workspace/families/test-family/members
Create fork/workspace/families/test-family/routing.json:
{
  "family_id": "test-family",
  "members": {
    "+16515551234": {
      "name": "Test User",
      "role": "primary_caregiver",
      "access_level": "full"
    }
  }
}
Create fork/workspace/families/test-family/family.md:
# Test Family Care Coordination

## Current Schedule
No schedule entries yet.

## Current Medications
No medications tracked yet.

## Notes
First time setup - ready for coordination.
5

Send your first message

Process a real message (without —dry-run to actually send):
python runtime/scripts/sms_handler.py \
  --from "+16515551234" \
  --body "Hello CareSupport!"
The agent will:
  1. Resolve your phone number to the test family
  2. Load the family context
  3. Generate a personalized response
  4. Return the response (or send via Linq if configured)
6

Start the poller (optional)

For real-time message processing, run the poller in the background:
tmux new-session -d -s caresupport \
  "python3 runtime/scripts/poll_inbound.py --interval 15"
This checks for new messages every 15 seconds and processes them automatically.

Verify It’s Working

You’ve successfully set up CareSupport if:

✅ Dry-run succeeds

sms_handler.py —dry-run completes without errors

✅ Context loads

You see family.md content in the pipeline output

✅ AI responds

The agent generates a contextual response

✅ Enforcement runs

PHI audit logs and role filtering execute

Common Issues

Make sure the phone number in routing.json matches exactly (E.164 format with country code):
  • ✅ Correct: "+16515551234"
  • ❌ Wrong: "651-555-1234" or "6515551234"
Check that your .env file is in the project root and contains valid keys:
# Test OpenRouter connection
curl -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  https://openrouter.ai/api/v1/models
Set the absolute path in your .env file:
CARESUPPORT_ROOT=/full/path/to/caresupport-original
Or let runtime/config.py auto-detect it (works if .env is in project root).
Make sure you’re running commands from the project root and Python can find runtime modules:
cd /path/to/caresupport-original
python runtime/scripts/sms_handler.py --help

Next Steps

Configure your setup

Customize paths, AI backend, and Linq integration

Add your family

Set up a real family with members and care context

Explore protocols

Learn about the 16 care coordination protocols

Run tests

Verify system integrity with the test suite

Architecture Quick Reference

SMS/iMessage → Linq API → poll_inbound.py → sms_handler.py

                                    Phone resolution (routing.json)

                                    Context loading (family.md)

                                    Enforcement (role_filter + phi_audit)

                                    AI generation (Claude via OpenRouter)

                                    Family updates (family_editor)

                                    Response sent (Linq or stdout)
See How It Works for the complete 13-step pipeline.

Build docs developers (and LLMs) love