Need Assistance in agent setup
# support
c
Hello @Vapi @Shubham Bajaj Cay you please guide me on how to use website urls as knowledge base ?
v
- You can set up an automation to update your knowledge base every 12 hours to keep the information current. - If you encounter issues, consider using a Trieve dataset or checking that your knowledge base is properly connected to your assistant. Is there anything specific about this process you'd like me to explain in more detail? Sources: - [Knowledge Base Definition](https://docs.vapi.ai/knowledgebase) - [API Reference for Knowledge Bases](https://docs.vapi.ai/api-reference/knowledge-bases/create) - [Discord Thread on Website URLs as Knowledge Base](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337066107118555196) - [Discord Thread on Knowledge Base Configuration](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336722356856426586)
Hi there! 👋 I'd be happy to help you with setting up website URLs as a knowledge base for your agent. I don't have information about contacting specific individuals, but I can definitely guide you through the process of using website URLs as a knowledge base in Vapi. Here's how you can set up website URLs as a knowledge base for your agent: ## Creating a Knowledge Base with Website URLs First, you'll need to create a knowledge base using the API. According to the [documentation](https://docs.vapi.ai/api-reference/knowledge-bases/create), you'll need to make a POST request to
https://api.vapi.ai/knowledge-base
with the following JSON body:
Copy code
json
{
  "provider": "trieve",
  "createPlan": {
    "type": "create",
    "chunkPlans": [
      {
        "fileIds": [],
        "websites": ["your_website_url_here"]
      }
    ]
  }
}
Make sure to include these headers: -
Authorization: Bearer <your_token>
-
Content-Type: application/json
Replace
"your_website_url_here"
with the actual URL of the website you want to use as a knowledge base. You can include multiple URLs in the
websites
array if needed. ## Updating Your Agent with the Knowledge Base After creating the knowledge base, you'll receive a Knowledge Base ID. You'll then need to update your agent with this ID using a PATCH request to
https://api.vapi.ai/assistant/ID
(where ID is your assistant's ID):
Copy code
json
{
  "model": {
    "provider": "anthropic",  // or "openai" depending on your model
    "model": "claude-3-5-sonnet-20241022",  // or your preferred model
    "knowledgeBaseId": "your_knowledge_base_id"
  }
}
Replace
"your_knowledge_base_id"
with the actual Knowledge Base ID you received from the previous step. ## Additional Tips - The effectiveness of using website URLs can vary depending on the website's complexity and format. Text-based websites with clear headings generally perform better.
c
@Shubham Bajaj can you help me please
k
Copy code
json
1. **Create a Knowledge Base via API**:
   ```bash
   curl -X POST https://api.vapi.ai/knowledge-base \
   -H "Authorization: Bearer <your-api-key>" \
   -H "Content-Type: application/json" \
   -d '{
     "provider": "trieve",
     "name": "My Website Knowledge Base",
     "vectorStoreSearchPlan": {
       "searchType": "semantic",
       "topK": 3,
       "removeStopWords": true
     },
     "vectorStoreCreatePlan": {
       "type": "create",
       "chunkPlans": [
         {
           "websites": ["https://www.example.com", "https://docs.example.com"]
         }
       ]
     }
   }'
2. **Link the Knowledge Base to an Assistant**: - Update your assistant configuration to include the knowledge base ID - Configure the assistant to use the knowledge base for relevant queries ```