Knowledge Base, RAG and third-party Trieve
# support
e
So, I need to have several documents/files to be used across multiple assistants and wondering hat the best way to do this. Currently there is a very limited capability and files size supported by the Vapi FIles feature, and it's been suggested we use another third-party service like Trieve (which is another bill we'd have to pay), or something else. What is that "something else" and how is the best way to handle dozens of documents or dozens of MB file size needed for RAG references? Thanks!
v
Hi there! 👋 I understand you're looking for alternatives to manage multiple documents across assistants without relying solely on Vapi Files or paying for Trieve. I wasn't able to find specific open-source alternatives to Trieve or ways to avoid additional costs with third-party services. However, I can share several approaches for handling large files and documents for RAG across multiple assistants! ## Vapi Files Limitations First, let's understand the current limitations: - File size must be less than or equal to 100MB [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336243643043938395) - While there's no limit on the number of files you can upload, you can only retrieve the first 100 files through the API due to lack of pagination [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339228558438174812) ## Alternative Approaches ### 1. Using Vapi API for Knowledge Base Management You can manage knowledge bases directly through the Vapi API:
Copy code
curl --location 'https://api.vapi.ai/knowledge-base' \
--header 'Content-Type: text/plain' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
    "name": "knowledge-base-test",
    "provider": "trieve",
    "vectorStoreSearchPlan": {
        "scoreThreshold": 0.1,
        "searchType": "hybrid"
    },
    "vectorStoreCreatePlan": {
        "fileIds": ["<FILE_ID>"]
    }
}'
[(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1329700156827893821) ### 2. Direct Integration with Vapi Files Utilize Vapi's file management capabilities with customization options: - Create vector stores using uploaded files within the Vapi ecosystem - Customize file ingestion, chunking, and rebalancing - Specify split delimiters and set target splits per chunk [(source)](https://docs.vapi.ai/changelog/2024/12/3) ### 3. Local Server Setup Set up a local server to handle knowledge base requests:
- VAPI sends requests to your server with conversation context - Your server returns either relevant documents with similarity scores or a direct response [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341914745661554788) ### 4. System Prompt for Small Knowledge Bases For smaller knowledge bases, consider incorporating information directly into the system prompt: - This was described as a "super quick solution" when reliability is needed and the knowledge base is very short [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339404492424089660) ## Best Practices for Managing Large Documents ### Chunking Strategy - Keep chunks between 200-1000 tokens - Maintain logical content boundaries - Adjust
targetSplitsPerChunk
to improve relevance [(source)](https://docs.vapi.ai/knowledge-base/integrating-with-trieve) ### Knowledge Base Optimization - Organize content into clear categories and use tags effectively - Implement robust indexing and powerful search functionality - Regularly review and update content - Break down information into smaller, digestible pieces [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336243643043938395) Is there a specific aspect of these solutions you'd like me to elaborate on further? Sources: - [Discord conversation about file size limits](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336243643043938395) - [Discord conversation about API file retrieval limitations](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339228558438174812) - [Discord conversation about Vapi API for knowledge base management](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1329700156827893821) - [Vapi changelog documentation](https://docs.vapi.ai/changelog/2024/12/3)
- [Discord conversation about local server setup](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341914745661554788) - [Discord conversation about system prompt for small knowledge bases](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339404492424089660) - [Vapi documentation on integrating with Trieve](https://docs.vapi.ai/knowledge-base/integrating-with-trieve)
k
checking if this is resolved/solved for you?
e
No. Not resolved. However, I have seen several similar services that have Voice Agents and do support multiple file knowledge bases. In your "Vapi Files Limitations" section above its mentions 100MB, but in actuality Vapi chokes on a 1MB file. This is a big restriction.
k
To manage large documents with multiple Vapi.ai assistants, use an external vector database like Pinecone, Weaviate, or Zep Vector Store. These options let you store and retrieve large files easily for RAG applications. You can also consider methods like Roaming RAG. These methods can help by preloading relevant information or allowing you to navigate structured documents directly, reducing the need for real time retrieval.