HomeLearnCoursesHackathonsAccount
Building Conversational AI & Chatbots
The Chatbot Spectrum: Rules, Retrieval, and Generation · 1/2

Three ways to answer

Not every chatbot works the same way under the hood, and the differences matter a lot for how predictable, flexible, and maintainable the system ends up being. A rule-based chatbot matches user input against a set of predefined patterns, keywords, or regular expressions, and responds with a scripted reply tied to whichever pattern matched. If a user types something the rules don't cover, the bot has no fallback beyond a generic 'I didn't understand that,' but within its scripted paths it is completely predictable, easy to test, and impossible to embarrass you with an off-brand answer.

A retrieval-based chatbot works differently. Instead of writing new text, it selects the single best-matching response from a large, pre-written set of candidate replies, usually by scoring how semantically similar the user's message is to examples associated with each candidate. This is more flexible than rigid pattern matching because it can generalize to phrasings it hasn't seen exactly before, but every possible reply still has to exist in that candidate set ahead of time. A generative chatbot, powered by a language model, produces novel text on the fly rather than picking from a fixed list, which makes it far more flexible in open-ended conversation but also harder to fully control, since the model can say something inaccurate or off-tone that no one explicitly wrote.