Retrieving RAW data to be Analyzed by the model?
# support
s
okay, so i was able to fix that issue i had, but now i have another issue, or lets say a question. so I am using a backend to fetch some data in this example I am fetching some property data and I want the user to be able to search for a property of their choosing, so my raw data is properly formatted to include things like, Property address, property price, how many rooms, how many bathrooms etc. etc. but I am thinking that - and maybe this is a limitation, but instead of having so many search criterias in my database, if I were to only limit the results by lets say number of rooms and number of bathrooms. - (so that the context is not becoming massive by fetching all data). -- but how would one go and have the model filter the raw data it received. like example; the raw data contains 20 properties that matches the users input of "show me rental properties that have at least 2 bedrooms and 3 bathrooms" which is passed back to the model. but then how would the model respond when the user says " what about properties that include parking (here the model should look at the raw data it received, and only talk about properties with parking) " or if the user asks, does this property have any additional bills ? etc. - so how can I pass the raw results to the Assistant, but not read it to the user, and get it to make its own conversation based on it ?
v
Hi there! 👋 I understand you're looking to have your AI assistant filter property data based on user criteria without directly exposing the raw data. I don't have specific code examples for your implementation, but I can definitely help with the approach and techniques! Here's how you can pass raw property data to your assistant and have it filter based on user criteria: ### 1. Pass the Raw Data Without Exposing It You have several options to pass the raw property data to the assistant: Using a Knowledge Base:
Copy code
json
{
  "model": {
    "knowledgeBase": {
      "provider": "custom-knowledge-base",
      "server": {
        "url": "https://your-server.com/knowledge-base"
      }
    }
  }
}
This approach lets you set up a local server that manages your property data, and the assistant can query it without exposing the raw data to the user ([Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341914745661554788)). Using System Prompts: You can pass the property data directly in the system prompt, instructing the assistant on how to use it:
Copy code
json
{
  "model": {
    "messages": [
      {
        "role": "system",
        "content": "You are a property assistant. Use the following property data to answer user queries without directly showing the raw data: [PROPERTY_DATA_HERE]"
      }
    ]
  }
}
Using Assistant Overrides:
Copy code
json
"assistantOverrides": {
    "variableValues": {
        "property_data": "[YOUR_PROPERTY_DATA]"
    }
}
This allows you to pass the property data as variables that the assistant can access ([Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338961731367604284)). ### 2. Configure the Assistant to Filter the Data In your system prompt, include instructions for the assistant to filter the data based on user criteria: ```
You are a property assistant with access to property listings data. When users ask about specific criteria (like parking, bills, etc.), filter the property data to show only relevant properties. Never show the raw data directly - instead, summarize the matching properties in a conversational way. ``` According to the [AI Conditions documentation](https://docs.vapi.ai/workflows/ai-conditions), the AI can make decisions based on conversation context and data from previous steps, allowing it to filter and respond appropriately. ### 3. Data Transformation If your raw data format is complex, you might need to transform it first. As mentioned in a [Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1327481613004701779), you can use an OpenAI node to transform the raw data into a more usable format before passing it to the assistant. ### 4. Best Practices for Data Organization For optimal filtering performance: - Segment your data by domain knowledge boundaries (e.g., rental vs. sale properties) - Add metadata to your property listings (e.g.,
{"parking": true, "additional_bills": ["water", "electricity"]}
) - Break down information into smaller chunks for better processing - Categorize and tag your properties effectively These practices, as mentioned in the [knowledge base integration documentation](https://docs.vapi.ai/knowledge-base/integrating-with-trieve), will help the assistant filter and retrieve information more efficiently. Is there a specific aspect of this approach you'd like me to elaborate on further? Sources: - [Discord thread on custom knowledge base](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341914745661554788) - [Discord thread on assistant overrides](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338961731367604284) - [AI Conditions documentation](https://docs.vapi.ai/workflows/ai-conditions)
s
https://docs.vapi.ai/workflows/ai-conditions 404 so I should use knowledge-base and not functions ?
wish the discord links you actually give worked
s
Hey hey specialist sorry for the bad links those are AI generated and you can consider those as hallucinations.
s
@Shubham Bajaj thank you, so does te first step need to be done via the API, or can I have that setup in the vapi dashboard
I was able to make some more progress, I think my original code was working all fine what got me confused was that I was using the "chat with agent" inside the dashboard to test it, and that was outputing raw json data, annd then when asked more questions saying there is an error. but i tested it with a call, only one issue that i seem to have encountered. 98feb2fb-364f-4423-b557-c948839185b1 - 00:21 - "here are a few highlights. A stunning" the model seems to say Yi when it encounters the dot here i think? but this seems to only happening when it reads the data, and not at every dot, I could not see anything in the transcript.
s
To help track down this issue, could you share: - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
s
I thought I written about it. The timestamp and call. The transcript reads "here are a few highlights. A stunning" and it continues. However what is spoken by the agent is "here are a few highlights yi a stunning" It adds thr word YI but this is not a punctuation thing because it doesn't do this at every dot it encounters so I have no clue why it's happening
s
Hey Specialist, could you share another call ID? I can't help you out with this call ID as during the April 11th-13th, the Datadog was having some issues, and call logs are not visible (which you can see in the shared screenshot). Also, I would like to apologize for being delayed in responding because I was out of office for a couple of days. https://cdn.discordapp.com/attachments/1359937156319023365/1363865974331277544/image.png?ex=680796ab&is=6806452b&hm=453830eb7848620b2eac0c6263c77f98a4b6d9301cd443c269f374cbeb1ba6a4&
3 Views