Skip to content
anythingai.space
Module 13

Conversational AI

Dialogue systems from classical NLU pipelines to LLM assistants and voice — memory, design patterns and evaluation.

lessons
8
steps
72
time
97 min
natural languagestructured callreplyONE TURN CARRIES A GOAL AND ITS DETAILSI needa hotelgoalinPariscitynext weekdatesunderstand → keep track → respondUserAssistantBooking APIbook_hotel(...)
01beginner·10 min·8 steps

What Is Conversational AI?

What a chatbot or voice assistant has to do on every turn, and the two architectures that do it: the classical NLU → DM → NLG pipeline and the end-to-end LLM.

  • The three jobs on every turn: understand, track, respond
  • How the field moved from rules to pipelines to LLMs
  • The classical pipeline: NLU → dialogue manager → NLG
  • End-to-end LLM systems and where each approach fits
Start →
BELIEF STATE: CONFIDENCE PER SLOT AFTER EACH TURNturn 1turn 2turn 3city.95.95.95check_in.00.88.90nights.00.00.60room_type.00.00.00T1: “hotel in Paris”T2: “for March 15”T3: “a few nights?”
02intermediate·12 min·9 steps

NLU and Dialogue State

How a classical bot turns a sentence into an intent, entities and sentiment, then tracks what it knows across turns and fills the slots a task needs.

  • What NLU outputs: intent, entities and confidence
  • How intent classifiers score, threshold and handle out-of-scope input
  • Entity extraction as token labelling, and why sentiment matters
  • How the dialogue state is updated turn by turn
Start →
filled sentenceTEMPLATEYour room in{city}from{check_in}for{nights}nights is confirmed.OUTPUTYour room inParisfromMarch 15for3nights is confirmed.CONFIRM_BOOKINGTemplates3 variants for CONFIRMUser
03intermediate·12 min·9 steps

Dialogue Policy and NLG

How a classical bot decides what to do next from its dialogue state, and how NLG turns that decision into a sentence with templates, response selection or a neural model.

  • What a dialogue policy is and its action space
  • Rule-based vs learned (RL) policies
  • Three ways to generate the reply: templates, selection, neural
  • Control vs naturalness across NLG methods
Start →
EXAMPLE 1 (IN THE PROMPT)user: room for tonight?bot: Which city? I'll check tonight's availability.EXAMPLE 2 (IN THE PROMPT)user: this is ridiculousbot: I'm sorry. Want me to connect you to a person?LIVE TURN: THE MODEL FOLLOWS THE PATTERNuser: need a room in Lyonbot: Which night? I'll check Lyon availability.
04intermediate·13 min·9 steps

LLM-Based Assistants

How one language model runs a whole conversation from its context window, and how system prompts, few-shot examples, RLHF, tools and retrieval shape what it does.

  • How an end-to-end LLM keeps a conversation going with its context window
  • Shaping behaviour with system prompts and few-shot examples
  • What RLHF adds: a model aligned to human preferences
  • Tool calling and retrieval: from talking to acting on facts
Start →
BEFORE · WHAT THE MODEL WAS SENTT1 … T20 (full text)T21T22T23T24AFTER · SUMMARY + RECENT TURNSSummary: vegetarian · Lisbon trip in May · prefers quiet hotelsT21T22T23T24Old turnsT1–T20, full textSummarizerdialogue-tunedRunning summary2 sentences
05intermediate·13 min·10 steps

Memory & Context in Conversations

Keep a conversation coherent across turns, sessions and months: context windows, summaries, slots, sessions, long-term and vector memory, and preferences.

  • Why memory works in tiers: context, session and long-term
  • Keep long chats inside the context window with windows and summaries
  • Isolate many concurrent conversations with session management
  • Recall past conversations by meaning with vector memory
Start →
modernDECODED WORDSwhat'stheweathernot “whether”inLisbonentitytomorrowentityAudioAcoustic modelaudio → phonemesLanguage modellikely word sequencesTranscriptEnd-to-end ASRe.g. Whisper
06intermediate·12 min·9 steps

Voice Assistants

Wrap a dialogue engine in speech: wake word, speech recognition, synthesis, voice-first design, screens, and recognising who is speaking.

  • The voice loop: wake word → ASR → dialogue → TTS
  • Why wake-word detection runs on device at low power
  • How ASR and TTS turn audio into text and back
  • Design for ears: confirmations, error recovery, turn-taking
Start →
task turnopen turnTASK TURN → TEMPLATE“book Lisbon for 12 May”→Booked: Lisbon, 12 May, 3 nights.“is the old town walkable?”→LLM answer, aware of the bookingUserNLUintents + entitiesState trackerexplicit slotsTemplate NLGexact confirmationsLLMopen-ended replies
07intermediate·13 min·9 steps

Conversational Design Patterns

Reusable shapes for chat systems: intent routing, generative fallback, hybrids, retrieval, tools, copilots and multi-agent teams, and when to pick each.

  • Route known requests with intent-driven handlers
  • Fall back to an LLM below a confidence threshold
  • Ground answers and take actions with retrieval and tools
  • Place the assistant inside the workflow (copilot) or split it into specialists
Start →
TASK SUCCESS (ILLUSTRATIVE)A59%BsignificantCSAT (ILLUSTRATIVE)A3.9/5B4.1/5UsersRandom split50 / 50Variant Acurrent promptVariant Bnew promptStats testsignificant?
08intermediate·12 min·9 steps

Evaluating Conversational AI

Measure a dialogue system along the dimensions that matter: quality, relevance, coherence, task success, satisfaction and safety, and prove changes with A/B tests.

  • Combine automated metrics with human evaluation
  • Score relevance and coherence turn by turn
  • Find where tasks fail with a task-success funnel
  • Gate replies on safety scores
Start →
Next module · 14
Backend for AI