https://discord.gg/botpress logo
#🤝help
AI Tasks accessing Knowledge Base
# 🤝help
c

calm-napkin-89762

07/18/2023, 3:55 PM
Is there a way for AI task to use KB to get some information? For example, AI task is extracting product names from the input, but needs to lookup KB to get the prices of those products. What would be the best way to accomplish this?
r

rich-battery-69172

07/18/2023, 4:00 PM
Yes, you can use this variable inside the AI Task:
{{turn.KnowledgeAgent.answer}}
Tip: you can click those to copy/paste !

https://cdn.discordapp.com/attachments/1130890527538163712/1130891923767447592/image.png

c

calm-napkin-89762

07/18/2023, 5:38 PM
I am not sure if I understand correctly what you mean. Here is my use case: AI task gets an input which contains references to some products - the AI task analyzes this input, and updates it so that each product reference contains the full product name and the price. So, this full product name and the price should be extracted from KB. So I wouldn't have a chance to manually query KB - somehow AI task should be able to look it up. Unless there is another way to accomplish it, but I can't think of it - seems to me that the only logical way of doing it is to enable AI task itself to query KB to get all that info? Unless I can first have have AI task to extract product names, then to feed the output of the AI task into KB to get the missing info, and then to feed what comes out to another AI task which will insert the information accordingly? Would it be possible?
r

rich-battery-69172

07/18/2023, 5:55 PM
oh, I see what you mean. Right now, the KBs are not queryable manually (or from AI Task), it only gets queried from user inputs. I'll add this as a feature request though
c

calm-napkin-89762

07/18/2023, 6:01 PM
Got it, thank you. Would be a SUPER GREAT feature............
r

rich-battery-69172

07/18/2023, 6:02 PM
i'll try to prioritize this for you then 🙂
having a workflow card "Query Knowledge Base" would do it, right ? with an input for the query
c

calm-napkin-89762

07/18/2023, 6:04 PM
This would be a DREAM 🙂 It would open up the worlds of benefits and possibilities! I couldn't even bevelie that such a feature doesn't exist yet 🙂
r

rich-battery-69172

07/18/2023, 6:04 PM
haha ok perfect!
I'm shipping an update to the KB agent this afternoon i can't promise this will make it into the update but i'll try 🙏
c

calm-napkin-89762

07/18/2023, 6:11 PM
I'll be praying it should be in 🙂 Thank you!
r

rich-battery-69172

07/19/2023, 4:04 AM
@calm-napkin-89762 the feature made it in the update, will ship tomorrow !
f

full-monkey-19641

07/19/2023, 4:53 AM
@rich-battery-69172 im also waiting for this one
let us know once its there
also some note on how to use it
r

rich-battery-69172

07/19/2023, 4:10 PM
deployed!
c

curved-traffic-50479

07/19/2023, 4:27 PM
Wow!!
This will be gamechanger
f

full-monkey-19641

07/19/2023, 4:28 PM
finally...is there any guide about using it?
its there in the botpress release note
c

calm-napkin-89762

07/20/2023, 5:52 PM
works like a charm! Thank you!!!
c

curved-traffic-50479

07/21/2023, 6:52 AM
Bro check ur dm:)
h

happy-army-4408

07/21/2023, 7:49 AM
Did it make it in as "Query Knowledge Base"? I don't see the card. I do see the new cards for querying tables, though, so wondering if we have to change kb to table?
c

calm-napkin-89762

07/21/2023, 2:36 PM
Yes, query knowledge base card - it's there and works perfect - I used it in a few places already - works like a charm -
There is something about tables too, but those are different - looks like they just released them, and explanationg of them is coming, But Quesry Knowledge Base is simple and intuitive.
h

happy-army-4408

07/21/2023, 2:53 PM
Yeah... I found another thread where they recommended typing //state/reset for a different issue, so I tried it and then the query knowledge card appeared.
6 Views