Tutorial: Add complex topics
Reading the action notation in this lesson:
This lesson references functions like start_sms_flow and transfer_call. You’ll learn how to create and wire these in Lesson 2: Using tools and Lesson 3: Return values.
For now, read them as named actions:
start_sms_flowwithsms_id="bill_request"→ sends an SMS using the template called “bill_request”transfer_callwithtransfer_reason="BILLING"→ transfers the caller to a human agent for billing
Focus on the topic patterns and when each applies. The implementation details come next.
Some FAQs need to guide a decision, send a text, or route the conversation. This lesson covers reliable patterns for topics that retrieve correctly, behave in Chat and Call, and recover from unexpected responses.
What makes a Managed Topic complex?
A topic is considered complex if it does more than return static information.
In the UI, complex topics almost always use both Content and Actions, and often rely on functions to control what happens next.
Topic creation flow
Before you write anything
Answer these first:
- What is the intended outcome? (e.g., user receives SMS link, or gets transferred)
- What happens if the user says no?
- What happens if the user gives an unexpected answer?
An example workflow for complex topics
Step 1: Retrieval
If a topic doesn’t retrieve reliably, nothing else matters. Retrieval depends most on three things, in this order:
- Topic name
- Sample questions
- Content
Most early failures are derived from retrieval.
Why topic naming is critical
The topic name is one of the strongest signals used to decide which content to surface. A good name should represent one specific user intent, for example:
bill_request_previous_stay
Why this works:
- It represents a single, concrete intent.
- It distinguishes between similar scenarios (previous stay vs current or future).
- It mirrors how the system classifies the request.
- It reduces collisions with any other billing topics you may add as your FAQs grow.
Here are some bad examples:
billinghelp_with_billmisc_billing
These fail because they are too broad. They force the system to guess, increase the chance of the wrong topic being selected, and become harder to maintain as you add more billing flows.
Step 2: Write sample questions like real users
Think of sample questions as training data.
For complex topics, aim for variety. Include:
- Direct commands
- Polite requests
- Incomplete phrasing
- Synonyms and alternate terminology
- Call-style filler language
For example, for a billing topic:
- Can you send me my invoice
- I stayed last week and need a receipt
- Text me my bill
- I need a folio from my last stay
- Uh I need billing help
Step 3: Write Content like a call script
Content should sound natural when spoken out loud.
As a rule, it should:
- Lead with what happens next
- Ask one clear question
- Be short enough to say in a single breath
Avoid explanations unless they are strictly necessary for the decision the user is being asked to make.
Check your understanding
A caller asks 'Can you send me my bill?' but the agent responds with a generic FAQ answer instead of offering SMS. What is the most likely cause?
- The SMS integration is disabled
- The complex topic’s retrieval failed – check the topic name and sample questions
- The topic triggered but the Actions section is empty – no SMS action was configured
- Response Controls are blocking the SMS offer
Answer: The complex topic’s retrieval failed – check the topic name and sample questions
If the complex topic never triggers, the agent falls back to simpler matches. Fix retrieval first: check the topic name is specific (e.g., ‘send_bill_sms’), add sample questions like ‘can you send me my bill’ and ‘email me my invoice’, then re-test before debugging actions.
Core complex patterns (with examples)
The patterns below cover most real-world use cases. You can copy them directly and adapt the wording.
Pattern 1: Offer SMS with fallback to handoff
Use when
- The user needs a link, form, or written instructions.
Topic name
bill_request_previous_stay
Content
Actions
Why this works
- Consent is explicit
- Only two options are presented
- There is a clear fallback
Pattern 2: Conditional SMS (user chooses)
Use when
- Multiple follow-ups are possible.
Topic name
promotions_current
Content
Actions
Handle loose answers such as “the first one” or “events please”.
Pattern 3: Direct handoff (no agent reply)
Use when
- The agent should not attempt to resolve the request.
Topic name
out_of_scope_spanish
Content (leave empty)
Actions
- Immediately call
transfer_callwithtransfer_reason="SPANISH"
This avoids unnecessary turns and makes ownership explicit.
Pattern 4: Answer, then offer handoff
Use when
- The agent can answer, but escalation may still be useful.
Topic name
late_checkout
Content
Standard checkout is at 11 a.m.
If you need to check out later than that, I can connect you with the front desk to see what’s available. Would you like me to do that?
Actions
- If yes → handoff to front desk
- If no → end politely
Pattern 5: Clarify, then route
Use when
- The intent is genuinely ambiguous.
Topic name
reservation_change
Content
Are you looking to change an existing reservation, or make a new one?
Actions
- If “change” → route to reservation modification
- If “new” → route to booking flow
Rules:
- Ask one question only
- Do not stack clarifications
- Complete the flow immediately after the answer
Pattern 6: Info + action hybrid
Use when
- The user needs context and a next step.
Topic name
lifeline_program
Content
Lifeline is a government-sponsored program that provides qualifying customers with discounted phone or broadband service.
I can text you more details, or connect you with a specialist. Which would you prefer?
Actions
- SMS →
start_sms_flow - Handoff →
transfer_call
Pattern 7: Info-only (still complex in practice)
Use when
- The information is static but sensitive or high-impact.
Topic name
housekeeping_hours
Content
Housekeeping is available daily from 9 a.m. to 5 p.m.
If you need service outside those hours, I can connect you with the front desk.
Actions
- No automatic action
- Offer handoff only if asked
Creating a complex topic in the UI
Write Content
In the Content field, write the agent’s response in call-script style – short, spoken-friendly, ending with one clear question.
Writing content that works in Call
Do
- Use short sentences
- End with a single question
- Make one decision per turn
Don’t
- Use paragraphs
- Include internal notes
- Ask multiple questions at once
Action design rules
- One primary outcome per turn
- Explicit consent before SMS
- A safe fallback for silence or confusion
- Prefer clarity over complex branching
Check your understanding
What is the most critical step when building a complex topic?
- Writing detailed content in the answer field
- Adding multiple action branches
- Making retrieval work reliably
- Setting up SMS flows before other actions
Answer: Making retrieval work reliably
If a topic doesn’t trigger correctly, nothing else matters – the best content and actions in the world are useless if the topic is never reached.
Verification checklist
Retrieval
- Topic triggers with at least 10 phrasing variations
Chat
- Consent is respected
- No looping
Call
- Responses are listenable
- Users can interrupt naturally
- No dead ends
Failure cases
- Unexpected answers recover cleanly
- SMS failures route correctly
Common pitfalls
- Overloading a topic with multiple intents
- Writing perfect answers but weak retrieval
- Delaying Call testing
Fix: ensure retrieval works reliably first, keep topics single-purpose, and test varied phrasing early.
Try it yourself
Challenge: Write a 'bill request' complex topic
Write a complete complex topic for a hotel guest requesting a bill from a previous stay. Use Pattern 1 (SMS with fallback to handoff).
Include:
- Topic name
- Four sample questions
- Content (2–3 sentences, call-script style)
- Actions (3 branches: agree to SMS, decline SMS, SMS fails)
Hint
The topic name should describe one specific scenario (not just “billing”). Content should lead with what happens next and end with one clear question. Actions should cover the “yes”, “no”, and “error” paths.
Example solution
Topic name: bill_request_previous_stay
Sample questions:
- can you send me my bill from last week
- I need a receipt from my last stay
- text me my invoice
- how do I get a folio for my previous visit
Content:
Actions:
- If user agrees →
start_sms_flowwithsms_id="bill_request" - If user declines → transfer to front desk
- If SMS fails → transfer automatically
Check your understanding
Which pattern should you use when the agent can answer but escalation may still be useful?
- Pattern 1: Offer SMS with fallback to handoff
- Pattern 3: Direct handoff (no agent reply)
- Pattern 5: Clarify, then route
- Pattern 4: Answer, then offer handoff
Answer: Pattern 4: Answer, then offer handoff
Pattern 4 answers first, then offers a transfer – rather than escalating immediately or withholding information. It gives users what they need while keeping escalation available.

