Architecting Context-Aware Bot Prompts using Generative AI and Customer Journey Data
What This Guide Covers
This masterclass details the implementation of Dynamic Bot Personalization. By the end of this guide, you will be able to architect a bot flow that uses Genesys Cloud Journey Data and Generative AI to tailor its prompts to each individual customer’s recent behavior. You will learn how to move beyond static “How can I help you?” greetings to context-aware prompts like “I see you were just looking at the Gold Membership upgrade; would you like help completing that today?” This guide covers the integration of the Journey API, Data Actions, and LLM Prompt Engineering.
Prerequisites, Roles & Licensing
Context-aware prompting requires access to customer session data and an integrated AI engine.
- Licensing: Genesys Cloud CX 1, 2, or 3 with AI Experience (Predictive Engagement/Bot Flows).
- Permissions:
Journey > Action Map > ViewArchitect > Flow > View/Edit
- OAuth Scopes:
journey,architect. - AI Infrastructure: Genesys Cloud Digital Bot Flow or Architect Bot Connector.
The Implementation Deep-Dive
1. Capturing the “Journey Context”
Before the customer even says “Hello,” the bot should know what they’ve been doing.
Implementation Step:
- Use the Journey API or Predictive Engagement to track the customer’s website session.
- In your Digital Bot Flow, add a Data Action to
GET /api/v2/journey/sessions/{sessionId}/events. - Extract signals: Identify the last 3 pages visited, any “Abandoned” forms, or “High-Value” items added to the cart.
2. Designing the “Generative Prompt” Middleware
You cannot hard-code 1,000 different greetings. Instead, use an LLM to generate the prompt dynamically.
Architectural Reasoning:
The bot shouldn’t just repeat the journey data. It should use the data to create a Human-Centric opening.
- Input to LLM: “User abandoned a cart with a $500 TV. They have been a customer for 5 years.”
- LLM Prompt Template: “Generate a helpful, concierge-style greeting for a loyal customer who just had trouble with their checkout process.”
- LLM Output: “Welcome back! I noticed you were looking at the Ultra-HD TV and ran into an issue at checkout. As a thank you for being a 5-year member, I’d be happy to help you finish that order right now.”
3. Implementing the “Handoff” Context
If the bot cannot resolve the issue, the “Context” must follow the customer to the human agent.
Implementation Pattern:
- Store the AI-generated context in Participant Data (e.g.,
context_summary). - In the agent’s Interaction Widget, display this summary.
- The Benefit: The agent doesn’t ask “How can I help you?” but instead says “I see you’ve already discussed the TV checkout issue with our bot; I have your cart open right here.”
4. Dynamic “Personality” Tuning
You can use Generative AI to adjust the Tone of the bot based on the customer’s sentiment or value tier.
The Strategy:
- Tier 1 (VIP): Use a formal, proactive tone (“Mr. Smith, it is an honor to assist you again…”).
- Tier 2 (General): Use a friendly, direct tone (“Hi! I can help you with that…”).
- Sentiment-Aware: If the customer’s first message is typed in ALL CAPS, the AI adjusts the prompt to be highly empathetic and de-escalating (“I understand you are frustrated, and I’m prioritizing your request right now…”).
Validation, Edge Cases & Troubleshooting
Edge Case 1: “Stale” Journey Data
- The failure condition: The bot says “I see you were looking at shoes,” but the customer is actually calling because their house is on fire.
- The root cause: The system is prioritizing a website session from 4 hours ago over the customer’s current emergency.
- The solution: Implement Time-to-Live (TTL) on Context. Only use journey data that is less than 15 minutes old. If the data is older, revert to a generic (but still polite) greeting.
Edge Case 2: The “Creepy” AI Factor
- The failure condition: The customer feels stalked because the bot knows too much about their browsing history.
- The root cause: Over-exposure of tracking data in the prompt.
- The solution: Use Subtle Contextualization. Instead of saying “I saw you spent 5 minutes on the Refund Policy page,” say “I’m specialized in refund and billing questions-is that what you’re looking for today?”