Skip to content

Commit 99a6b9b

Browse files
committed
docs: new knowledgebase
1 parent 4a259f5 commit 99a6b9b

File tree

3 files changed

+235
-118
lines changed

3 files changed

+235
-118
lines changed

fern/community/knowledgebase.mdx

Lines changed: 94 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,101 @@
11
---
2-
title: Knowledgebase
3-
subtitle: Videos showcasing Vapi out in the wild.
4-
slug: community/knowledgebase
2+
title: Creating Custom Knowledge Bases for Your Voice AI Assistants
3+
subtitle: >-
4+
Learn how to create and integrate custom knowledge bases into your voice AI
5+
assistants.
6+
slug: knowledgebase
57
---
68

9+
## **What is Vapi's Knowledge Base?**
710

8-
Here are some videos made by people in our community showcasing what Vapi can do:
11+
Our Knowledge Base is a collection of custom documents that contain information on specific topics or domains. By integrating a Knowledge Base into your voice AI assistant, you can enable it to provide more accurate and informative responses to user queries.
912

10-
<div class="video-grid">
11-
<iframe
12-
src="https://www.youtube.com/embed/9MD1VM7038Q?si=G1at__w9gAm0dqEA"
13-
title="YouTube video player"
14-
frameborder="0"
15-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
16-
referrerpolicy="strict-origin-when-cross-origin"
17-
allowfullscreen
18-
/>
19-
<iframe
20-
src="https://www.youtube.com/embed/xCdfLSrwbjc?si=xn1jIHmV4J7VTsTr"
21-
title="YouTube video player"
22-
frameborder="0"
23-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
24-
referrerpolicy="strict-origin-when-cross-origin"
25-
allowfullscreen
26-
/>
27-
<iframe
28-
width="100%"
29-
height="315"
30-
src="https://www.youtube.com/embed/g0SKKwBpp7g?si=b8uXyopKo9fZYowX"
31-
title="YouTube video player"
32-
frameborder="0"
33-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
34-
referrerpolicy="strict-origin-when-cross-origin"
35-
allowfullscreen
36-
/>
13+
### **Why Use a Knowledge Base?**
14+
15+
Using a Knowledge Base with your voice AI assistant offers several benefits:
16+
17+
- **Improved accuracy**: By integrating custom documents into your assistant, you can ensure that it provides accurate and up-to-date information to users.
18+
- **Enhanced capabilities**: A Knowledge Base enables your assistant to answer complex queries and provide detailed responses to user inquiries.
19+
- **Customization**: With a Knowledge Base, you can tailor your assistant's responses to specific domains or topics, making it more effective and informative.
20+
21+
## **How to Create a Knowledge Base**
3722

