George Evans Portfolio

All 12 pieces Piece 05

Website voice agent that qualifies leads, built to run for $0

Work sample
  • AI Automation
  • AI Marketing

Browser voice agent that asks qualifying questions, scores leads HOT, WARM or COLD and books a demo. Its 9-assertion self-test passes.

Built with: Python and Flask, browser Web Speech API, any OpenAI-compatible model (Gemini free tier by default), .ics calendar files, optional Twilio. Built with AI assistance (Claude) under my direction.
Skills shown: Voice agents, Prompt design, Lead qualification, Flask, Web Speech API, LLM JSON output, App security basics, Cost design

Status: Work sample. I built it for my own site in June 2026. Its self-test passed when I reran it today, but the hosted demo linked from my site could not be reached from the review sandbox, so this page does not claim it is live.

In 60 seconds

  • Problem: Service businesses lose jobs when nobody answers. The phone-based AI receptionists I priced need a phone number and bill per minute, so a prospect cannot try one for free.
  • What I built: A "Speak with an AI" button for my site. The browser handles the microphone, speech-to-text and text-to-speech for free. A small Flask app sends each turn to a free model that must answer in strict JSON, collects lead details, scores the lead HOT, WARM or COLD, and books a demo time once.
  • Proof: python app.py --selftest asserts the calendar file, a path-traversal guard, the book-once rule, the lead log, output escaping and the rate limiter. Today's run: "SELFTEST OK".
  • Result: Three versions. Version 1 used a realtime phone audio stack (the most expensive path), version 2 a Twilio phone line, and version 3 is designed to run for $0 a month on free tiers with no phone number.

The business problem

For a painter, roofer or plumber, a missed call can be a lost job, and they often miss calls because they are on a ladder or under a sink. An AI receptionist fixes that only if it:

  • asks the right questions in the right order and does not interrogate,
  • knows when a caller is worth the owner's time,
  • books the next step without the owner touching anything, and
  • costs less than the jobs it saves.

I also needed a live demo of my own service. A prospect should be able to talk to it from my website before paying anything.

What I built

  1. Clickvisitor presses Speak with our AI on the site
  2. Listenbrowser speech-to-text, typed fallback if unsupported
  3. Think/chat sends the turn plus known lead fields to a free model
  4. Answerstrict JSON reply: what to say, lead fields, booking time, end flag
  5. QualifyHOT, WARM or COLD from business type, missed calls, job value, urgency
  6. Bookone .ics file per conversation, plus a self-booking link
  7. Logevery finished conversation appended to leads.csv
  8. Speakbrowser text-to-speech reads the reply aloud

Prompt design. The prompt (built into app.py, with a longer readable copy in RECEPTIONIST_PROMPT.md) lists 12 fields to collect one question at a time (name, business, type, city, phone, email, website, missed calls per week, average job value, main need, urgency and preferred demo time), HOT, WARM and COLD rules (HOT means a service business that misses calls, has jobs worth $500 or more and wants help this week), a scripted price answer and a booking link. The app adds the fields already collected to every turn as a system message, so trimming the chat history never makes the agent ask a question twice.

Structured output. The model must reply with one JSON object: say, lead, book_time_iso and end_call. Code, not the model, enforces the booking rule: at most one booking per conversation, and only when the model returns a specific time the visitor agreed to. If the model returns plain text instead of JSON, the app still speaks it and books nothing.

Basic security. Conversation IDs are stripped to safe characters before they become file names, so a crafted ID cannot write outside the bookings folder. Replies on the optional phone path are XML-escaped. A rate limiter (30 requests per IP per minute) and a session store capped at 500 conversations keep one visitor from running up model calls or memory.

Cost by design. Moving speech into the browser removed the phone number and the per-minute charges. My cost notes put the optional phone line at $1.15 a month for a number plus about $0.0085 a minute for inbound calls, against $0 for the web button on a free model tier.

Proof you can check

  • Self-test, rerun December 4, 2026: "SELFTEST OK -> ics+traversal-safe, book-once, csv, escape, rate-limit, widget present", exit 0. The web framework is not installed in the review sandbox, so I ran the test with two small stand-in modules. That exercises the app's own logic but not the web server. Details are in evidence/05-receptionist-selftest-2026-12-04.txt.
  • Build report (June 2026): the server started, GET / served the widget, GET /health returned JSON, POST /chat returned a clean message with no model key set (no crash), and CORS headers were present. It also says plainly: "NOT verifiable here: the live LLM reply".
  • Test plan: TEST_CALLS.md defines 5 scenarios with expected behavior, including a painter missing calls, a roofer who asks the price first and a skeptical plumber who asks "Is this a real person?"

Outcome

Measured

  • Self-test passes: 9 assertions on booking, file safety, logging, escaping and rate limiting.
  • Designed running cost of the web version: $0 a month on a free model tier and free browser voice (from my cost notes, not a bill).
  • 3 versions built. Version 1 booked nothing, version 2 needs a paid phone number after the trial, version 3 needs neither.

Projected

  • None. I have not run the 5 test scenarios against the live model or measured bookings, so I make no claim about booked demos.

What I would do next

  • On my laptop, add the free model key, run all 5 scenarios and record the transcripts as a scorecard: right questions, right score, booked once, no made-up promises.
  • Confirm the button on biglife360.com reaches the hosted app, then send one test conversation end to end.
  • Add a hand-off to a human for callers who ask for one. The live prompt does not cover that yet, though the readable copy does. The widget already says it is an AI in its first line ("I'm the AI assistant"), and that should stay in every client version.

Files you can open

Everything this piece points to. Scripts run with Python 3; see each piece for the exact command.