Skip to main content
CareSupport is a Python-based care coordination system that communicates via SMS/iMessage. This guide covers complete installation and dependency setup.

System Requirements

  • Python: 3.9 or higher
  • Operating System: Linux, macOS, or Windows (WSL recommended)
  • Terminal: Bash-compatible shell for running scripts
  • Network: Outbound HTTPS access for API calls

Python Dependencies

CareSupport uses a minimal set of production-grade Python libraries:
pip install openai anthropic python-dotenv

Core Dependencies

PackagePurposeVersion
openaiOpenRouter API clientLatest
anthropicDirect Anthropic API accessLatest
python-dotenvEnvironment variable managementLatest
The openai package is used for OpenRouter API access (not OpenAI directly). CareSupport routes through OpenRouter to access Claude Haiku and other models.

API Keys and Accounts

CareSupport requires three types of API credentials:

1. AI Provider (Required)

Choose one of the following:

2. Linq API (Required for iMessage/SMS)

Linq provides the messaging infrastructure for iMessage-first communication.
1

Create Linq Account

Sign up at linqapp.com and request a Partner API account.
2

Provision a Linq Blue Line

Get a dedicated phone number for CareSupport. This will be your primary messaging number.
3

Generate API Token

In the Linq dashboard:
  • Click the code icon (</>) in the left toolbar
  • Generate a new API token
  • Copy the token (you won’t see it again)
4

Add to Environment

Add these credentials to your .env file:
LINQ_API_TOKEN=your_linq_api_token_here
LINQ_PHONE=+1XXXXXXXXXX
Linq Partner API is different from the consumer app. Ensure you have a Partner account with API access.

3. Webhook Secret (Optional, for Real-Time)

If you want real-time message delivery instead of polling:
# Generate webhook subscription (returns signing secret)
python runtime/scripts/linq_gateway.py webhooks

# Add secret to .env
LINQ_WEBHOOK_SECRET=your_webhook_signing_secret
See Linq Integration for webhook configuration details.

Environment Configuration

Create a .env file in your project root:
.env
# ─── AI Provider ────────────────────────────────────
# Choose one: openrouter or anthropic
OPENROUTER_API_KEY=sk-or-v1-...
# ANTHROPIC_API_KEY=sk-ant-...
CARESUPPORT_AI_BACKEND=openrouter

# ─── Linq Messaging ─────────────────────────────────
LINQ_API_TOKEN=your_linq_token_here
LINQ_PHONE=+1XXXXXXXXXX
LINQ_WEBHOOK_SECRET=your_webhook_secret

# ─── Optional Settings ──────────────────────────────
# Data directory (defaults to /work)
CARESUPPORT_ROOT=/work

Security Best Practices

Critical: Never commit your .env file to version control.
Add to .gitignore:
.gitignore
.env
*.env
.env.*
runtime/scripts/linq_config.json

Verify Installation

Test each component:
python -c "import openai, anthropic, dotenv; print('✓ All packages installed')"
Expected outputs:
  • Python test: ✓ All packages installed
  • Linq test: List of phone numbers with status
  • AI test: JSON response with reply_text field

Directory Structure

After installation, your directory structure should look like:
caresupport/
├── .env                          # Your environment variables (not in git)
├── SOUL.md                       # Agent identity and voice
├── runtime/
│   ├── config.py                 # Central configuration
│   ├── scripts/
│   │   ├── sms_handler.py        # Core message processor
│   │   ├── linq_gateway.py       # Linq API client
│   │   ├── poll_inbound.py       # Message polling loop
│   │   └── linq_config.json      # Linq credentials (not in git)
│   ├── enforcement/              # Safety and compliance
│   └── learning/                 # Agent capabilities and lessons
└── fork/
    └── workspace/
        ├── families/             # Family data (created during setup)
        └── protocols/            # Care protocols

Next Steps

Configuration

Configure runtime paths and behavior

Create First Family

Set up your first family directory

Troubleshooting

You need to install the Python dependencies:
pip install openai anthropic python-dotenv
If using a virtual environment, ensure it’s activated before installing.
Possible causes:
  • API token is incorrect or expired
  • Token not set in both .env AND linq_config.json
  • Using consumer account instead of Partner API account
Fix:
  1. Verify token in Linq dashboard
  2. Check both .env and runtime/scripts/linq_config.json
  3. Ensure you have Partner API access (not just consumer app)
The runtime/config.py file needs the CARESUPPORT_ROOT environment variable:
export CARESUPPORT_ROOT=/work  # or your preferred path
Or add to your .env file and ensure it’s loaded.
Use OpenRouter if:
  • You want access to multiple models
  • You prefer usage-based pricing
  • You’re just getting started
Use Anthropic direct if:
  • You only use Claude models
  • You have existing Anthropic credits
  • You want to minimize API hops
Both backends use the same models and produce identical results.
No. Set only the one you’re using:
# For OpenRouter
OPENROUTER_API_KEY=sk-or-v1-...
CARESUPPORT_AI_BACKEND=openrouter

# OR for Anthropic direct
ANTHROPIC_API_KEY=sk-ant-...
CARESUPPORT_AI_BACKEND=anthropic

Build docs developers (and LLMs) love