π¬ Lab 4: Chatbot Case Deflection
Patterns: All Three Backends (Coveo Direct API, Bedrock Agent, AgentCore Runtime + MCP)
Duration: 20 minutes
Objective: Test multi-turn conversations across all three backends and explore conversational AI for case deflection.
Throughput Notice
If Bedrock doesn't respond immediately, wait 30-60 seconds and retry. This is normal during peak workshop usage.
π― Lab GoalsΒΆ
By the end of this lab, you will:
- β Test multi-turn conversations across all three backends
- β Compare single-turn vs multi-turn capabilities
- β Explore session memory and cross-session memory
- β Understand case deflection use cases
- β Identify which backend fits different scenarios
ποΈ Architecture OverviewΒΆ
In this lab, you'll test the Chatbot Interface with all three backends:
Multi-turn Support] end subgraph "Backend Options" B1[Coveo
Stateless] B2[Bedrock Agent
Session + Cross-session Memory] B3[Coveo MCP
Session + Cross-session] end subgraph "Memory Types" M1[No Memory
Each turn independent] M2[Session + Cross-session Memory
Context across logins] M3[Session + Cross-session Memory
Remember across logins] end UI --> B1 UI --> B2 UI --> B3 B1 -.-> M1 B2 -.-> M2 B3 -.-> M3 style UI fill:#e1f5fe style B1 fill:#e8f5e9 style B2 fill:#fff3e0 style B3 fill:#f3e5f5
π Lab 4 Sequence Diagram (with Bedrock Agent or AgentCore Runtime backends)ΒΆ
AgentCore Runtime participant Memory as Cross-Session Memory
(Memory ID: user-123) Note over User,Memory: Session 1 - Monday User->>+UI: "Help me plan retirement" UI->>+Backend: Invoke with question Backend->>+Memory: Retrieve context (memory ID) Memory-->>-Backend: Empty (first session) Backend->>Backend: Generate response Backend->>+Memory: Store conversation Memory-->>-Backend: Context saved Backend-->>-UI: Retirement planning guidance UI-->>-User: Response with advice Note over User,Memory: User Logs Out Note over User,Memory: Session 2 - Tuesday (Next Day) User->>+UI: "What were we discussing in the past?" UI->>+Backend: Invoke with question Backend->>+Memory: Retrieve context (memory ID) Memory-->>-Backend: Previous retirement discussion Backend->>Backend: Generate response with context Backend->>+Memory: Update conversation Memory-->>-Backend: Context updated Backend-->>-UI: Response with history UI-->>-User: "Yesterday we discussed retirement planning..." Note over User,Memory: Pattern 4: Cross-Session Memory Note over Backend,Memory: Memory persists across sessions
π Lab ExercisesΒΆ
Exercise 4.1: Test Single-Turn Conversations (5 minutes)ΒΆ
Objective: Test Coveo backend (stateless) to understand single-turn behavior.
Step 1: Open Chat Interface
- Go to Workshop UI
- Click the Chat icon (bottom right)
Workshop UI - Chat Icon Location

- Chat panel opens
Step 2: Select Coveo Backend
- Ensure backend is set to "Coveo"
- Observe: Chat interface with Coveo backend
Chat interface with Coveo backend

Step 3: Test Single-Turn Behavior
Turn 1: Basic Question
Expected: Conversational response with source citations
Turn 2: Multi-part Question
Expected: The chatbot doesn't recollect anything, since answer API is single turnChat interface with Coveo backend single turn

Observation:
- β No memory of previous question
- β Each turn is independent
- β Fast responses
- β Good for FAQ-style questions
Exercise 4.2: Test Multi-Turn with Bedrock Agent (7 minutes)ΒΆ
Objective: Test Bedrock Agent backend with session memory.
Step 1: Refresh browser to start a new session and then Switch to Bedrock Agent
Change backend to "Bedrock Agent" Open chat interface
Chat interface with Bedrock Agent backend

