AI Chat Assistant
An AI assistant that answers site visitors about services and projects, collects leads and knows when to hand the conversation to a human.
Overview
The agent runs as a separate service. It reads live services and projects from the API, saves qualified leads straight into the CMS inbox, and flags conversations for the owner when it gets a request for a quote, a question it can’t answer or a complaint. Its system prompt is edited in the admin. Every answer is logged with the visitor’s rating for later review. The same service also drafts SEO titles and descriptions for the CMS.
Challenge & approach
The goal was an assistant that is useful, honest about its limits and cheap to run:
Grounded answers — Tools for services, projects, saving a lead and flagging for a human. Each reply returns signals (grounding, lead saved, handoff) that drive the chat UI and the owner’s queue.
Cost control — A daily reply budget overall and per session, an output token cap, and a short-lived request cache for repeated questions.
Graceful fallback — Without an API key, or when the budget is spent, the agent returns a prepared reply in the visitor’s language and the site keeps working.
Isolation — It runs in its own Docker container, so heavy AI dependencies never touch the main API.