38-
<iframe
39-
width="100%"
40-
height="315"
41-
src="https://www.youtube.com/embed/4_9IOCiC7hc"
42-
title="YouTube video player"
43-
frameborder="0"
44-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
45-
referrerpolicy="strict-origin-when-cross-origin"
46-
allowfullscreen
23+
To create a Knowledge Base, follow these steps:
24+
25+
### **Step 1: Upload Your Documents**
26+
27+
Navigate to Overview > Documents and upload your custom documents in Markdown, PDF, plain text, or Microsoft Word (.doc and .docx) format to Vapi's Knowledge Base.
28+
29+
<Frame caption="Adding documents to your Knowledge Base">
30+
<img
31+
src="https://cdn.hashnode.com/res/hashnode/image/upload/v1715628063841/rSrWDQ6YM.png"
32+
alt="Adding documents to your Knowledge Base"
4733
/>
48-
</div>
49-
50-
## Send Us Your Video
51-
52-
Have a video showcasing Vapi that you want us to feature? Let us know:
53-
54-
<CardGroup cols={2}>
55-
<Card
56-
title="Send Us Your Video"
57-
icon="video-arrow-up-right"
58-
iconType="solid"
59-
href="https://tally.so/r/3yD9Wx"
60-
>
61-
Send us your video showcasing what Vapi can do, we'd like to feature it.
62-
</Card>
63-
</CardGroup>
34+
</Frame>
35+
36+
Alternatively you can upload your documents via the API.
37+
38+
```bash
39+
curl --location 'https://api.vapi.ai/file' \
40+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
41+
--form 'file=@"<PATH_TO_YOUR_FILE>"'
42+
```
43+
44+
### **Step 2: Create a Knowledge Base**
45+
46+
Use the ID of the uploaded file to create a Knowledge Base. Currently we support [trieve](https://trieve.ai) as a provider.
47+
48+
```bash
49+
curl --location 'https://api.vapi.ai/knowledge-base' \
50+
--header 'Content-Type: text/plain' \
51+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
52+
--data '{
53+
"name": "knowledge-base-test",
54+
"provider": "trieve",
55+
"searchPlan": {
56+
"scoreThreshold": 0.1,
57+
"searchType": "hybrid"
58+
},
59+
"chunkPlan": {
60+
"fileIds": ["<FILE_ID>"]
61+
}
62+
}'
63+
```
64+
65+
### **Step 3: Create an Assistant**
66+
67+
Create a new assistant in Vapi and, on the right sidebar menu. Add the Knowledge Base to your assistant via the PATCH endpoint. Also make sure you customize your assistant's system prompt to utilize the Knowledge Base for responding to user queries.
68+
69+
```bash
70+
curl --location --request PATCH 'https://api.vapi.ai/assistant/<ASSISTANT_ID>' \
71+
--header 'Content-Type: text/plain' \
72+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
73+
--data '{
74+
"model": {
75+
"knowledgeBaseId": "<KNOWLEDGE_BASE_ID>",
76+
"temperature": 0.2,
77+
"provider": "openai",
78+
"model": "gpt-4o",
79+
"messages": [
80+
{
81+
"content": "You are a smart assistant who responds to user queries using the information you know, or information supplied by outside context.", # System prompt that defines the assistant's behavior and capabilities
82+
"role": "system"
83+
}
84+
]
85+
}
86+
}'
87+
```
88+
89+
## **Best Practices for Creating Effective Knowledge Bases**
90+
91+
- **Organize Your documents**: Organize your documents by topic or category to ensure that your assistant can quickly retrieve relevant information.
92+
- **Use Clear and concise language**: Use clear and concise language in your documents to ensure that your assistant can accurately understand and respond to user queries.
93+
- **Keep your documents up-to-date**: Regularly update your documents to ensure that your assistant provides the most accurate and up-to-date information.
94+
95+
<Tip>
96+
For more information on creating effective Knowledge Bases, check out our
97+
tutorial on [Best Practices for Knowledge Base
98+
Creation](https://youtu.be/i5mvqC5sZxU).
99+
</Tip>
100+
101+
By following these guidelines, you can create a comprehensive Knowledge Base that enhances the capabilities of your voice AI assistant and provides valuable information to users.

fern/customization/knowledgebase.mdx

Lines changed: 72 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,20 @@ title: Creating Custom Knowledge Bases for Your Voice AI Assistants
33
subtitle: >-
44
Learn how to create and integrate custom knowledge bases into your voice AI
55
assistants.
6-
slug: customization/knowledgebase
6+
slug: knowledgebase
77
---
8-
9-
<iframe
10-
width="560"
11-
height="315"
12-
src="https://www.youtube.com/embed/i5mvqC5sZxU"
13-
title="Vapi's Knowledge Base"
14-
frameborder="0"
15-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
16-
allowfullscreen
17-
></iframe>
188

199
## **What is Vapi's Knowledge Base?**
10+
2011
Our Knowledge Base is a collection of custom documents that contain information on specific topics or domains. By integrating a Knowledge Base into your voice AI assistant, you can enable it to provide more accurate and informative responses to user queries.
2112

2213
### **Why Use a Knowledge Base?**
14+
2315
Using a Knowledge Base with your voice AI assistant offers several benefits:
2416

25-
* **Improved accuracy**: By integrating custom documents into your assistant, you can ensure that it provides accurate and up-to-date information to users.
26-
* **Enhanced capabilities**: A Knowledge Base enables your assistant to answer complex queries and provide detailed responses to user inquiries.
27-
* **Customization**: With a Knowledge Base, you can tailor your assistant's responses to specific domains or topics, making it more effective and informative.
17+
- **Improved accuracy**: By integrating custom documents into your assistant, you can ensure that it provides accurate and up-to-date information to users.
18+
- **Enhanced capabilities**: A Knowledge Base enables your assistant to answer complex queries and provide detailed responses to user inquiries.
19+
- **Customization**: With a Knowledge Base, you can tailor your assistant's responses to specific domains or topics, making it more effective and informative.
2820

2921
## **How to Create a Knowledge Base**
3022

@@ -34,26 +26,76 @@ To create a Knowledge Base, follow these steps:
3426

3527
Navigate to Overview > Documents and upload your custom documents in Markdown, PDF, plain text, or Microsoft Word (.doc and .docx) format to Vapi's Knowledge Base.
3628

37-
<Image src="https://cdn.hashnode.com/res/hashnode/image/upload/v1715628063841/rSrWDQ6YM.png" alt="Adding documents to your Knowledge Base" />
38-
39-
### **Step 2: Create an Assistant**
40-
41-
Create a new assistant in Vapi and, on the right sidebar menu, select the document you've just added to the Knowledge Base feature.
42-
<Image src="https://cdn.hashnode.com/res/hashnode/image/upload/v1715628223370/e18L04yRk-.png" alt="Adding documents to your assistant" />
43-
44-
45-
### **Step 3: Configure Your Assistant**
46-
47-
Customize your assistant's system prompt to utilize the Knowledge Base for responding to user queries.
29+
<Frame caption="Adding documents to your Knowledge Base">
30+
<img
31+
src="https://cdn.hashnode.com/res/hashnode/image/upload/v1715628063841/rSrWDQ6YM.png"
32+
alt="Adding documents to your Knowledge Base"
33+
/>
34+
</Frame>
35+
36+
Alternatively you can upload your documents via the API.
37+
38+
```bash
39+
curl --location 'https://api.vapi.ai/file' \
40+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
41+
--form 'file=@"<PATH_TO_YOUR_FILE>"'
42+
```
43+
44+
### **Step 2: Create a Knowledge Base**
45+
46+
Use the ID of the uploaded file to create a Knowledge Base. Currently we support [trieve](https://trieve.ai) as a provider.
47+
48+
```bash
49+
curl --location 'https://api.vapi.ai/knowledge-base' \
50+
--header 'Content-Type: text/plain' \
51+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
52+
--data '{
53+
"name": "knowledge-base-test",
54+
"provider": "trieve",
55+
"searchPlan": {
56+
"scoreThreshold": 0.1,
57+
"searchType": "hybrid"
58+
},
59+
"chunkPlan": {
60+
"fileIds": ["<FILE_ID>"]
61+
}
62+
}'
63+
```
64+
65+
### **Step 3: Create an Assistant**
66+
67+
Create a new assistant in Vapi and, on the right sidebar menu. Add the Knowledge Base to your assistant via the PATCH endpoint. Also make sure you customize your assistant's system prompt to utilize the Knowledge Base for responding to user queries.
68+
69+
```bash
70+
curl --location --request PATCH 'https://api.vapi.ai/assistant/<ASSISTANT_ID>' \
71+
--header 'Content-Type: text/plain' \
72+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
73+
--data '{
74+
"model": {
75+
"knowledgeBaseId": "<KNOWLEDGE_BASE_ID>",
76+
"temperature": 0.2,
77+
"provider": "openai",
78+
"model": "gpt-4o",
79+
"messages": [
80+
{
81+
"content": "You are a smart assistant who responds to user queries using the information you know, or information supplied by outside context.", # System prompt that defines the assistant's behavior and capabilities
82+
"role": "system"
83+
}
84+
]
85+
}
86+
}'
87+
```
4888
4989
## **Best Practices for Creating Effective Knowledge Bases**
5090
51-
* **Organize Your documents**: Organize your documents by topic or category to ensure that your assistant can quickly retrieve relevant information.
52-
* **Use Clear and concise language**: Use clear and concise language in your documents to ensure that your assistant can accurately understand and respond to user queries.
53-
* **Keep your documents up-to-date**: Regularly update your documents to ensure that your assistant provides the most accurate and up-to-date information.
54-
91+
- **Organize Your documents**: Organize your documents by topic or category to ensure that your assistant can quickly retrieve relevant information.
92+
- **Use Clear and concise language**: Use clear and concise language in your documents to ensure that your assistant can accurately understand and respond to user queries.
93+
- **Keep your documents up-to-date**: Regularly update your documents to ensure that your assistant provides the most accurate and up-to-date information.
94+
5595
<Tip>
56-
For more information on creating effective Knowledge Bases, check out our tutorial on [Best Practices for Knowledge Base Creation](https://youtu.be/i5mvqC5sZxU).
96+
For more information on creating effective Knowledge Bases, check out our
97+
tutorial on [Best Practices for Knowledge Base
98+
Creation](https://youtu.be/i5mvqC5sZxU).
5799
</Tip>
58100
59101
By following these guidelines, you can create a comprehensive Knowledge Base that enhances the capabilities of your voice AI assistant and provides valuable information to users.

0 commit comments

Comments
 (0)