Conversational AI › Conversation Management
Language AI HandbookAll chapters Conversational AI › Conversation ManagementOne section · Sections in this chapter4 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
One of the most important and underappreciated aspects of conversational AI is managing the flow of the conversation: how the system decides what to ask next, how it tracks goals, and how it handles recovery when something goes wrong. These concerns are easy to underestimate when prototyping because demonstrations tend to use the happy path. Real users take unexpected turns.
Task-Oriented vs. Open-Domain Dialogue
Conversational systems fall along a spectrum from fully task-oriented to fully open-domain:
Task-oriented dialogue has a specific goal to complete: book a flight, troubleshoot a device, answer a customer service question. Success is measurable (was the task completed?), and the system must actively drive toward completion by collecting required information and executing actions. The system needs to maintain goal state, track what information has been gathered, and actively pursue the goal while remaining responsive to user inputs that modify or redirect the goal.
Open-domain dialogue (also called chit-chat) has no fixed goal. The objective is to have an engaging, coherent conversation. There's no completion criterion, just user satisfaction and conversation quality. The challenge here is different: the system must stay interesting and relevant without a guiding task, respond appropriately to a wide range of topics and emotional registers, and maintain a consistent persona across the conversation.
Mixed systems handle both: a customer service bot that can answer product questions (task-oriented) but also engage in small talk and remember user preferences (open-domain adjacent). The mixing is handled through intent detection: when the system detects a task-relevant intent, it activates task-oriented logic; when it detects casual conversation, it responds more freely. In practice, LLMs blur this distinction naturally: you give them a system prompt that establishes their role and scope, and they handle both modes within that definition.
Modern LLMs are generally better at open-domain dialogue than earlier systems because they've been trained on vast amounts of natural conversation. Task-oriented capability often requires additional engineering: structured tool calls, slot tracking, and explicit completion logic. You can prompt an LLM to fill a slot-filling role, but explicit state management provides more reliability for production use cases with strict data requirements.
Slot Filling and Goal Tracking
For task-oriented dialogue, the system needs to collect specific pieces of information (slots) before it can complete a task. Consider booking a restaurant:
- Required slots: date, time, party size, cuisine preference, location
- Optional slots: price range, dietary restrictions, occasion
The system must track which slots are filled and which remain. When the user provides information, the system extracts and stores it. When it needs a missing slot, it asks a targeted question. The order in which slots are asked matters: it's natural to first establish what kind of experience the user wants (cuisine, occasion) before diving into logistics (date, time). Randomized or inefficient slot-asking creates a form-filling feeling that users find frustrating.
Slot filling is the process of mapping free-form user utterances to structured fields required to complete a task. It combines intent recognition (identifying what the user wants) with entity extraction (identifying the specific values they provided). A user saying "book a table for six on Friday evening" provides party size (6), day (Friday), and time range (evening) in a single utterance, all of which must be correctly extracted and stored.
With LLMs, slot filling can happen implicitly: the model maintains the conversation state in its context and naturally asks follow-up questions for missing information. But for complex workflows with many required fields or strict validation constraints (dates must be in the future, party sizes must fit the restaurant's capacity), explicit state tracking provides more reliability and easier debugging.
A hybrid approach is common in production: an LLM handles the natural language aspects, interpreting what the user said and generating the next response, while a thin application layer maintains an explicit state object tracking which slots are confirmed. The LLM is prompted with the current state at each turn, making sure it knows what's been collected and what's still needed.
Clarification and Disambiguation
Natural language is deeply ambiguous. Users say "book me a flight to Paris" without specifying which Paris, which dates, from which city, in what class, or on which airline. Good conversational systems handle this gracefully, neither demanding clarification for every possible ambiguity nor silently making wrong assumptions.
Disambiguation strategies include:
- Ask directly: "Which Paris did you mean: France or Texas?"
- Make a default assumption and state it: "I'll search for Paris, France. Let me know if you meant somewhere else."
- Offer options: "I found Paris, France and Paris, Texas. Which one?"
- Proceed with the most probable interpretation: For low-stakes ambiguities with a clearly dominant interpretation, just proceeding without comment is often the best experience.
The choice of strategy depends on context. How likely is each interpretation? A user flying internationally asking about Paris almost certainly means France, so a silent default is fine. How costly is a wrong assumption? If the cost of being wrong is high (booking the wrong destination, ordering the wrong product), explicit confirmation is worth the friction. How disruptive would a clarification request be to the conversation flow? A request for clarification in the middle of an already conversational exchange is less jarring than a form-like demand for specifics.
Systems that ask unnecessary clarifying questions are just as frustrating as systems that make wrong assumptions. Calibrating when to ask is a skill that requires understanding your user population and the real distribution of ambiguous cases in your application domain.
Handling Out-of-Scope Inputs
Users inevitably send inputs the system wasn't designed for. A travel booking bot receives requests to write poetry. A cooking assistant is asked for medical advice. A customer service bot receives angry personal messages. Good systems handle these gracefully rather than producing confusing or misleading responses.
For task-oriented systems, the response to out-of-scope inputs should be clear and helpful: explain what the system can and cannot do, and redirect to in-scope topics if possible. For LLM-based assistants, this often means the system prompt includes explicit instructions about scope, and the model declines politely while offering alternatives. "I'm not able to help with medical questions, but I can help you find healthcare providers who can."
The handling strategy also depends on the failure mode you're protecting against. Some systems fail silently: they attempt to answer out-of-scope questions but produce incorrect or hallucinated responses. This is worse than refusing, because the user doesn't know the response is unreliable. Other systems refuse too aggressively: they reject legitimate questions because they superficially resemble out-of-scope ones. A customer service bot for a software product that refuses to explain what an API is (because "it's a technical question, not a support question") provides a poor experience. Calibrating the scope boundary is an ongoing engineering challenge that requires collecting real user queries and auditing how the system handles them.
One useful technique is graceful degradation: rather than a binary in-scope/out-of-scope decision, the system acknowledges uncertainty and provides the best help it can while being honest about limitations. "I'm not sure I have complete information on this, but here's what I know..." is often better than a flat refusal when the query is adjacent to scope.
Conversation Repair
Breakdowns in conversational understanding happen regularly. The user misunderstood what the system said. The system misunderstood what the user meant. A previous response was wrong. Dialogue researchers call the process of recovering from these breakdowns "conversation repair."
Repair is handled differently depending on who detects the breakdown:
User-initiated repair happens when the user explicitly corrects or questions the system: "No, I meant next weekend, not this weekend." or "That's not right." A good system detects that the user is correcting it rather than introducing new information, updates its state accordingly, and proceeds from the corrected understanding. LLMs generally handle simple user-initiated repair well because they've seen this pattern in training data. More complex repairs, like retracting a fact established several turns ago, can still cause coherence problems.
System-initiated repair happens when the system detects it may have made an error or is uncertain about something. The system asks for confirmation: "I want to make sure I understand: you're asking about the refund policy for digital products, not physical ones, right?" This proactive clarification prevents errors from cascading through subsequent turns.
Handling repair gracefully is one of the clearest markers of a mature conversational system. Systems that respond to corrections by simply acknowledging them and moving on, without properly updating their understanding, produce the frustrating experience where you have to correct the same thing multiple times.