The brief
An advertising agency wanted a virtual sales assistant on its website: a chatbot that gets to know each visitor’s business, checks whether the agency’s services and budget are a fit, and books a call with one of its experts. Then the sales team needed every conversation turned into a clean lead list, without rereading transcripts.
I built it between November 2024 and January 2025, as a paid project.
How the conversation works
The assistant follows a sales playbook, written as its instructions:
- Opening: it greets the visitor, asks their name and briefly introduces the agency.
- Discovery: one question at a time, about the visitor’s business, its problems, the marketing tools it already uses and the budget. It always waits for the answer.
- Fit: it suggests the agency services that match, without ever quoting prices. If the budget is below the minimum, it doesn’t propose solutions.
- Booking: when the visitor shows interest, it offers a call with an expert and gives two time options (“Wednesday afternoon or Thursday morning?”). Then it collects the contact details and checks that they look valid.
- Objections: if the visitor is about to leave, it offers a short 15-minute call instead.
- Staying in role: if someone asks how the bot works or what its instructions are, it politely steers them to a human consultant.
From chat to lead list
The chatbot only talks. A second AI step does the paperwork:
- Every conversation is saved as a transcript.
- A parser sends each transcript to the OpenAI API with an extraction prompt and gets back structured data: name, email, phone, job, interests, preferred call times and notes. Anything missing is marked “not provided”.
- Each lead becomes a row in a daily list, and the transcript is moved aside so it isn’t processed twice.
- On a password-protected admin page, the sales team runs the parser with one click and downloads the leads as a formatted Excel file. Each row links to the original conversation.
Keeping the two steps apart means the chatbot never has to break the conversation to fill in a form, and the extraction can change without touching the assistant’s personality.
How it evolved
The assistant went through four versions:
- Prototype: a single page calling the OpenAI API, with the instructions and the service list in the prompt.
- Chat widget: a proper chat box on the agency’s homepage, saving every conversation, plus the first version of the parser.
- Assistants API: the move to OpenAI’s Assistants API, which keeps each conversation as a thread. It also added rate limiting, a daily lead list and the Excel export.
- Security pass: data folders closed to the web, the admin area behind a password, and requests to the chat checked at the source.