Step 2: Make a note of the Bedrock Agent Session ID
Chat interface with Bedrock Agent backend session ID

Step 3: Test Credit Remediation Scenario
Turn 1: Basic Question
Expected: Conversational response with source citations
Turn 2: Multi-part Question
Expected: Previous context recollection (same session)Chat recollection with Bedrock Agent same session

Turn 3: followup Question
Expected: Bedrock agent understood the prior context of credit report and provided contextual reponse and source citations.
Refresh browser now to start a new session. Ensure Bedrock Agent is selected
Notice the same session ID (compare with the one you noted earlier)
Session ID local storage
- The solution is designed to store the session ID in local storage, and so upon refresh of the browser, the existing session ID is maintained
Turn 4: followup Question
Expected: Previous context recollection (same session)Browser Refresh Chat recollection with Bedrock Agent

Turn 5: followup Question
Expected: Previous context recollection and presenting a response aligned to the credit report issuesContext recollection with Bedrock Agent

Observation:
- β Remembers conversation context in a session and across sessions
- β Understands follow-up questions
- β Maintains topic continuity
- β Natural conversation flow
Session Memory
Bedrock Agent maintains context within a session and cross-sessions (across logins) with external memory.
Exercise 4.3: Multi-Turn Conversations with Agentcore MCP Agent (8 minutes)ΒΆ
Objective: Test Coveo MCP Server Agent backend with advanced memory and multi-tool orchestration.
Step 1: Refresh browser and Switch to Coveo MCP Server Agent
- Change backend to "Coveo MCP Server Agent"
- Start a new conversation with the Chatbot
Multi Turn Conversation within a session in Agentcore MCP Agent

Step 2: Test Retirement Protection Scenario
Turn 1: Basic Question
Expected: Conversational response with source citations
Turn 2: Multi-part Question
Expected: Previous context recollection and relevant response
Multi Turn Conversation with Agentcore MCP Agent

Turn 3: Recollection
Expected: Previous context recollection and relevant response
Chat recollection with Agentcore MCP Agent in same session

Refresh browser now to start a new session. Ensure you switch to Coveo MCP server Agent
Notice the same session ID (compare with the one you noted earlier)
Session ID and Actor ID
- The solution is designed to store the session ID in local storage, and so upon refresh of the browser, the existing session ID is maintained (persist across browser refreshes)
- Actor ID (unique value retrieved from JWT), is based on user identity and enables conversation persistence across different sessions. This enables cross-session memory with Agentcore MCP Agent
Turn 4: followup Question
Expected: Previous context recollection (same session)Browser Refresh Chat recollection with Agentcore MCP Agent

Turn 5: followup Question
Expected: Previous context recollection and presenting a response aligned to the retirementContext recollection with Agentcore MCP Agent

Now to test fresh session, you can click End Chat & Save Memory. Select Coveo MCP server Agent as backend and open the chatbot and test
Session ID changes now
For cross-sessions, the session ID changes
New session with Agentcore MCP Agent

Turn 6: followup Question
Expected: Previous context recollection with a summary of all prior conversationsMulti Turn Conversation across sessions with Agentcore MCP Agent

