Follow-Up Questions¶
Overview¶
Follow-Up Questions are AI-generated clickable suggestions that help visitors continue the conversation. After the bot responds, it suggests 3-5 relevant questions the visitor might want to ask next.
User Experience¶
After receiving a bot response, visitors see:
[Bot's answer to their question]
👉 You might also want to ask:
• How does pricing work?
• Can I see a demo?
• What integrations do you support?
Clicking a suggestion sends it as the visitor's next message.
Architecture¶
Emoji Marker¶
- 👉 (pointing right) in the response indicates follow-up suggestions are available
- The marker is detected by
dialog_state_extractor.py - When present, the
suggestion_routerroutes tofollow_up_suggester_node
Key Files¶
Backend¶
| File | Purpose |
|---|---|
ixchat/nodes/follow_up_suggester.py |
Generates contextual follow-up questions |
ixchat/nodes/suggestion_router.py |
Routes based on emoji markers |
ixchat/nodes/dialog_state_extractor.py |
Extracts 👉 marker |
prompts/website-agent/suggested-questions.md |
Prompt template (repo file) |
Frontend¶
| File | Purpose |
|---|---|
shared/src/components/FollowUpQuestions.tsx |
Renders clickable suggestions |
Generation Context¶
The LLM generates suggestions based on:
- Bot's answer - Most important, directly references what was said
- User's question - Original query context
- Conversation history - Previous exchanges
- Visitor profile - Company, sector, sub-sector
- Retrieved context - Available topics in knowledge base
Output Format¶
class FollowUpQuestions(BaseModel):
questions: list[str] = Field(
description="List of 3-5 follow-up questions",
min_length=3,
max_length=5,
)
Routing Logic¶
Follow-up suggestions are skipped when the response contains:
| Marker | Meaning |
|---|---|
| 👇 | Demo proposal (uses suggested answers instead) |
| 💌 | Content gating offer |
| 👈 | Other special handling |
Frontend Component¶
<FollowUpQuestions
questions={suggestedFollowUps}
onQuestionClick={(question) => sendMessage(question)}
primaryColor={themeColor}
/>
Features: - Staggered animation on appearance - Click to send as next message - Respects theme colors
Debugging¶
Backend logs use the 💡 [FOLLOW-UP SUGGESTER] prefix:
💡 [FOLLOW-UP SUGGESTER] Generating follow-up questions based on assistant's answer
📝 Using assistant's answer for follow-up generation (length: 450 chars)
📚 Retrieved context available (length: 2000 chars)
Testing¶
rose-chat does not print follow-ups. After a turn, read them from the checkpoint:
deserialized, values = await chatbot.get_deserialized_state(session_id), then
values["suggested_follow_ups"]. To re-sample one turn, await follow_up_suggester_node(None, state)
on a captured state, with visitor_profile set to deserialized.visitor_profile (the raw
checkpoint dict fails on attribute access).
Related¶
- Suggested Answers - Pre-filled answers to bot questions
- Dynamic Questions - URL-based initial questions