Skip to content

πŸ’¬ 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:

graph TB subgraph "User Interface" UI[Chat Interface
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)ΒΆ

%%{init: {'theme':'base', 'themeVariables': { 'primaryColor':'#fce4ec','primaryTextColor':'#000','primaryBorderColor':'#e91e63','lineColor':'#e91e63','secondaryColor':'#f3e5f5','tertiaryColor':'#fff3e0'}}}%% sequenceDiagram participant User participant UI as Chat UI participant Backend as Bedrock Agent or
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

  1. Go to Workshop UI
  2. Click the Chat icon (bottom right)

Workshop UI - Chat Icon Location

Workshop UI - Chat Icon Location

  1. Chat panel opens
Workshop UI - Chat Panel Open

Step 2: Select Coveo Backend

  1. Ensure backend is set to "Coveo"
  2. Observe: Chat interface with Coveo backend

Chat interface with Coveo backend

Chat interface with Coveo backend

Step 3: Test Single-Turn Behavior

Turn 1: Basic Question

I found errors in my credit report, what’s first?

Expected: Conversational response with source citations


Turn 2: Multi-part Question

What were we discussing earlier
Expected: The chatbot doesn't recollect anything, since answer API is single turn

Chat interface with Coveo backend single turn

Chat interface with Coveo backend single turn response


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

Chat interface with Bebrock Agent backend

Step 2: Make a note of the Bedrock Agent Session ID

Chat interface with Bedrock Agent backend session ID

Chat interface with Bebrock Agent backend session ID

Step 3: Test Credit Remediation Scenario

Turn 1: Basic Question

I found errors in my credit report, what’s first?

Expected: Conversational response with source citations


Turn 2: Multi-part Question

What were we discussing earlier
Expected: Previous context recollection (same session)


Chat recollection with Bedrock Agent same session

Chat recollection with Bedrock Agent same session

Turn 3: followup Question

Form a 60‑day SMART goal plan

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

What were we discussing earlier
Expected: Previous context recollection (same session)


Browser Refresh Chat recollection with Bedrock Agent

Browser Refresh Chat recollection with Bedrock Agent

Turn 5: followup Question

Any dispute follow-up timing guidance?
Expected: Previous context recollection and presenting a response aligned to the credit report issues


Context recollection with Bedrock Agent

Context 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

  1. Change backend to "Coveo MCP Server Agent"
  2. Start a new conversation with the Chatbot

Multi Turn Conversation within a session in Agentcore MCP Agent

Multi Turn Conversation within a session in Agentcore MCP Agent

Step 2: Test Retirement Protection Scenario

Turn 1: Basic Question

dividend and capital gain impact on retirement

Expected: Conversational response with source citations


Turn 2: Multi-part Question

for low risk investment before retirement what do you recommend?

Expected: Previous context recollection and relevant response


Multi Turn Conversation with Agentcore MCP Agent

Multi Turn Conversation with Agentcore MCP Agent

Turn 3: Recollection

Sorry I went to grab coffee!, What did we discuss earlier?

Expected: Previous context recollection and relevant response

Chat recollection with Agentcore MCP Agent in same session

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

What were we discussing earlier
Expected: Previous context recollection (same session)


Browser Refresh Chat recollection with Agentcore MCP Agent

Browser Refresh Chat recollection with Agentcore MCP Agent

Turn 5: followup Question

for tax efficient growth what do you recommend?
Expected: Previous context recollection and presenting a response aligned to the retirement


Context recollection with Agentcore MCP Agent

Context 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

New Session with Agentcore MCP Agent

Turn 6: followup Question

What did we discuss in the past?
Expected: Previous context recollection with a summary of all prior conversations

Multi Turn Conversation across sessions with Agentcore MCP Agent

Multi 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ΒΆ

  1. Coveo Direct is best for simple, stateless FAQ scenarios
  2. Bedrock Agent excels at conversational support with session memory
  3. Coveo MCP provides the most comprehensive experience with cross-session memory
  4. Memory dramatically improves user experience in multi-turn conversations
  5. Tool orchestration enables more comprehensive responses
  6. Choose the right backend based on use case complexity and requirements

πŸŽ“ Workshop Complete!ΒΆ

Congratulations! You've completed all 4 labs and experienced:

  1. Lab 1: Direct Coveo API integration
  2. Lab 2: Bedrock Agent with tool integration
  3. Lab 3: AgentCore Runtime with MCP orchestration
  4. Lab 4: Multi-turn conversational comparison

What You've LearnedΒΆ

πŸ—οΈ Three Architectures
Direct API, Agent, and AgentCore patterns
πŸ”§ Tool Integration
Single and multi-tool orchestration
🧠 Memory Management
Session and cross-session memory
πŸ’¬ Conversational AI
Multi-turn conversations and context
πŸ“Š Observability
Logs, traces, and monitoring
🎯 Best Practices
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.