VFI/O API Setup Guide
This guide shows you how to set up the VFI/O Semantic Search and Tag Filter APIs in your Voiceflow agent. These APIs allow your AI agent to search your knowledge base intelligently and return the most relevant information.
Table of Contents
1. Getting Your VFI/O Authorization Key
Every Voiceflow agent you add to VFI/O Dashboard gets a unique VFI/O Authorization Key. This key identifies your specific agent and ensures data security.
Steps:
- Log in to your VFI/O Dashboard
- Go to Settings (gear icon in sidebar)
- Find your agent in the list
- Click the copy button next to the VFI/O Key
Your key looks like this: vfio_abc123xyz789...
Important: Keep this key secure. Anyone with this key can query your knowledge base.
If your key is compromised, you can generate a new one.
2. Setting Up Semantic Search API
Plan Requirement: Both Semantic Search and Tag Filter APIs require a Business or Business+ subscription plan.
The Semantic Search API uses AI to understand the meaning of a user's question and find the most relevant content from your knowledge base.
How It Works
Instead of just matching keywords, semantic search understands that:
- "How much does it cost?" is similar to "pricing"
- "What sport hoodies do you have?" should return sport hoodies, not classic hoodies
API Details
| Setting | Value |
|---|---|
| Endpoint | https://dash.vfio.app/api/knowledge/semantic-search |
| Method | POST |
| Content-Type | application/json |
Required Headers
| Header | Value | Description |
|---|---|---|
X-VFIO-Project-ID |
Your Voiceflow Project ID | Found in Voiceflow project settings |
X-VFIO-Auth-Key |
Your VFI/O Authorization Key | From VFI/O Dashboard Settings |
Request Body
{
"query": "What sport hoodies do you have?",
"threshold": 0.3,
"chunks": 10
}
| Parameter | Type | Default | Description |
|---|---|---|---|
query |
string | required | The user's question or search text |
threshold |
number | 0.6 | Tag similarity threshold (0-1). Lower = more tag matches. Recommended: 0.3 for better coverage |
chunks |
number | 10 | Maximum number of content chunks to return |
Tip: The threshold controls how similar a tag must be to match. A threshold of 0.3-0.4 catches more relevant results. The system then ranks results by content relevance, so lower thresholds are generally better.
Voiceflow Setup
- Add an API Block to your Voiceflow canvas
- Set Method to
POST - Set URL to your semantic search endpoint
- Add these Headers:
X-VFIO-Project-ID:{your_project_id}X-VFIO-Auth-Key:{your_vfio_key}Content-Type:application/json
- Set Body to:
{ "query": "{last_utterance}", "threshold": 0.3, "chunks": 5 } - Map the response to a variable (e.g.,
search_results)
Response Format
{
"success": true,
"query": "What sport hoodies do you have?",
"chunks": [
{
"content": "Sport Hoodie Pro - Breathable fabric...",
"documentId": "doc_123",
"documentName": "Sport Hoodies Catalog",
"tags": ["hoodie", "sport", "clothing"],
"chunkId": "chunk_456",
"contentSimilarity": "0.72"
}
],
"totalChunks": 5,
"totalMatchedChunks": 15,
"sourcesQueried": 2,
"matchedTags": [
{ "tag": "hoodie", "similarity": "0.85" },
{ "tag": "sport", "similarity": "0.78" }
],
"searchMode": "hybrid"
}
Using the Response in Voiceflow
Now you can use the variable {search_results} in a prompt or AI agent block to provide your answer.
(Optional) Code Block Example
This code combines just the content from the response for cleaner information for the LLM. In this example we store the response to {kbResponse} then using a code block we combine all content from the chunks:
const allContent = kbResponse.chunks.map(chunk => chunk.content);
search_results = allContent.join('\n\n');
3. Setting Up Tag Filter API
The Tag Filter API returns documents that have specific tags. Use this when you want exact matching rather than AI interpretation.
API Details
| Setting | Value |
|---|---|
| Endpoint | https://dash.vfio.app/api/knowledge/filter |
| Method | POST |
| Content-Type | application/json |
Required Headers
Same as Semantic Search:
X-VFIO-Project-IDX-VFIO-Auth-Key
Request Body
{
"tags": ["hoodie", "sport"],
"operator": "AND",
"chunks": 10
}
| Parameter | Type | Default | Description |
|---|---|---|---|
tags |
array | required | List of tags to filter by |
operator |
string | "OR" | "AND" = all tags must match, "OR" = any tag matches |
chunks |
number | 10 | Maximum chunks to return |
Operator Examples
OR Operator (default) - Returns documents with ANY of the tags:
{ "tags": ["sport", "classic"], "operator": "OR" }
Returns: Sport hoodies AND Classic hoodies
AND Operator - Returns documents with ALL tags:
{ "tags": ["hoodie", "sale"], "operator": "AND" }
Returns: Only hoodies that are also on sale
Response Format
{
"success": true,
"chunks": [
{
"content": "Sport Hoodie Pro - Now 20% off...",
"documentId": "doc_123",
"documentName": "Sport Hoodies Sale",
"tags": ["hoodie", "sport", "sale"],
"chunkId": "chunk_789"
}
],
"totalChunks": 5,
"totalMatchedChunks": 12,
"sourcesQueried": 3
}
4. Best Practices for Tagging
Good tagging makes your searches more accurate. Here are the best practices:
Be Specific
| Bad Tags | Good Tags |
|---|---|
hoodie |
sport-hoodie, classic-hoodie, winter-hoodie |
product |
mens-clothing, womens-shoes, electronics |
info |
shipping-info, return-policy, warranty |
Use Hierarchical Tags
Create a tagging hierarchy for better filtering:
Category: clothing
Subcategory: hoodies
Type: sport
Tags: clothing, hoodies, sport-hoodie
This allows:
- Search all clothing:
tags: ["clothing"] - Search all hoodies:
tags: ["hoodies"] - Search specific type:
tags: ["sport-hoodie"]
Use Multiple Tags Per Document
Each document should have 3-5 relevant tags:
Document: "Sport Hoodie Pro - Spring Collection"
Tags: sport-hoodie, spring-collection, mens, athletic, new-arrival
Consistent Naming
Pick a convention and stick with it:
- Use lowercase:
sport-hoodienotSport-Hoodie - Use hyphens:
return-policynotreturn_policyorreturnpolicy - Be consistent:
menseverywhere, notmens,men,male
5. Example Use Cases
Example 1: Product Search
User asks: "Do you have any sport hoodies?"
Voiceflow API Block Body:
{
"query": "{last_utterance}",
"threshold": 0.3,
"chunks": 5
}
Result: Returns sport hoodie products ranked by relevance, not classic hoodies.
Example 2: Category Browsing
User selects "Sale Items" from a menu
Voiceflow API Block Body:
{
"tags": ["sale", "in-stock"],
"operator": "AND",
"chunks": 10
}
Result: Returns only items that are both on sale AND in stock.
Example 3: FAQ Search
User asks: "How do I return something?"
Voiceflow API Block Body:
{
"query": "{last_utterance}",
"threshold": 0.4,
"chunks": 3
}
Result: Returns return policy content, even if user didn't say "return policy".
Example 4: Combining Tag Filter with Follow-up
First API call (tag filter):
{
"tags": ["hoodies"],
"operator": "OR",
"chunks": 20
}
Then in conversation: "Which type? Sport or Classic?"
Second API call (semantic search on subset):
{
"query": "sport",
"threshold": 0.3,
"chunks": 5
}
6. Troubleshooting
"Invalid VFI/O Authorization Key or Project ID"
Cause: The key or project ID doesn't match any agent in VFI/O.
Fix:
- Go to VFI/O Settings and copy the key again
- Make sure the Project ID matches your Voiceflow project
- Ensure the agent is still active in VFI/O
"No tagged documents found"
Cause: Your documents don't have tags assigned.
Fix:
- Go to Knowledge Base in VFI/O
- Click on each document
- Add relevant tags and save
"No semantically similar tags found"
Cause: The threshold is too high or tags don't match the query.
Fix:
- Lower the threshold (try 0.2 or 0.3)
- Add more descriptive tags to your documents
- Check that your tags match what users might search for
Empty results but tags exist
Cause: Voiceflow API might be having issues fetching document content.
Fix:
- Check the
errorsarray in the response - Verify your Voiceflow API key is valid in VFI/O Settings
- Ensure documents exist in Voiceflow's knowledge base
Slow response times
Cause: Many documents being processed.
Fix:
- Reduce
chunksparameter - Use more specific tags
- Raise threshold to reduce processing
Quick Reference
Semantic Search (AI-powered)
POST https://dash.vfio.app/api/knowledge/semantic-search
Headers: X-VFIO-Project-ID, X-VFIO-Auth-Key
Body: { "query": "...", "threshold": 0.3, "chunks": 10 }
Tag Filter (Exact match)
POST https://dash.vfio.app/api/knowledge/filter
Headers: X-VFIO-Project-ID, X-VFIO-Auth-Key
Body: { "tags": ["..."], "operator": "AND", "chunks": 10 }
Need Help?
If you're having issues:
- Check the troubleshooting section above
- Verify your VFI/O Key and Project ID
- Test with a simple query first
- Contact support at support@vfio.app with your error message and response
Happy searching!