I Built an AI Agent That Talks to My Website Visitors So I Don't Have to Miss Leads Anymore
Source: Dev.to
A Conversational Lead‑Capture Agent for My Freelance Site
There’s a specific type of frustration I kept running into as a freelance developer. Someone would land on my site, browse around for a few minutes, and then leave—no message, no inquiry, nothing. I’d never know what they wanted or if they were even close to reaching out.
The visitors who did reach out were great, but I started thinking about the ones who didn’t. Some people genuinely don’t like filling out contact forms; they feel formal, one‑sided, a bit awkward. It’s essentially writing a cold email to someone whose work you just discovered. A lot of potential clients bounce instead of enduring that friction.
So I started thinking about what the middle ground looks like: something between “browse silently and leave” and “fill out a form and wait.” That middle ground turned out to be a conversation.
The Idea
I wanted to build something that could talk to visitors the way I would if I were sitting right there with them—answering questions naturally, telling them about what I do, how I work, and what kinds of projects I take on. Not in a scripted, button‑clicking chatbot way, but in an actual back‑and‑forth exchange.
If, at some point in that conversation, the visitor shows genuine interest in working together, the agent would smoothly ask for their contact details, put together a description of what they’re looking for, and send it straight to me. No forms. No friction. Just a conversation that ends with a qualified lead in my inbox.
Try it yourself: iamtaqi.site (live on the site right now)
The key thing I was careful about from the start: the agent should never push. If someone just has a general question, it answers it. If someone wants to know how I approach a certain type of project, it tells them. It only asks for contact info when the person themselves signals they want to move forward. That distinction mattered a lot to me.
How I Built It
The stack I used was LangChain and LangGraph on the backend, with a RAG pipeline powering the knowledge base.
The RAG layer
RAG stands for Retrieval‑Augmented Generation. Instead of the AI making things up or relying solely on its general training data, it first retrieves real information from a specific knowledge base before forming a response.
In my case the knowledge base contains everything about me and my work: services, process, past projects, tech stack, client‑relationship approach, turnaround times, etc.
When a visitor asks something like “Do you work with React?” or “Have you built anything with AI before?”, the agent doesn’t guess. It pulls the relevant context from the knowledge base and builds its answer from that, ensuring responses are accurate, grounded, and truly reflective of what I do.
LangGraph
LangGraph handles the conversation flow. Think of it as the brain that decides what state the conversation is in and what should happen next:
- Is the visitor still in discovery mode?
- Are they asking something the knowledge base can answer?
- Have they expressed enough interest to warrant asking for contact details?
LangGraph manages all of this through a graph of nodes and conditional edges, so the agent always knows where it is in the conversation and what the right next move is.
LangChain
LangChain sits underneath everything, handling:
- Language‑model interactions
- Prompt construction
- Memory that lets the agent remember earlier parts of the conversation
End‑to‑end flow
- Visitor sends a message
- Agent retrieves relevant context from the knowledge base via semantic search
- Agent constructs a natural, on‑brand response
- Based on the conversation state, the agent either:
- Answers the question
- Asks a follow‑up
- Gently transitions to collecting contact info if the visitor seems interested
When it does collect contact info, it also generates a short project brief based on everything discussed. By the time I receive the notification, I already have the person’s name, contact details, and a summary of what they’re looking for, allowing me to reply with full context from the first message.
What It Changed
- No more lost warm leads. People who would have bounced after a minute now have a reason to stay and engage.
- Higher‑quality inquiries. Because the conversation is low‑pressure and genuinely helpful, the people who do reach out have already talked through their project, know what I do, and have self‑selected.
- Instant credibility. If a visitor wonders whether I’m serious about AI development, they can have a sophisticated AI‑focused conversation right on the page, which answers that question effectively.
- Reduced repetitive email work. Common questions about tech stack, availability, or industry experience are handled by the agent, so when someone reaches me directly we’re already past the intro stage.
What I’d Do Differently
-
Invest more time upfront in structuring the knowledge base.
The quality of RAG retrieval is directly tied to how well the source documents are written and organized. Early on I had some slightly off responses because the relevant information was buried in a long document and the retrieval wasn’t surfacing it cleanly. Writing focused, well‑structured knowledge documents made a significant difference. -
Build in more analytics from day one.
(The original post cuts off here, but the idea is to track conversation metrics, conversion rates, and retrieval performance to iterate quickly.)
Conversations that converted into leads, but I’d like to have better visibility into the questions people are asking that the agent couldn’t fully answer. That’s actually really valuable product feedback if you look at it the right way.
Closing Thought
This project started from a pretty simple observation: people don’t always want to fill out a form, but that doesn’t mean they don’t want to connect. Giving them a conversation instead of a form removed a friction point that I didn’t even realize was costing me leads.
If you’re a freelancer or running a small agency and you’ve ever wondered how many visitors left your site without reaching out, this is worth thinking about. The technology to build something like this is genuinely accessible now, and the ROI on not missing a single interested visitor adds up fast.
Happy to answer any questions about the build in the comments. And if you want to see it in action, just head over to iamtaqi.site and start a conversation.