📞 Agents in a Box — Masterclass Resource

AI Phone Employee — Lexa

A voice AI agent that answers inbound calls, runs outbound campaigns, captures transcripts with sentiment analysis, and tracks every dollar spent — all visible on your ClawBuddy dashboard.

Missed Calls = Missed Revenue

❌ Without an AI Phone Employee

You miss calls when you're busy. You spend hours manually dialing lead lists. You have no transcripts, no sentiment analysis, no cost tracking. Every call is a black box — you don't know what was said, what was promised, or what follow-ups are needed.

✅ With Lexa

Lexa answers every call 24/7 with your custom script. She runs outbound campaigns to your lead lists while you sleep. Every call gets a transcript, sentiment score, action items, and cost breakdown — all surfaced on a 6-view dashboard you can check from your phone.

Inbound + Outbound in One System

1
📞

Call Comes In

Customer calls your number. Lexa answers with your custom AI prompt and handles the conversation.

2
📄

Transcript + Analysis

Full transcript captured, sentiment analyzed, action items extracted, cost calculated per call.

3
📈

Dashboard Updates

Everything surfaces on your OpsCenter — call log, analytics, campaign progress, lead status.

Pick a Voice AI Platform

Lexa works with multiple voice AI providers. Pick the one that fits your budget and needs. The ClawBuddy kit ships with Millis AI integration, but you can swap in any provider below.

Millis AI

~$0.08-0.12/min

Default integration in the kit. Low-latency, built-in phone provisioning, webhook-based. Good starting point.

Vapi

~$0.05-0.10/min

Popular voice AI platform. Great docs, large community. Bring your own Twilio number or use theirs.

Pipecat + LiveKit

~$0.02-0.05/min (self-hosted)

Open-source pipeline. Lowest cost if you self-host. More setup required, maximum control.

Twilio + Telnyx

~$0.01-0.03/min (telephony only)

Telephony providers for phone numbers and SIP trunking. Pair with any voice AI engine. Most flexible, most DIY.

💰 Cost Tip

Costs vary by provider, model, and call duration. Millis/Vapi are turnkey (higher per-minute but zero infrastructure). Pipecat+LiveKit is cheapest at scale but requires server management. Twilio/Telnyx are just the phone line — you bring your own AI. Start with a managed provider, optimize later.

🔑 Prerequisites

Required: ClawBuddy instance running (SETUP.md complete) + account with your chosen voice AI provider + a phone number provisioned through that provider. For default Millis AI setup: Set MILLIS_API_KEY and MILLIS_AGENT_ID in Supabase secrets.

Lexa — Setup & Agent Instructions

This prompt covers the full setup: deploying edge functions, creating the OpsCenter app, configuring webhooks, and teaching your agent how to manage calls and campaigns.

