Skip to content

Commit c0f4445

Browse files
committed
More docs on Trieve configs
1 parent 2dbef43 commit c0f4445

File tree

3 files changed

+103
-16
lines changed

3 files changed

+103
-16
lines changed

fern/community/knowledgebase.mdx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Navigate to Platform > Files and upload your custom files in Markdown, PDF, plai
2828

2929
<Frame caption="Adding files to your Knowledge Base">
3030
<img
31-
src="/static/images/knowledge-base/files.png"
31+
src="./static/images/knowledge-base/files.png"
3232
alt="Adding files to your Knowledge Base"
3333
/>
3434
</Frame>
@@ -43,18 +43,22 @@ curl --location 'https://api.vapi.ai/file' \
4343

4444
### **Step 2: Create a Knowledge Base**
4545

46-
Use the ID of the uploaded file to create a Knowledge Base. Currently we support [trieve](https://trieve.ai) as a provider.
46+
Use the ID of the uploaded file to create a Knowledge Base along with the KB configurations.
47+
48+
1. Provider: [trieve](https://trieve.ai)
4749

4850
```bash
4951
curl --location 'http://localhost:3001/knowledge-base' \
5052
--header 'Content-Type: text/plain' \
51-
--header 'Authorization: Bearer 4beb7e10-f4be-4588-be65-712235f07f68' \
53+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
5254
--data '{
5355
"name": "v2",
5456
"provider": "trieve",
5557
"searchPlan": {
56-
"scoreThreshold": 0.2,
57-
"searchType": "semantic"
58+
"searchType": "semantic",
59+
"topK": 3,
60+
"removeStopWords": true,
61+
"scoreThreshold": 0.7
5862
},
5963
"createPlan": {
6064
"type": "create",
@@ -63,13 +67,38 @@ curl --location 'http://localhost:3001/knowledge-base' \
6367
"fileIds": ["<FILE_ID_1>", "<FILE_ID_2>"],
6468
"websites": ["<WEBSITE_1>", "<WEBSITE_2>"],
6569
"targetSplitsPerChunk": 50,
70+
"splitDelimiters": [".!?\n"],
6671
"rebalanceChunks": true
6772
}
6873
]
6974
}
70-
}''
75+
}'
7176
```
7277

78+
#### Configuration Options
79+
80+
##### Search Plan Options
81+
82+
- **searchType** (required): The search method used for finding relevant chunks. Available options:
83+
- `fulltext`: Traditional text search
84+
- `semantic`: Semantic similarity search
85+
- `hybrid`: Combines fulltext and semantic search
86+
- `bm25`: BM25 ranking algorithm
87+
- **topK** (optional): Number of top chunks to return. Default varies by implementation
88+
- **removeStopWords** (optional): When true, removes common stop words from the search query. Default: `false`
89+
- **scoreThreshold** (optional): Filters out chunks based on their similarity score:
90+
- For cosine distance: Excludes chunks below the threshold
91+
- For Manhattan Distance, Euclidean Distance, and Dot Product: Excludes chunks above the threshold
92+
- Set to 0 or omit for no threshold
93+
94+
##### Chunk Plan Options
95+
96+
- **fileIds** (optional): Array of file IDs to include in the vector store
97+
- **websites** (optional): Array of website URLs to crawl and include in the vector store
98+
- **targetSplitsPerChunk** (optional): Number of splits per chunk. Default: `20`
99+
- **splitDelimiters** (optional): Array of delimiters used to split text before chunking. Default: `[".!?\n"]`
100+
- **rebalanceChunks** (optional): When true, evenly distributes remainder splits across chunks. For example, 66 splits with `targetSplitsPerChunk: 20` will create 3 chunks with 22 splits each. Default: `true`
101+
73102
### **Step 3: Create an Assistant**
74103

75104
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.

fern/customization/knowledgebase.mdx

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,22 @@ curl --location 'https://api.vapi.ai/file' \
4343

4444
### **Step 2: Create a Knowledge Base**
4545

46-
Use the ID of the uploaded file to create a Knowledge Base. Currently we support [trieve](https://trieve.ai) as a provider.
46+
Use the ID of the uploaded file to create a Knowledge Base along with the KB configurations.
47+
48+
1. Provider: [trieve](https://trieve.ai)
4749

4850
```bash
4951
curl --location 'http://localhost:3001/knowledge-base' \
5052
--header 'Content-Type: text/plain' \
51-
--header 'Authorization: Bearer 4beb7e10-f4be-4588-be65-712235f07f68' \
53+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
5254
--data '{
5355
"name": "v2",
5456
"provider": "trieve",
5557
"searchPlan": {
56-
"scoreThreshold": 0.2,
57-
"searchType": "semantic"
58+
"searchType": "semantic",
59+
"topK": 3,
60+
"removeStopWords": true,
61+
"scoreThreshold": 0.7
5862
},
5963
"createPlan": {
6064
"type": "create",
@@ -63,13 +67,38 @@ curl --location 'http://localhost:3001/knowledge-base' \
6367
"fileIds": ["<FILE_ID_1>", "<FILE_ID_2>"],
6468
"websites": ["<WEBSITE_1>", "<WEBSITE_2>"],
6569
"targetSplitsPerChunk": 50,
70+
"splitDelimiters": [".!?\n"],
6671
"rebalanceChunks": true
6772
}
6873
]
6974
}
70-
}''
75+
}'
7176
```
7277

78+
#### Configuration Options
79+
80+
##### Search Plan Options
81+
82+
- **searchType** (required): The search method used for finding relevant chunks. Available options:
83+
- `fulltext`: Traditional text search
84+
- `semantic`: Semantic similarity search
85+
- `hybrid`: Combines fulltext and semantic search
86+
- `bm25`: BM25 ranking algorithm
87+
- **topK** (optional): Number of top chunks to return. Default varies by implementation
88+
- **removeStopWords** (optional): When true, removes common stop words from the search query. Default: `false`
89+
- **scoreThreshold** (optional): Filters out chunks based on their similarity score:
90+
- For cosine distance: Excludes chunks below the threshold
91+
- For Manhattan Distance, Euclidean Distance, and Dot Product: Excludes chunks above the threshold
92+
- Set to 0 or omit for no threshold
93+
94+
##### Chunk Plan Options
95+
96+
- **fileIds** (optional): Array of file IDs to include in the vector store
97+
- **websites** (optional): Array of website URLs to crawl and include in the vector store
98+
- **targetSplitsPerChunk** (optional): Number of splits per chunk. Default: `20`
99+
- **splitDelimiters** (optional): Array of delimiters used to split text before chunking. Default: `[".!?\n"]`
100+
- **rebalanceChunks** (optional): When true, evenly distributes remainder splits across chunks. For example, 66 splits with `targetSplitsPerChunk: 20` will create 3 chunks with 22 splits each. Default: `true`
101+
73102
### **Step 3: Create an Assistant**
74103

75104
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.

fern/knowledgebase.mdx

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,22 @@ curl --location 'https://api.vapi.ai/file' \
4343

4444
### **Step 2: Create a Knowledge Base**
4545

46-
Use the ID of the uploaded file to create a Knowledge Base. Currently we support [trieve](https://trieve.ai) as a provider.
46+
Use the ID of the uploaded file to create a Knowledge Base along with the KB configurations.
47+
48+
1. Provider: [trieve](https://trieve.ai)
4749

4850
```bash
4951
curl --location 'http://localhost:3001/knowledge-base' \
5052
--header 'Content-Type: text/plain' \
51-
--header 'Authorization: Bearer 4beb7e10-f4be-4588-be65-712235f07f68' \
53+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
5254
--data '{
5355
"name": "v2",
5456
"provider": "trieve",
5557
"searchPlan": {
56-
"scoreThreshold": 0.2,
57-
"searchType": "semantic"
58+
"searchType": "semantic",
59+
"topK": 3,
60+
"removeStopWords": true,
61+
"scoreThreshold": 0.7
5862
},
5963
"createPlan": {
6064
"type": "create",
@@ -63,13 +67,38 @@ curl --location 'http://localhost:3001/knowledge-base' \
6367
"fileIds": ["<FILE_ID_1>", "<FILE_ID_2>"],
6468
"websites": ["<WEBSITE_1>", "<WEBSITE_2>"],
6569
"targetSplitsPerChunk": 50,
70+
"splitDelimiters": [".!?\n"],
6671
"rebalanceChunks": true
6772
}
6873
]
6974
}
70-
}''
75+
}'
7176
```
7277

78+
#### Configuration Options
79+
80+
##### Search Plan Options
81+
82+
- **searchType** (required): The search method used for finding relevant chunks. Available options:
83+
- `fulltext`: Traditional text search
84+
- `semantic`: Semantic similarity search
85+
- `hybrid`: Combines fulltext and semantic search
86+
- `bm25`: BM25 ranking algorithm
87+
- **topK** (optional): Number of top chunks to return. Default varies by implementation
88+
- **removeStopWords** (optional): When true, removes common stop words from the search query. Default: `false`
89+
- **scoreThreshold** (optional): Filters out chunks based on their similarity score:
90+
- For cosine distance: Excludes chunks below the threshold
91+
- For Manhattan Distance, Euclidean Distance, and Dot Product: Excludes chunks above the threshold
92+
- Set to 0 or omit for no threshold
93+
94+
##### Chunk Plan Options
95+
96+
- **fileIds** (optional): Array of file IDs to include in the vector store
97+
- **websites** (optional): Array of website URLs to crawl and include in the vector store
98+
- **targetSplitsPerChunk** (optional): Number of splits per chunk. Default: `20`
99+
- **splitDelimiters** (optional): Array of delimiters used to split text before chunking. Default: `[".!?\n"]`
100+
- **rebalanceChunks** (optional): When true, evenly distributes remainder splits across chunks. For example, 66 splits with `targetSplitsPerChunk: 20` will create 3 chunks with 22 splits each. Default: `true`
101+
73102
### **Step 3: Create an Assistant**
74103

75104
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.

0 commit comments

Comments
 (0)