Skip to content

Commit 69221a1

Browse files
committed
feat(banking-customer-support): update example to cover a banking use case
1 parent d9f31a0 commit 69221a1

File tree

14 files changed

+321
-356
lines changed

14 files changed

+321
-356
lines changed

fern/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ navigation:
112112
- section: Examples
113113
icon: fa-light fa-code
114114
contents:
115-
- page: Customer support hotline
116-
path: examples/customer-support-hotline.mdx
115+
- page: Banking customer support
116+
path: examples/banking-customer-support.mdx
117117
icon: fa-light fa-phone-volume
118118
- page: Outbound sales
119119
path: examples/outbound-sales.mdx
@@ -711,9 +711,9 @@ redirects:
711711
- source: "/outbound_sales"
712712
destination: "/examples/outbound-sales"
713713
- source: "/technical_support"
714-
destination: "/examples/customer-support-hotline"
714+
destination: "/examples/banking-customer-support"
715715
- source: "/examples/inbound-support"
716-
destination: "/examples/customer-support-hotline"
716+
destination: "/examples/banking-customer-support"
717717
- source: "/pizza_website"
718718
destination: "/examples/pizza-website"
719719
- source: "/outbound_call_python"
Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
---
2+
title: Banking Customer Support 💳
3+
subtitle: Build a banking customer support agent that can process inbound phone calls and assist with common banking issues.
4+
slug: examples/banking-customer-support
5+
description: A practical example of how to build a banking customer support agent that can process inbound phone calls and assist with common banking issues.
6+
---
7+
8+
By following this example, you'll learn how to:
9+
10+
* Create a voice AI assistant that answers inbound support calls 24/7 on a dedicated phone line.
11+
* Build custom tools to facilitate customer support without human intervention.
12+
* Make an automated test suite to ensure your assistant is working as expected.
13+
14+
## Prerequisites
15+
16+
* A [Vapi account](https://dashboard.vapi.ai/).
17+
18+
## Scenario
19+
20+
We will be creating a customer support agent for VapiBank, a bank that wants to provide 24/7 support to consumers. It will be capable of:
21+
22+
* identifying the caller's account
23+
* retrieving current balance
24+
* processing lost card claims
25+
* disputing transactions
26+
27+
28+
---
29+
30+
## 1. Creating a Knowledge Base
31+
32+
<Steps>
33+
<Step title="Download the spreadsheets">
34+
<div className="flex gap-2">
35+
<Download src="../static/spreadsheets/banking-customer-support/accounts.csv">
36+
<Button intent="primary">Download accounts.csv</Button>
37+
</Download>
38+
<Download src="../static/spreadsheets/banking-customer-support/transactions.csv">
39+
<Button intent="primary">Download transactions.csv</Button>
40+
</Download>
41+
</div>
42+
</Step>
43+
<Step title="Navigate to the Files section">
44+
In your Vapi dashboard, click `Files` in the left sidebar.
45+
</Step>
46+
<Step title="Upload the spreadsheets">
47+
- Click `Choose file`. Upload both `accounts.csv` and `transactions.csv` files.
48+
- Note the file IDs. We'll need them later to create tools.
49+
</Step>
50+
</Steps>
51+
52+
<video autoPlay loop muted src="../static/videos/banking-customer-support/upload-files.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
53+
54+
---
55+
56+
## 2. Creating an Assistant
57+
58+
<Steps>
59+
<Step title="Open the Vapi Dashboard">
60+
Go to [dashboard.vapi.ai](https://dashboard.vapi.ai) and log in to your account.
61+
</Step>
62+
<Step title="Navigate to the Assistants section">
63+
Click `Assistants` in the left sidebar.
64+
</Step>
65+
<Step title="Create a new assistant">
66+
- Click `Create Assistant`.
67+
- Select `Blank Template` as your starting point.
68+
- Change assistant name to `Tom`.
69+
</Step>
70+
</Steps>
71+
72+
<video autoPlay loop muted src="../static/videos/banking-customer-support/create-assistant.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
73+
74+
---
75+
76+
## 3. Configuring an Assistant
77+
78+
<Steps>
79+
<Step title="Update the introduction message">
80+
Update `First Message` to:
81+
82+
```txt title="First Message" wordWrap
83+
Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?
84+
```
85+
</Step>
86+
<Step title="Update the system prompt">
87+
Update `System Prompt` to:
88+
89+
```txt title="System Prompt" maxLines=10
90+
# VapiBank - Phone Support Agent Prompt
91+
92+
## Identity & Purpose
93+
You are **Tom**, VapiBank's friendly, 24x7 phone-support voice assistant. Do not introduce yourself after the first message.
94+
You resolve two common requests without human intervention:
95+
1. **Check balance**
96+
2. **Report lost / stolen card** (immediately lock the card)
97+
98+
## Data Source
99+
A CSV named **accounts.csv** is loaded in context. Columns:
100+
`account_id, name, phone_last4, balance, card_status, email`.
101+
102+
## Available Tools
103+
1. **get_balance** → returns `balance` for given account holder name.
104+
2. **lock_card** → locks card to prevent unauthorized use.
105+
106+
## Conversation Flow
107+
1. **Greeting**
108+
> “Hi, this is Tom at VapiBank. May I have the last four digits of the phone number on your account?”
109+
110+
2. **Account Verification**
111+
• After caller answers → call **lookup_account**.
112+
• Read back the returned `name` for confirmation.
113+
• If no match after 2 tries → apologize and transfer.
114+
115+
3. **Handle Intent**
116+
Ask: “How can I help you today—balance, lost card, or dispute a charge?”
117+
118+
**Balance** → call **get_balance** → read result.
119+
**Lost card** → call **secure_card** with `action:"lost_card"` → confirm card is locked.
120+
**Dispute** → gather date & amount → call **secure_card** with `action:"dispute"` + meta details → give `ticketId`.
121+
122+
4. **Close**
123+
> “Is there anything else I can help you with?”
124+
If no → thank the caller and end the call.
125+
126+
## Style & Tone
127+
* Warm, concise, ≤ 30 words per reply.
128+
* One question at a time.
129+
* Repeat critical numbers slowly (“Your ticket ID is 8 7 1 4”).
130+
* Empathize with frustration but remain efficient.
131+
132+
## Edge Cases
133+
* **No CSV match** → transfer to human.
134+
* **Duplicate intents** → answer latest request, then ask if anything else.
135+
* **Caller upset** → apologize, escalate urgency flag (`meta.urgent=true`) in **secure_card**.
136+
137+
(Remember: never reveal CSV data beyond what the caller is entitled to.)
138+
```
139+
</Step>
140+
<Step title="Configure LLM settings (optional)">
141+
Configure the LLM settings to your liking.
142+
- Select any provider and model you like (you will see cost and latency estimates).
143+
- You can configure the files available to the LLM as knowledge base.
144+
- You can specify the temperature and max tokens of the LLM.
145+
</Step>
146+
<Step title="Publish your assistant">
147+
Click `Publish` to save your changes.
148+
</Step>
149+
<Step title="Test your assistant">
150+
Click `Talk to Assistant` to test it out.
151+
</Step>
152+
</Steps>
153+
154+
<video autoPlay loop muted src="../static/videos/banking-customer-support/configure-assistant.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
155+
156+
---
157+
158+
## 4. Adding Tools to an Assistant
159+
160+
<Steps>
161+
<Step title="Navigate to Tools">
162+
Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Tools` in the left sidebar.
163+
</Step>
164+
<Step title="Create a tool for retrieving account balance">
165+
- Click `Create Tool`.
166+
- Select `Function` as your tool type.
167+
- Change tool name to `get_balance`.
168+
- Add the following function description:
169+
170+
```txt title="Function Description" wordWrap
171+
Retrieve the balance for an account based on provided account holder name and last 4 digits of the phone number.
172+
```
173+
- Scroll down to the `Knowledge Bases` section and add the following knowledge base:
174+
175+
- Name: `accounts`<br />
176+
Description: `Use this to retrieve account information`<br />
177+
File IDs: `<File ID of your accounts.csv file>`
178+
</Step>
179+
<Step title="Create a tool for retrieving account transactions">
180+
- Click `Create Tool`.
181+
- Select `Function` as your tool type.
182+
- Change tool name to `get_recent_transactions`.
183+
- Add the following function description:
184+
185+
```txt title="Function Description" wordWrap
186+
Return the three most recent transactions for a specific account.
187+
```
188+
- Scroll down to the `Knowledge Bases` section and add the following knowledge bases:
189+
190+
- Name: `accounts`<br />
191+
Description: `Use this to retrieve account information`<br />
192+
File IDs: `<File ID of your accounts.csv file>`
193+
194+
- Name: `transactions`<br />
195+
Description: `Use this to retrieve transactions`<br />
196+
File IDs: `<File ID of your transactions.csv file>`
197+
</Step>
198+
<Step title="Create a tool for looking up account">
199+
- Click `Create Tool`.
200+
- Select `Function` as your tool type.
201+
- Change tool name to `lookup_account`.
202+
- Add the following function description:
203+
204+
```txt title="Function Description" wordWrap
205+
Look up account based on provided name and last 4 digits of the phone number.
206+
```
207+
- Scroll down to the `Knowledge Bases` section and add the following knowledge bases:
208+
209+
- Name: `accounts`<br />
210+
Description: `Use this to retrieve account information`<br />
211+
File IDs: `<File ID of your accounts.csv file>`
212+
</Step>
213+
<Step title="Add tools to assistant">
214+
- Click `Assistants` in the left sidebar.
215+
- Make sure `Tom` is selected in the list of assistants.
216+
- Scroll down until you see `Tools` accordion. Expand it.
217+
- In the expanded accordion, add `get_balance` and `get_recent_transactions` tools.
218+
- Click `Publish` to save your changes.
219+
</Step>
220+
<Step title="Add predefined functions to assistant">
221+
- While we're here, let's give our assistant ability to hang up.
222+
- Expand the `Predefined Functions` accordion.
223+
- Toggle `Enable End Call Function` to `On`.
224+
- Here you can add a forwarding phone number to transfer the call to (in case assistant is unable to resolve the issue).
225+
- Click `Publish` to save your changes.
226+
</Step>
227+
</Steps>
228+
229+
<video autoPlay loop muted src="../static/videos/banking-customer-support/assistant-tools.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
230+
231+
---
232+
233+
## 5. Assigning a Phone Number to an Assistant
234+
235+
<Steps>
236+
<Step title="Navigate to Phone Numbers">
237+
Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Phone Numbers` in the left sidebar.
238+
</Step>
239+
<Step title="Create a new phone number">
240+
- Click `Create Phone Number`.
241+
- Stick with `Free Vapi Number`.
242+
- Enter your preferred area code (e.g. `530`).
243+
</Step>
244+
<Step title="Configure the phone number">
245+
- Set the `Phone Number Name` to `Vapi Support Hotline`.
246+
- Under `Inbound Settings` find `Assistant` dropdown and select `Tom` from the list.
247+
- Changes are saved automatically.
248+
</Step>
249+
</Steps>
250+
251+
<video autoPlay loop muted src="../static/videos/banking-customer-support/assign-phone-number.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
252+
253+
---
254+
255+
## 6. Creating a Test Suite for an Assistant
256+
257+
<Steps>
258+
<Step title="Navigate to Test Suites page">
259+
- Open your [dashboard.vapi.ai](https://dashboard.vapi.ai).
260+
- Below the `Build` section, find and expand the `Test` section.
261+
- In the expanded section, click `Voice Test Suites`.
262+
</Step>
263+
<Step title="Create a new test suite">
264+
- On the `Test Suites` page, click `Create Test Suite`.
265+
- Click on `New Test Suite` and change the name to `Support Hotline Test Suite`.
266+
- Set the `Assistant` to `Bobby`.
267+
- Set the `Phone Number` to `Vapi Support Hotline`.
268+
- Under `Test Cases`, click `Generate Tests`.
269+
- Use the following prompt to generate the test case:
270+
271+
```txt title="Test Case Prompt" wordWrap
272+
Ensure that the assistant correctly captures customer name, email, and issue description when creating a support ticket.
273+
```
274+
275+
- Accept the generated test case.
276+
</Step>
277+
</Steps>
278+
279+
<video autoPlay loop muted src="../static/videos/banking-customer-support/create-test-suite.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
280+
281+
---
282+
283+
## 7. Running the Test Suite on an Assistant
284+
285+
<Steps>
286+
<Step title="Navigate to Test Suites page">
287+
Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Assistants` in the left sidebar.
288+
</Step>
289+
<Step title="Run the test suite">
290+
- Click on `Support Hotline Test Suite` in the list of test suites.
291+
- Click on `Run Test Suite` button.
292+
- Wait for the test suite to finish running.
293+
- You will see the results of the test suite in the `Test Results` section.
294+
</Step>
295+
</Steps>
296+
297+
<video autoPlay loop muted src="../static/videos/banking-customer-support/run-test-suite.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
298+
299+
## Next Steps
300+
301+
Just like that, you've built a 24/7 customer support hotline that can handle inbound calls, create support tickets, and run automated tests to ensure it's working as expected.
302+
303+
Consider the reading the following guides to further enhance your assistant:
304+
305+
* [**Knowledge Bases**](../knowledge-base/) - Attach a Trieve KB so the agent can answer FAQs inline.
306+
* [**External Integrations**](../tools/) - Configure integrations with [Google Calendar](../tools/google-calendar), [Google Sheets](../tools/google-sheets), [Slack](../tools/slack), etc.
307+
308+
<Callout>
309+
Need help? Chat with the team on our [Discord](https://discord.com/invite/pUFNcf2WmH) or mention us on [X/Twitter](https://x.com/Vapi_AI).
310+
</Callout>

0 commit comments

Comments
 (0)