Inbound customer support
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_KEYenvironment variable to this key. Run the examples on your server or local machine, not in browser code. - Install
@vapi-ai/server-sdkversion 2.0.1 for TypeScript or therequestspackage for Python. The cURL model-update examples also usejq.
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
Upload the files
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
- Navigate to Files in your Vapi Dashboard.
- Click Choose file and upload both
accounts.csvandtransactions.csv. - Note the file IDs for use in creating the Query tool.
2. Create an Assistant
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
3. Configure an Assistant
Update the introduction message
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
Update First Message to:
Update the system prompt
First, create this system prompt:
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:
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
Copy the system prompt above and paste it into the System Prompt field in your assistant configuration.
Configure LLM settings (optional)
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
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.
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.
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.
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
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.
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
Create a Query tool
Open Tools in the Vapi Dashboard. Click Create Tool and select Query. Set Tool Name to defaultQueryTool.
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.
Dashboard
TypeScript (Server SDK)
Python (HTTP API)
cURL
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:
- Knowledge bases - Learn more about knowledge bases to build knowledge-based agents.
- External Integrations - Configure integrations with Google Calendar, Google Sheets, Slack, etc.
- Squads - Learn how to compose multiple assistants and transfer seamlessly for complex use cases.
Need help? Ask other developers in the Vapi Discord community or mention us on X/Twitter.