Inbound customer support

Build an inbound support demo that answers questions from sample account and transaction files

Use only the supplied sample data or other fictional records. Matching a name and phone digits is not identity verification, and this example does not enforce account-level authorization.

Overview

A Query tool retrieves information from uploaded files. In this demo, one Query tool uses both CSV files to answer questions about sample accounts, balances, and transactions. You don’t need a custom server or a tool-calls webhook handler.

Demo capabilities:

  • Find a sample account by name and the last four phone digits.
  • Read a balance and summarize transactions from the uploaded files.

What you’ll build:

  • One Query tool with a knowledge base containing both CSV files.
  • An assistant and inbound phone number for testing the support conversation.

Prerequisites

  • A Vapi account.
  • A Vapi private API key for the API examples. Set the VAPI_API_KEY environment variable to this key. Run the examples on your server or local machine, not in browser code.
  • Install @vapi-ai/server-sdk version 2.0.1 for TypeScript or the requests package for Python. The cURL model-update examples also use jq.

Replace YOUR_ASSISTANT_ID and the file and tool ID placeholders with IDs from your Vapi account.

Scenario

VapiBank is a fictional bank. The CSV files are a fixed snapshot for this demo, not a connection to live banking data.


1. Upload the sample files

2

Upload the files

  1. Navigate to Files in your Vapi Dashboard.
  2. Click Choose file and upload both accounts.csv and transactions.csv.
  3. Note the file IDs for use in creating the Query tool.

2. Create an Assistant

2

Create a new assistant

  • Click Create Assistant.
  • Select Blank Template as your starting point.
  • Change assistant name to Tom.

3. Configure an Assistant

1

Update the introduction message

Update First Message to:

First Message
Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?
2

Update the system prompt

First, create this system prompt:

System Prompt
# VapiBank - Phone Support Demo
## Identity and purpose
You are Tom, a friendly VapiBank support assistant in a demo with fictional data.
Do not introduce yourself again after the first message.
Help callers find a sample account, read its stored balance, and review its transactions.
## Data and tool
Use defaultQueryTool with knowledgeBaseNames set to ["bank_records"] before answering a question about account data.
The bank_records knowledge base contains both accounts.csv and transactions.csv.
accounts.csv contains account_id, name, phone_last4, balance, card_status, and email.
transactions.csv contains account_id, date, description, and amount.
These files are a snapshot, not live banking data. Never describe a returned balance as a live balance.
## Conversation flow
1. Ask for the name on the sample account and the last four phone digits. Ask one question at a time.
2. Call defaultQueryTool to find a sample account matching both values.
3. Use only a returned account whose name and phone_last4 match the supplied details.
If the result is missing, ambiguous, or mismatched, ask for clarification. Do not guess or disclose another record.
4. For a balance question, call defaultQueryTool and report the matching account's balance from the file.
5. For a transaction question, call defaultQueryTool and use only transactions with the matching account_id.
Summarize up to three returned transactions, newest date first. Do not invent missing transactions.
6. If the caller changes the account details, repeat the lookup and ignore results for the previous account.
7. When finished, ask whether the caller needs anything else, then thank them and say goodbye.
## Limits and failures
This lookup does not authenticate the caller or authorize access to real accounts.
If a lookup fails or the result is unclear, say that you could not retrieve the requested information.
Do not interpret a failed lookup as a zero balance or no transactions.
Do not claim to transfer the call, arrange a callback, change an account, or move money. Those actions are not configured.
## Style
Be warm and concise. Aim for no more than 30 words per reply.
Read important numbers slowly and clearly.

Then update your assistant. In the TypeScript and Python examples, replace the abbreviated prompt with the complete prompt above.

When updating model through the API, retrieve its current configuration first and preserve the fields you are not changing:

Copy the system prompt above and paste it into the System Prompt field in your assistant configuration.

3

Configure LLM settings (optional)

Configure the LLM settings to your liking.

  • Select any provider and model you like (you will see cost and latency estimates).
  • You can specify the temperature and max tokens of the LLM.
4

Publish your assistant

Dashboard only: Click Publish to save your changes.

When you use the Server SDK or HTTP API, changes apply immediately. You don’t need a separate “publish” step.

5

Test your assistant

At this stage, test the greeting only. Test account answers after you create and attach the Query tool.

The API examples in this step place an outbound call, so outbound calling must be enabled for your phone number and account. First, assign a phone number to the assistant. Then replace YOUR_PHONE_NUMBER_ID with that phone number’s ID and +14155550100 with a phone number you control.

If your Vapi phone number is inbound-only, call it from your own phone instead.

Click Talk to Assistant to test it out.


4. Create and attach a Query tool

Create one Query tool with both CSV files in the same knowledge base. Each lookup can then use the account details and transaction records together.

The API examples use the default function name, defaultQueryTool. Use the same name in the dashboard and in the system prompt above. Replace the file ID placeholders with the IDs from step 1.

For complete request schemas, see the Create Tool and Update Assistant API references.

1

Create a Query tool

Open Tools in the Vapi Dashboard. Click Create Tool and select Query. Set Tool Name to defaultQueryTool.

2

Add the knowledge base

Under Knowledge Bases, click Add Knowledge Base and configure these fields:

FieldValue
Namebank_records
DescriptionSample bank account and transaction records. Use both CSV files to match sample accounts and retrieve their recorded balances and transactions.
Modelgemini-2.5-flash
FilesSelect both accounts.csv and transactions.csv.

Save or publish the tool.

3

Attach the tool

Open Assistants and select Tom. In Tools, attach the saved defaultQueryTool. If you followed an earlier version of this example, detach lookup_account, get_balance, and get_recent_transactions.

Keep the system prompt from step 3, then publish the assistant.

The API examples target the new assistant created in this guide and replace its model.toolIds array. If you adapt an existing assistant, include any unrelated tool IDs you want to keep. Use only one Query tool for this example.

After attaching the tool, test with the sample name John Doe and phone digits 1234. Check that defaultQueryTool runs with knowledgeBaseNames: ["bank_records"]. Compare the answer with acc_001 in the CSV files: the stored balance is 2534.67, and the three transactions are dated May 22–24, 2025.

Also test unknown or mismatched account details, a correction during the conversation, and a failed lookup. The assistant should ask for clarification or explain the failure, not invent account data. Prompt instructions guide retrieval; they do not enforce exact matching, identity verification, or account access controls.


5. Assign a Phone Number to an Assistant

These examples create a Vapi phone number in a US-region organization. Choose an available area code; the examples use 415.

2

Create a new phone number

  • Click Create Phone Number.
  • Select Free Vapi Number.
  • Enter an available area code in Area code, for example 415.
  • Click Create.
3

Configure the phone number

  • Set Phone Number Label to Vapi Support Hotline.
  • Under Inbound Settings, select Tom from the Assistant dropdown.
  • Click Save.

Next Steps

You’ve configured an inbound support demo that uses a Query tool to answer questions from sample CSV files. For real customer accounts, use an authenticated backend that enforces account access and retrieves current data.

Consider reading the following guides to further enhance your assistant:

Need help? Ask other developers in the Vapi Discord community or mention us on X/Twitter.