DEV Community

Henry Knight
Henry Knight

Posted on

How I Built an AI Chatbot for Local Businesses (Python + Claude API, Zero SaaS Fees)

Most local businesses — plumbers, electricians, HVAC, dentists — lose 62% of inbound leads because nobody answers after hours.

I built an AI chatbot for a local plumber in one weekend. Here is the full stack.

The Problem

40 website visits on a Saturday. 30 leave without booking. That is $3000 in lost jobs — every weekend.

Businesses that need this most:

  • Plumbers (emergency calls at 11pm)
  • HVAC companies (summer AC breakdowns)
  • Electricians
  • Contractors
  • Dentists and chiropractors

They all share one problem: no 24/7 response layer.

The Architecture (30 Lines of Python)

from flask import Flask, request, jsonify
import anthropic

app = Flask(__name__)
client = anthropic.Anthropic()

BUSINESS_CONTEXT = """
You are a helpful assistant for Mike's Plumbing.
Business hours: Mon-Fri 8am-6pm, emergency line: (555) 123-4567
Services: leak repair, drain cleaning, water heater install
Pricing: $85 service call + parts
"""

@app.route('/chat', methods=['POST'])
def chat():
    user_message = request.json.get('message', '')
    response = client.messages.create(
        model="claude-haiku-4-5-20251001",
        max_tokens=500,
        system=BUSINESS_CONTEXT,
        messages=[{"role": "user", "content": user_message}]
    )
    return jsonify({"reply": response.content[0].text})

if __name__ == '__main__':
    app.run(port=5000)
Enter fullscreen mode Exit fullscreen mode

Total: 30 lines. Flask server plus Claude API call plus business context injected as system prompt.

Cost to Run: Under $5/Month Per Client

  • Claude Haiku API: $0.25 per million tokens. A chatbot handling 500 messages per day costs $0.04/day
  • Hosting: Railway.app or Render free tier
  • Chat widget: Crisp.chat free plan (replace their backend with your webhook)

You charge the client $300-500/month. Your cost is under $5. Margin is 99%.

Finding Your First Client

Open Google Maps. Search 'plumber [your city]'. Filter for businesses with basic or no websites. These are your targets.

Call script (under 30 seconds):

'Hi, I noticed your website does not have a live chat. I build AI assistants for local businesses that answer customer questions 24/7, collect contact info, and book appointments automatically. I can set one up for you this week. Can I send you a two-minute demo?'

Send a Loom recording of the chatbot answering plumbing questions. Close at $300/month.

Step 3: The Upsell Stack

Start at $300/month for the base chatbot. Then:

  • SMS follow-up automation via Twilio: add $100/month
  • Google Calendar booking integration: add $150/month
  • Weekly lead summary report: add $50/month

Average client value climbs to $550-600/month recurring with minimal extra work.

What This Actually Is

You are not selling software. You are selling the outcome: 'Never miss another after-hours lead.'

33 million small businesses in the US. Most have no automation, no 24/7 response, and a website built in 2014.

You do not need a SaaS platform. You need Python, Claude API, and five minutes of their time.

Get the Full Starter Kit

I packaged the complete stack — chatbot server, booking integration, cold email templates for 10 business categories, and ready-to-run scripts — into a single download.

Grab it at https://payhip.com/b/GuGDX — reduced this week only.

Built one of these and closed your first client? Reply here. I want to hear about it.

Top comments (0)