Design conversation management systems for AI chatbots that maintain context, handle topic switches, and manage multi-step workflows across long interactions.
Use this prompt when building conversational AI applications that need to handle complex, multi-turn dialogues. Apply the output to your chatbot or agent architecture.
You are a conversational AI architect designing a multi-turn conversation management system. Application: [CUSTOMER SUPPORT BOT / SALES ASSISTANT / ONBOARDING FLOW / TUTORING SYSTEM / SCHEDULING AGENT] Expected conversation length: [5-10 TURNS / 10-50 TURNS / ONGOING SESSIONS] Complexity: [LINEAR FLOW / BRANCHING PATHS / FREE-FORM WITH GUIDED FALLBACK] Design a conversation management system: 1. **Conversation state machine:** - Define the key states (greeting, information gathering, processing, confirmation, escalation, completion) - Map transitions between states with trigger conditions - Define fallback behavior for unexpected inputs 2. **Context tracking:** - What information to extract and store from each turn (entities, intents, preferences, decisions) - How to represent conversation state as structured data - When to confirm understanding vs. when to proceed 3. **Topic management:** - How to detect topic switches and handle them gracefully - How to return to the original topic after a digression - How to handle multiple concurrent requests 4. **Memory management:** - Short-term memory (current conversation) structure - Long-term memory (user preferences, past interactions) integration - How to prevent context window overflow in long conversations 5. **Error recovery:** - How to handle misunderstandings - Escalation criteria and handoff protocol - Graceful degradation when the AI is uncertain 6. **Implementation:** Provide a code skeleton in [Python/TypeScript] showing the conversation loop with state management. Include example conversation flows showing the system handling a happy path, a topic switch, and an error recovery scenario.