Custom Knowledge base
# support
a
I have uploaded the files in vapi documents and copied the like from the dashboard and i have used the api for creating knowledge base. it is good but while using assistant it was not taking. call id 896b789f-de46-4f61-8c2e-eab3010a2d67
v
Could you please clarify what you mean by "it was not taking"? Are you experiencing an error message, or is the assistant not recognizing the uploaded files? This will help me provide more specific troubleshooting steps. 😊 Sources: - [Troubleshooting Vapi Assistant File Recognition](https://discord.com/channels/1211482211119796234/1211483291191083018/1336887159948316733) - [Handling Uploaded Documents in Vapi's Knowledge Base](https://docs.vapi.ai/knowledge-base)
a
not recognizing the uploaded files and not giving any info in knowledge base
@Vapi Support Bot
v
It sounds like you're having trouble with the Vapi assistant not recognizing the uploaded files in your knowledge base. Here are some troubleshooting steps you can take to resolve this issue: 1. **Check File Format and Size**: Ensure that the files you uploaded are in a supported format (like Markdown, PDF, plain text, or Microsoft Word) and that they don't exceed the maximum size limit. 2. **Refresh and Relog**: Sometimes, simply refreshing the assistant's tab or logging out and back in can fix temporary display issues. 3. **Re-upload the Files**: If the upload seemed successful but the files are still not visible, try re-uploading them. This can help if there were network issues during the initial upload. 4. **Verify Knowledge Base Configuration**: Make sure that the files are correctly configured in the knowledge base settings. Check that all file IDs are properly referenced and that the knowledge base is active. 5. **Clear Browser Cache**: Clearing your browser's cache can help resolve persistent display issues by ensuring that the latest version of the web page is loaded. 6. **Browser Compatibility**: Ensure you're using a compatible browser version, as some features may not work properly on outdated browsers. If you've tried these steps and the issue persists, please let me know, and we can explore further options! 😊 Sources: - [Troubleshooting Vapi Assistant File Recognition](https://discord.com/channels/1211483291191083018/1336887159948316733) - [Handling Uploaded Documents in Vapi's Knowledge Base](https://docs.vapi.ai/knowledge-base)
a
i think custom base is not working
@Vapi Support Bot the custom knowledge base server use should be file or an llm provider
@User
v
Could you please provide more details about what you're trying to achieve with the custom knowledge base? Are you looking to understand the best practices for using files versus an LLM provider, or is there a specific issue you're encountering with the current setup? This will help me assist you better! 😊
a
@User @Vapi Support Bot @Vapi @VAPI Tech Custom knowledge base server should be the files url which we upload in the files sections or else the url should be lm or trevie ai
v
Could you clarify if you're trying to decide between using file URLs or an LLM provider like Trieve AI for your custom knowledge base? Are you looking for guidance on which option might be more suitable for your needs, or is there a specific functionality you're trying to achieve? This will help me provide more targeted advice! 😊
d
I am experiencing the same issues where existing working knowledge base files are not able to be selected in an assistant dropdown.
a
they depreciated the previous approach we need to use the file id to create a new knowledge base
@User @Vapi Support Bot @VAPI Tech i want to use the uploaded files url into the custom knowledge base by creating the knowledge base.
@Vapi Support Bot
k
The KB request is failing with a 400 error, suggesting the endpoint isn't properly configured to handle the request format being sent. Ensure the KB endpoint is properly configured to: \- Accept the message format being sent \- Return responses in the expected format validated by `KnowledgeBaseRequestMessageResponse`\`
s
This is what your custom knowledge base endpoint should return either messsage or documents
Copy code
ts
const knowledgeBaseResponse = {
  // Optional message that can be directly spoken by the assistant
  // This can be used to skip the model output generation and speak a custom message.
  message: {
    role: 'assistant',
    content: 'To set up a Twilio dev phone, you need a Twilio account, a payment method, and a verified phone number.'
  },
  // Optional array of documents 
  // This is the list of documents that will be sent to the model alongside the `messages` to generate a response.
  documents: [
    {
      content: "Setting up a Twilio development phone requires the following prerequisites: 1) Create a Twilio account by signing up on the Twilio website. 2) Add a payment method to your account to purchase phone numbers and use Twilio services. 3) Verify a phone number that you own to confirm your identity. 4) Purchase a Twilio phone number from your dashboard.",
      similarity: 0.95,
      metadata: {
        source: "Twilio Documentation",
        url: "https://www.twilio.com/docs/phone-numbers/getting-started",
        timestamp: "2024-05-15T10:30:00Z"
      }
    },
    {
      content: "Twilio development phone numbers cost approximately $1.00 per month plus usage charges. Voice calls typically cost $0.0085 per minute for incoming calls and $0.013 per minute for outgoing calls in the US and Canada.",
      similarity: 0.82,
      metadata: {
        source: "Twilio Pricing Guide",
        section: "Phone Numbers"
      }
    },
    {
      content: "When setting up a Twilio phone for development, you'll need to configure webhooks that tell Twilio how to handle incoming calls and messages. These webhooks should point to publicly accessible URLs where your application can receive and respond to events.",
      similarity: 0.78
    }
  ]
}
a
so i have to use my custom api in the server?
s
Yes you need api endpoint in your server for custom KB, but good part is now you can use our new KB tool if it works for you. Let me know your thoughts on it. https://discord.com/channels/1211482211119796234/1211483332496465962/1346588529492234240
a
yeah good to hear
k
Marking this ticket as Solved ✅