Multi-Turn Conversation
Multi-Turn Conversation
Overview
Flow ID: multi-turn-conversation
Category: Chat Interactions
Estimated Duration: Variable
User Role: All Users
Complexity: Simple
Purpose: Describes the AI’s ability to maintain “memory” of previous exchanges within a chat session. This allows users to ask follow-up questions (“What about the second point?”) without repeating context.
Trigger
What initiates this flow:
- User follows up on a previous answer
Prerequisites
Before starting, users must have:
- An active chat with at least one message exchange
User Intent Analysis
Primary Intent
Refine, expand, or correct the AI’s previous output through natural dialogue.
Step-by-Step Flow
Main Path (Happy Path)
Step 1: Initial Question
- User Action: “List 3 fruits.”
- AI Response: “1. Apple, 2. Banana, 3. Cherry.”
Step 2: Follow-Up (Implicit Context)
- User Action: “Which one is red?” (User doesn’t say “fruit”).
- System Action: Sends [History + New Prompt] to LLM.
- AI Response: “Both Apples and Cherries are typically red.” (Correctly resolving reference).
Step 3: Context Limit Handling
- Condition: Conversation exceeds Context Window (e.g., > 4096 tokens).
- System Action: “Sliding Window” - Oldest messages are dropped from the prompt sent to LLM.
- User Experience: AI might “forget” the very first thing said if chat is very long.
Error States & Recovery
Error 1: AI Forgets Context
Cause: Chat history exceeded token limit
User Experience: User asks “What was the date again?” and AI says “I don’t know what date you mean.”
Recovery: User must restate key facts. Or increase Context Window Size.
Design Considerations
- History Pruning: Intelligently summarize old history rather than just hard-deleting it (if supported).
- Visuals: Auto-scroll to bottom on new message.
Related Flows
Technical References
src/engines/chat-memory.jssrc/constants/model-params.js