How to build a website AI agent with Claude that qualifies leads and books meetings
Most chat bubbles on company websites are a FAQ page with a speech balloon. They match keywords, show a canned answer, and hand you a form. A website AI agent is different. It reads what the visitor actually asked, answers it, asks the questions a good salesperson would ask, and books a call straight into the calendar when the visitor fits. Here is how I build one with Claude, with code you can…
A website AI agent is a type of language model that differs from typical FAQ-style chat bubbles found on many company websites. Instead, it actively interacts with website visitors, understands their queries, provides relevant answers, asks appropriate follow-up questions, and even schedules meetings directly into the user's calendar when the visitor is a good fit for the service being offered.
To build such an AI agent, you need three main components: a clear objective, a limited set of tools, and a defined set of rules governing its behavior. The objective usually revolves around determining whether the visitor's needs align with the services offered. The tools at your disposal are typically your calendar and Customer Relationship Management (CRM) system. The rules are crucial as they ensure the agent behaves like a colleague rather than a liability.
The technical implementation involves a few key steps. First, the visitor's message is sent to your backend, which securely manages the API key, conversation history, and tools. The backend then communicates with the Claude AI API. As the AI model processes the input, it may request tools to gather necessary information or perform specific actions like checking calendar availability or booking a meeting.
All data, including the API key and sensitive calendar/CRM credentials, remain on the server-side and are never exposed to the visitor's browser.
The system prompt, a concise rulebook for the AI agent, is another critical element. It outlines the agent's role, the kind of visitors it targets, and a set of clear guidelines. These rules include answering visitor questions before asking any of its own, asking one question at a time, collecting specific details like the visitor's role, company size, and problem statement, quoting only the listed prices, declining requests for discounts or delivery dates, and offering help if the visitor doesn't fit the criteria.
The agent should also politely decline if it can't assist and ask only for the essential information for booking, such as name, email, and preferred meeting time. The agent only offers time slots that are available and finalizes the booking only after the visitor has chosen a slot.
Two key tools are employed in this process: check_availability and book_meeting. The former checks the availability of specific time slots and returns them in an ISO date-time format, which is then used by the latter tool to book the meeting in the calendar and update the CRM with the visitor's contact details and meeting summary.
The tools are implemented as Python functions decorated with @beta_tool, ensuring strict input matching and preventing any discrepancies. The tools are then integrated into the Claude API through a tool runner that handles the exchange of messages between the visitor (Claude) and the tools.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
Also reported by 2 other outlets
- I asked Google Antigravity to build a website, then let Claude Code redesign it xda-developers.com
- I had Claude build substack.com