Turn missed calls into conversations.
Small businesses lose up to 62% of phone calls — customers call after hours, during busy periods, or when staff can't pick up. Each missed call is a lost lead. Most callers won't leave a voicemail. They just move on to the next business.
LeadCatch.ai bridges that gap by instantly converting missed calls into AI-powered text conversations. When a customer calls and no one answers, the system:
- Plays a brief voice greeting via Twilio
- Immediately texts the caller through iMessage
- Uses GPT-4 to carry on a natural conversation — answering questions about services, pricing, hours, and more
- Saves a conversation summary so the business owner can follow up later
No lead goes cold. No customer gets ghosted. The AI handles the first touch while the business owner catches up.
| Technology | Role |
|---|---|
| Python 3 | Core language |
| Flask | Lightweight web server to receive Twilio webhooks |
| Twilio | Telephony — receives incoming calls and triggers the webhook |
| OpenAI GPT-4 Turbo | Generates natural, context-aware responses to customer messages |
| Apple iMessage (via AppleScript) | Sends and receives text messages through the macOS Messages app |
| SQLite | Reads the local iMessage database (chat.db) to detect new incoming messages |
| ngrok | Exposes the local Flask server to the internet during development |
Customer calls ──> Twilio webhook ──> Flask server (app.py)
│
├── Plays voice greeting
└── Spawns iMessage responder
│
├── Sends initial text via iMessage
├── Monitors for replies (polls chat.db)
└── Responds with GPT-4 using business data
- A customer calls your Twilio number
- Twilio forwards the call to your Flask webhook
- The caller hears: "Thank you for calling. Our AI assistant will text you shortly."
- The system launches an iMessage responder for that caller
- GPT-4 generates responses using your business data from
business_data.json - Conversation summaries are saved per customer in
summaries/
- Automatic call-to-text conversion via Twilio
- AI-powered responses using GPT-4 Turbo
- Per-customer conversation summaries for business owners
- Business info loaded from a single JSON config file
- Deduplication — prevents multiple responders for the same caller
- Persistent conversation history across sessions
- macOS (required for iMessage integration via AppleScript)
- Python 3.7+
- Twilio account with a phone number
- OpenAI API key
- ngrok or similar tunnel (for local development)
git clone <repo-url>
cd LeadCatch.ai
pip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your_openai_api_key_here
Edit business_data.json with your business information:
{
"name": "Your Business Name",
"services": {
"Service A": "$25",
"Service B": "$50"
},
"hours": "Mon-Sat: 10 AM to 7 PM",
"address": "123 Main Street, City, ST",
"contact": "555-123-4567",
"email": "you@example.com",
"about": "A short description of your business."
}- Log in to your Twilio Console
- Navigate to your phone number settings
- Under Voice & Fax, set the webhook URL to your server (e.g.,
https://abc123.ngrok.io/) - Set the HTTP method to POST
- Enable call forwarding on your Twilio number
ngrok http 5001Copy the HTTPS URL and use it as your Twilio webhook.
Your terminal needs Full Disk Access to read the iMessage database:
- Open System Settings > Privacy & Security > Full Disk Access
- Add your terminal app (Terminal, iTerm, etc.)
- Add Python if needed
python app.pyThe server starts on http://0.0.0.0:5001.
LeadCatch.ai/
├── app.py # Flask webhook server — receives Twilio calls
├── imessage_responder.py # iMessage monitor + GPT-4 response logic
├── business_data.json # Your business info (services, hours, contact)
├── requirements.txt # Python dependencies
├── .env # API keys (not committed)
├── summaries/ # Per-customer conversation summaries (auto-created)
│ └── +15551234567.json
└── README.md
Edit the system_prompt in imessage_responder.py:
system_prompt = f"""
You are a smart, friendly assistant for {business_data['name']}.
# Add your custom instructions here
"""Modify initial_message in imessage_responder.py:
initial_message = "Hi! Thank you for calling. How can I help you today?"Adjust how frequently the responder checks for new messages:
time.sleep(3) # seconds between checks| Problem | What to check |
|---|---|
| iMessage not sending | Verify Full Disk Access permissions; check iMessage is signed in; ensure phone numbers include country code (+1...) |
| Webhook not received | Confirm ngrok is running and the Twilio webhook URL matches |
| OpenAI errors | Check .env API key; verify account has credits; review rate limits |
| Duplicate responders | Restart the Flask server to clear active_processes; kill orphaned Python processes |
- macOS only — iMessage integration requires macOS with Messages.app
- Local execution — the responder must run on a Mac with iMessage configured
- iMessage only — SMS fallback depends on your carrier and Apple ID setup
This project is provided as-is for educational and business purposes.