lexa-setup-and-instructions.md
# Lexa — AI Phone Employee Setup You are setting up Lexa, an AI phone employee that handles inbound and outbound voice calls with full transcript capture, sentiment analysis, and cost tracking. ## Step 1: Deploy Edge Functions Run these from your clawbuddy-kit directory: ```bash supabase functions deploy lexa-webhook --no-verify-jwt supabase functions deploy lexa-campaign-runner --no-verify-jwt supabase functions deploy lexa-precall --no-verify-jwt supabase functions deploy millis-proxy --no-verify-jwt ``` ## Step 2: Run Migrations ```bash supabase db push ``` This creates: `lexa_calls`, `lexa_campaigns`, `lexa_leads`, `lexa_daily_metrics` tables plus 6 OpsCenter block types. ## Step 3: Set Secrets ```bash supabase secrets set MILLIS_API_KEY=your-millis-api-key supabase secrets set MILLIS_AGENT_ID=your-millis-agent-id ``` ## Step 4: Create OpsCenter App ```json {"request_type": "ops", "action": "create_app", "name": "Lexa", "description": "AI Phone Employee — voice calls, campaigns, and analytics", "icon": "phone"} ``` Save the returned `app_id`, then create 6 pages: ```json {"request_type": "ops", "action": "create_page", "app_id": "APP_ID", "name": "Dashboard", "sort_order": 1} {"request_type": "ops", "action": "create_page", "app_id": "APP_ID", "name": "Call Log", "sort_order": 2} {"request_type": "ops", "action": "create_page", "app_id": "APP_ID", "name": "Leads", "sort_order": 3} {"request_type": "ops", "action": "create_page", "app_id": "APP_ID", "name": "Campaigns", "sort_order": 4} {"request_type": "ops", "action": "create_page", "app_id": "APP_ID", "name": "Transcripts", "sort_order": 5} {"request_type": "ops", "action": "create_page", "app_id": "APP_ID", "name": "Analytics", "sort_order": 6} ``` Then create 6 blocks (one per page): ```json {"request_type": "ops", "action": "create_block", "page_id": "DASHBOARD_PAGE_ID", "name": "Command Center", "block_type": "lexa_dashboard", "config": {}} {"request_type": "ops", "action": "create_block", "page_id": "CALL_LOG_PAGE_ID", "name": "Call Log", "block_type": "lexa_call_log", "config": {}} {"request_type": "ops", "action": "create_block", "page_id": "LEADS_PAGE_ID", "name": "Lead Manager", "block_type": "lexa_leads", "config": {}} {"request_type": "ops", "action": "create_block", "page_id": "CAMPAIGNS_PAGE_ID", "name": "Campaigns", "block_type": "lexa_campaigns", "config": {}} {"request_type": "ops", "action": "create_block", "page_id": "TRANSCRIPTS_PAGE_ID", "name": "Transcripts", "block_type": "lexa_transcripts", "config": {}} {"request_type": "ops", "action": "create_block", "page_id": "ANALYTICS_PAGE_ID", "name": "Analytics", "block_type": "lexa_analytics", "config": {}} ``` ## Step 5: Configure Webhook In your voice AI provider dashboard, set the webhook URL to: ``` https://YOUR_SUPABASE_URL/functions/v1/lexa-webhook ``` This receives call data after every call ends — transcript, duration, cost, sentiment. ## Managing Calls and Campaigns ### Check call log: ```json {"request_type": "ops", "action": "list_data", "app_id": "APP_ID", "block_id": "CALL_LOG_BLOCK_ID"} ``` ### Create an outbound campaign: Upload a lead list to the Leads block, then trigger the campaign runner: ```bash curl -X POST "https://YOUR_SUPABASE_URL/functions/v1/lexa-campaign-runner" \ -H "x-webhook-secret: YOUR_SECRET" \ -H "Content-Type: application/json" \ -d '{"campaign_id": "CAMPAIGN_UUID"}' ``` ### Pre-validate leads before calling: ```bash curl -X POST "https://YOUR_SUPABASE_URL/functions/v1/lexa-precall" \ -H "x-webhook-secret: YOUR_SECRET" \ -H "Content-Type: application/json" \ -d '{"campaign_id": "CAMPAIGN_UUID"}' ``` ## Dashboard Views | View | What It Shows | |------|---------------| | Dashboard | 6 KPIs, call volume chart, outcomes pie, cost analysis | | Call Log | Filterable table with status, duration, sentiment, cost | | Leads | Lead list manager with per-contact status tracking | | Campaigns | Campaign builder, progress tracking, batch controls | | Transcripts | Full call transcripts with speaker labels | | Analytics | Trend charts: duration, answer rate, cost over time | ## Swapping Providers The default integration uses Millis AI. To use a different provider: 1. Replace `millis-proxy` edge function with your provider's API calls 2. Update `lexa-webhook` to parse your provider's webhook format 3. Update `lexa-campaign-runner` to use your provider's outbound call API 4. The OpsCenter blocks, data schema, and dashboard remain the same The data schema is provider-agnostic — it tracks calls, transcripts, costs, and sentiment regardless of which voice AI engine powers the calls.

🛠️ Starter vs Production

This prompt creates a V1 scaffold. Production requires wiring real data sources, QA passes, error handling, retry logic, and safety gates. Treat the output as a working prototype — not a ship-ready system.