Amazon Lex — Banking Chatbot with Custom Slots
Built "BB, the Banking Bot" in Amazon Lex — from a first welcome intent and tuned fallback handling through to a CheckBalance intent with a custom accountType slot and date-of-birth verification before any balance is returned.
- Problem
- Customers word banking questions in endless ways, and balances must never be shown unverified.
- AWS services
- Amazon LexIAM
- Result
- Two intents, a custom slot with synonyms, and date-of-birth verification before any balance.
Architecture
- Step 1: The customer asks in their own words, e.g. “What's my savings balance?”
- Step 2: Lex classifies the intent. Below 40% confidence it asks the customer to rephrase.
- Step 3: CheckBalance elicits the account type: Checking, Savings or Credit, with synonyms like “visa” or “amex”.
- Step 4: A dateOfBirth slot verifies identity before anything sensitive is shared.
- Step 5: Only then is the balance returned.
- Confidence threshold tuned
- 0.40
- Welcome + CheckBalance
- 2 intents
- Account type + DOB verification
- 2 slots
Why it matters
Shifts repetitive greeting and balance enquiries to secure self-service. The bot handles two core intents, captures account context and checks date of birth before it returns anything sensitive.
The problem in detail
Bank customers ask the same handful of questions in endlessly different wording. A rigid command-driven bot fails on typos and natural phrasing, and a bot that answers balance questions without verifying identity is a security problem.
What I built
- 01
Created the Lex bot from scratch with an IAM role carrying basic permissions, then added English (US) with a chosen voice.
- 02
Set the intent classification confidence threshold to 0.40, so the bot only answers when it is at least 40% sure it understood.
- 03
Built a WelcomeIntent with multiple greeting utterances and a friendly branded response.
- 04
Replaced Lex's random fallback retries with ordered, escalating prompts — "Hmm, could you try rephrasing that?", then "In a few words can you repeat your query?" — so failed turns feel human rather than repetitive.
- 05
Added a CheckBalance intent trained on natural phrasing such as "What's my {accountType} balance?" and "How much is in my {accountType}?".
- 06
Created a custom accountType slot type with Checking, Savings and Credit values, plus synonyms (visa, mastercard, amex, american express) so real-world wording resolves correctly.
- 07
Configured slot elicitation order and prompts, escalating from "Which account — Checking or Savings?" to a clarifying retry.
- 08
Added a dateOfBirth slot using AMAZON.Date as a verification step before any balance is disclosed.
- 09
Tested end to end in the Lex test window and used Inspect to confirm slot values and intent fulfilment in the JSON input/output.
Evidence
01 / 08
Stage 01 — adding English (US) to the bot with a chosen voice and the intent classification confidence threshold set to 0.40.