Chatbot, What Is It? A Practical Guide for Builders
A chatbot is software that simulates a conversation with a human, usually through text or voice, to answer questions, complete tasks, or route people to the right help. It sits behind a chat window on a website, inside a messaging app, or embedded in a product, and it responds to whatever the user types in a way that feels like talking to a person rather than filling out a form.
That's the short answer. The longer answer is that "chatbot" covers a wide range of technology — from simple decision-tree scripts to modern systems powered by large language models — and the differences between them matter a lot if you're trying to build or buy one. This article breaks down what a chatbot actually does, the main categories, and what's involved in putting one into production.
What a chatbot actually does
At its core, every chatbot follows the same loop:
- Receive input — a message typed or spoken by a user.
- Interpret it — figure out what the user wants.
- Generate a response — produce text (or an action) that addresses the request.
- Return it — send the reply back through whatever interface the user is on (web widget, Slack, SMS, phone system, app).
What differs between chatbots is step 2 and step 3 — how they interpret input and how they generate a response. That's where the technology splits into distinct types.
The three main types of chatbots
Rule-based chatbots
These follow a fixed decision tree: "if the user says X, respond with Y." They're built with flowcharts, keyword matching, or button-driven menus. They're cheap to build, predictable, and easy to test, but they break the moment a user phrases something in a way the designer didn't anticipate. Most early customer-service bots and IVR phone trees are rule-based.
Intent-based (NLU) chatbots
These use natural language understanding to classify a message into a predefined "intent" (e.g., "check_order_status") and then pull the matching response or trigger a workflow. They're more flexible than rule-based bots because they can handle paraphrasing, but they're still limited to the intents someone explicitly programmed. Anything outside that list gets a generic fallback ("Sorry, I didn't understand that").
LLM-based chatbots
These are built on large language models — the technology behind Claude, GPT, and similar systems. Instead of matching input to a fixed list of intents, the model generates a response based on understanding the actual meaning of the text, the conversation history, and often external context you provide (documents, database results, tool outputs). This is why modern chatbots can hold open-ended conversations, summarize documents, write code, or answer questions they were never explicitly programmed to answer.
Almost every chatbot getting attention today — customer support assistants, coding copilots, internal knowledge-base bots — falls into this third category.
Why LLM-based chatbots changed the game
The shift from intent-matching to LLM-based generation matters for three practical reasons:
- Fewer dead ends. Instead of a fallback message, the model can reason through an unfamiliar question and give a useful answer.
- Context handling. LLMs can keep track of a multi-turn conversation, remember what was said earlier, and adjust tone or detail level accordingly.
- Tool use. Modern LLM chatbots can call external functions — look up an order, run a calculation, search a database — and weave the result into a natural-language reply, instead of just returning static text.
This is also why "chatbot" and "AI assistant" have started to blur together. A chatbot is the interface; an LLM is what generates the intelligence behind it.
What you need to actually build one
If you want to build an LLM-based chatbot rather than a rule-based one, the pieces are:
- A model provider — access to an LLM like Claude, either directly or through a platform.
- A conversation loop — code that sends the user's message plus prior conversation history to the model and returns the response.
- Context or retrieval — a way to feed the model relevant information (docs, product data, past tickets) so it answers accurately instead of guessing.
- An interface — the widget, Slack app, or messaging integration users actually type into.
- Monitoring — logs and usage metrics so you know what people are asking and where the bot fails.
Here's a minimal example of the conversation-loop piece, using SubToAPI to call Claude through a standard HTTPS API:
async function askBot(message, history = []) {
const response = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "claude-3-5-sonnet-20241022",
max_tokens: 500,
messages: [...history, { role: "user", content: message }]
})
});
const data = await response.json();
return data.content[0].text;
}
This works because SubToAPI turns an existing Claude subscription into an application API key (sub_live_...) that behaves like a normal REST API — you get streaming, tool use, and usage metadata without setting up separate infrastructure. The quickstart walks through authentication, and the messages endpoint docs cover request and response formats in detail if you're building something more involved than a simple Q&A loop.
Choosing the right type for your project
Not every chatbot needs an LLM. A rule-based bot is often the right choice for narrow, high-stakes flows — password resets, appointment booking — where predictability matters more than flexibility. But for anything involving open-ended questions, varied phrasing, or content generation (support, onboarding, internal tools, coding help), an LLM-based chatbot will outperform a rule-based one almost every time, and it requires far less manual scripting to maintain.
If you're building the LLM route, streaming responses back to the user token-by-token (rather than waiting for the full reply) makes a noticeable difference in how "alive" the bot feels — see the streaming guide for how that's implemented over a standard API connection.
questions
Is a chatbot the same thing as AI? Not exactly. A chatbot is the conversational interface — the thing a user types into. AI, specifically an LLM, is often what powers the responses behind that interface. You can have a chatbot with no AI (rule-based) and AI with no chatbot (a model used for other tasks).
Do I need to train a custom model to build a chatbot? No. Most modern chatbots are built by calling an existing LLM through an API and supplying it with context (instructions, documents, conversation history) rather than training a model from scratch.
What's the difference between a chatbot and a virtual assistant? The terms overlap heavily. "Chatbot" usually refers to the text-based conversational interface itself, while "virtual assistant" often implies broader capabilities like taking actions, managing schedules, or integrating with multiple tools — but in practice, both are commonly used to describe the same LLM-powered systems.