Observation:
- β Remembers conversation context in a session and across sessions and across log-out and log-in
- β Understands follow-up questions
- β Maintains topic continuity
- β Natural conversation flow
Session Memory
Agentcore MCP Agent maintains context within a session and cross-sessions (across logins) by using AgentCore memory.
π Key ObservationsΒΆ
Backend ComparisonΒΆ
Coveo Direct API
Pattern: Direct API integration
Memory: None (stateless)
Best for: FAQ, quick lookups, high-volume search
Speed: Fastest (~200ms)
Context: None
Bedrock Agent with Coveo
Pattern: Agent with Coveo passage tool
Memory: Session + Cross-session (memory ID from Cognito)
Best for: Support conversations, ongoing relationships
Speed: Medium (~2-4s)
Context: Within and across sessions
AgentCore with Coveo MCP
Pattern: AgentCore Runtime + MCP protocol
Memory: Session + Cross-session (actor ID from Cognito)
Best for: Complex consultations, multi-tool workflows
Speed: Slower (~3-6s)
Context: Within and across sessions
Conversation Quality ComparisonΒΆ
| Aspect | Coveo Direct API | Bedrock Agent with Coveo | AgentCore with Coveo MCP |
|---|---|---|---|
| Follow-ups | β Don't work | β Work well | β Work excellently |
| Pronouns | β Not understood | β Understood | β Understood |
| Context | β Lost | β Maintained | β Enhanced |
| Memory | β None | β Session + Cross-session | β Session + Cross-session |
| Memory ID | β N/A | β User-specific (Cognito) | β User-specific (Cognito) |
| Tool Usage | Direct API calls | 1 tool (supports multiple) | Multiple tools |
| Response Depth | Good | Better | Best |
π‘ Use Case ScenariosΒΆ
Scenario 1: FAQ BotΒΆ
Best Backend: Coveo (Direct)
Use Case: Customer has quick questions
Example: - "What is FDIC insurance?" - "What are your business hours?" - "How do I reset my password?"
Why Coveo: - Fast responses - No memory needed - Simple questions - High volume
Scenario 2: Support ConversationΒΆ
Best Backend: Bedrock Agent
Use Case: Customer needs help with a problem
Example: - "I'm having trouble with my account" - "Can you help me understand this charge?" - "I need to update my information"
Why Bedrock Agent: - Multi-turn support - Context retention - Natural conversation - Problem resolution
Scenario 3: Financial ConsultationΒΆ
Best Backend: Coveo MCP
Use Case: Customer needs comprehensive advice
Example: - "Help me plan for retirement" - "Compare investment options for my situation" - "Analyze my portfolio and recommend changes"
Why Coveo MCP: - Multi-tool orchestration - Cross-session memory - Comprehensive analysis - Long-term relationship
β Validation ChecklistΒΆ
Before completing the workshop, verify:
- Tested Coveo backend (single-turn)
- Tested Bedrock Agent backend (multi-turn)
- Tested Coveo MCP backend (advanced multi-turn)
- Observed memory differences
- Tested session memory
- Tested cross-session memory (Coveo MCP)
- Compared response quality across backends
- Understand which backend fits which use case
π Lab 4 Complete!ΒΆ
You've successfully:
- β Tested all three backend modes with chatbot
- β Compared single-turn vs multi-turn conversations
- β Explored session and cross-session memory
- β Understood case deflection scenarios
- β Identified optimal backend for different use cases
Key TakeawaysΒΆ
- Coveo Direct is best for simple, stateless FAQ scenarios
- Bedrock Agent excels at conversational support with session memory
- Coveo MCP provides the most comprehensive experience with cross-session memory
- Memory dramatically improves user experience in multi-turn conversations
- Tool orchestration enables more comprehensive responses
- Choose the right backend based on use case complexity and requirements
π Workshop Complete!ΒΆ
Congratulations! You've completed all 4 labs and experienced:
- Lab 1: Direct Coveo API integration
- Lab 2: Bedrock Agent with tool integration
- Lab 3: AgentCore Runtime with MCP orchestration
- Lab 4: Multi-turn conversational comparison
What You've LearnedΒΆ
Direct API, Agent, and AgentCore patterns
Single and multi-tool orchestration
Session and cross-session memory
Multi-turn conversations and context
Logs, traces, and monitoring
When to use each pattern
Next StepsΒΆ
- Review architecture diagrams
- Explore code in the repository
- Consider which pattern fits your use case
- Plan your implementation strategy
Thank You for Participating!
You've completed the Coveo + AWS Bedrock Workshop
Questions? Ask your instructor or explore the additional resources.