Parsing Trieve Knowledge Base Results Before Injec...
# support
h
Is there a way to parse to the results from the trieve knowledge base query. (all my KB chunks are jsons that can be parsed)
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
v
Yes, you can parse the JSON results from your Trieve Knowledge Base queries. Since your KB chunks are stored as JSON objects, you can extract specific information using standard JSON parsing techniques in your preferred programming language. This is particularly useful for:
Copy code
javascript
// Example approach (not specific to Trieve)
const response = await fetchTrieveKBResults(query);
const parsedData = JSON.parse(response);
// Extract relevant information before injecting
const relevantInfo = parsedData.yourSpecificField;
Parsing before injection helps ensure accuracy and proper ordering of information, as mentioned by other users in the Vapi community. Sources: - [Discord discussion about KB chunks as JSON](https://discord.com/channels/1211482211119796234/1335953119275782144) - [Discord discussion about ensuring accuracy](https://discord.com/channels/1211482211119796234/1342860712938307697)
h
@User
k
Kindly provide the above details
4 Views