Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bank Template

The bank template provides a complete digital banking assistant for financial institutions, enabling customers to manage accounts, transfers, payments, cards, and investments through conversational AI.

Topic: Digital Banking Assistant

This template is perfect for:

  • Retail banking customer service
  • Account management automation
  • Payment and transfer processing
  • Card services and support
  • Investment inquiries

The Code

ADD TOOL "check-balance"
ADD TOOL "transfer-money"
ADD TOOL "pay-bill"
ADD TOOL "card-services"
ADD TOOL "loan-inquiry"
ADD TOOL "investment-info"
ADD TOOL "transaction-history"
ADD TOOL "open-account"

ADD BOT "fraud-detector" WITH TRIGGER "suspicious, fraud, unauthorized, stolen, hack"
ADD BOT "investment-advisor" WITH TRIGGER "invest, stocks, funds, portfolio, returns, CDB, LCI"
ADD BOT "loan-specialist" WITH TRIGGER "loan, financing, credit, mortgage, empréstimo"
ADD BOT "card-services" WITH TRIGGER "card, credit card, debit card, block card, limit"

USE KB "banking-faq"

CLEAR SUGGESTIONS

ADD SUGGESTION "balance" AS "Check my balance"
ADD SUGGESTION "transfer" AS "Make a transfer"
ADD SUGGESTION "pix" AS "Send PIX"
ADD SUGGESTION "bills" AS "Pay a bill"
ADD SUGGESTION "card" AS "Card services"
ADD SUGGESTION "history" AS "Transaction history"
ADD SUGGESTION "invest" AS "Investment options"
ADD SUGGESTION "loan" AS "Loan information"

SET CONTEXT "You are a professional banking assistant for General Bank. Help customers with accounts, transfers, payments, cards, loans, and investments. Always verify identity before sensitive operations. Be helpful and secure. Never ask for full card numbers or passwords in chat."

BEGIN TALK
**General Bank** - Digital Banking Assistant

Welcome! I can help you with:
• Account balance and statements
• Transfers and PIX
• Bill payments
• Card services
• Investments
• Loans and financing

Select an option below or tell me what you need.
END TALK

BEGIN SYSTEM PROMPT
You are a secure banking assistant.

Security rules:
- Never display full account numbers
- Mask card numbers showing only last 4 digits
- Require confirmation for transactions over $1000
- Log all sensitive operations
- Escalate fraud concerns immediately
END SYSTEM PROMPT

Sample Dialogs

These conversations show how the bank template works in real-world scenarios.

Dialog 1: Check Balance

Dialog 2: PIX Transfer

Dialog 3: Block Lost Card

Dialog 4: Fraud Detection Escalation

Keywords Used

KeywordPurpose
ADD TOOLRegister banking operation tools
ADD BOTRegister specialized bots with triggers
USE KBLoad banking FAQ knowledge base
ADD SUGGESTIONCreate quick action buttons
SET CONTEXTDefine bot behavior and security rules
BEGIN TALKWelcome message block
BEGIN SYSTEM PROMPTSecurity instructions for AI

Multi-Bot Architecture

The bank template uses a multi-bot architecture for specialized handling:

BotTrigger WordsPurpose
fraud-detectorsuspicious, fraud, unauthorized, stolen, hackHandle security concerns
investment-advisorinvest, stocks, funds, portfolio, CDB, LCIInvestment guidance
loan-specialistloan, financing, credit, mortgageLoan inquiries
card-servicescard, credit card, debit card, block, limitCard management

Security Features

Built-in Protections

  1. Data Masking: Account and card numbers are always masked
  2. Transaction Limits: Confirmation required for large transactions
  3. Fraud Escalation: Automatic routing to fraud team for suspicious activity
  4. Audit Logging: All sensitive operations are logged
  5. No Sensitive Data: Never asks for passwords or full card numbers

Implementing Security Checks

' Example: Verify identity before sensitive operation
PARAM operation AS STRING

IF operation = "transfer" AND amount > 1000 THEN
    TALK "For your security, please confirm your identity."
    TALK "Enter the last 4 digits of your CPF:"
    HEAR verification
    
    IF NOT VERIFY_IDENTITY(verification) THEN
        TALK "Verification failed. Please try again or call support."
        RETURN
    END IF
END IF

Customization Ideas

Add Investment Products

ADD TOOL "simulate-investment"
ADD TOOL "compare-products"

' In investment flow
products = FIND "investment_products.csv", "risk_level = 'low'"
TALK "Here are our low-risk investment options:"
FOR EACH product IN products
    TALK "• " + product.name + " - " + product.rate + "% p.a."
NEXT

Add Bill Payment with Barcode

PARAM barcode AS STRING DESCRIPTION "Bill barcode or PIX copy-paste code"

IF LEN(barcode) = 47 THEN
    ' Boleto bancário
    bill = PARSE_BOLETO(barcode)
    TALK "Bill Details:"
    TALK "Payee: " + bill.payee
    TALK "Amount: R$ " + FORMAT(bill.amount, "#,##0.00")
    TALK "Due Date: " + FORMAT(bill.due_date, "DD/MM/YYYY")
ELSE IF INSTR(barcode, "pix") > 0 THEN
    ' PIX QR Code
    pix = PARSE_PIX(barcode)
    TALK "PIX Payment: R$ " + FORMAT(pix.amount, "#,##0.00")
END IF

Add Account Statements

PARAM period AS STRING LIKE "last 30 days" DESCRIPTION "Statement period"

transactions = FIND "transactions.csv", "account_id = '" + account_id + "' AND date >= '" + start_date + "'"

TALK "📋 **Account Statement**"
TALK "Period: " + period
TALK ""

balance = 0
FOR EACH tx IN transactions
    IF tx.type = "credit" THEN
        balance = balance + tx.amount
        TALK "➕ " + tx.description + ": R$ " + FORMAT(tx.amount, "#,##0.00")
    ELSE
        balance = balance - tx.amount
        TALK "➖ " + tx.description + ": R$ " + FORMAT(tx.amount, "#,##0.00")
    END IF
NEXT

TALK ""
TALK "**Final Balance:** R$ " + FORMAT(balance, "#,##0.00")