AI Tasks accessing Knowledge Base
# 🤝help
c
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
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
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
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
Got it, thank you. Would be a SUPER GREAT feature............
r
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
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
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
I'll be praying it should be in 🙂 Thank you!
r
@calm-napkin-89762 the feature made it in the update, will ship tomorrow !
f
@rich-battery-69172 im also waiting for this one
let us know once its there
also some note on how to use it
r
deployed!
c
Wow!!
This will be gamechanger
f
finally...is there any guide about using it?
its there in the botpress release note
c
works like a charm! Thank you!!!
c
Bro check ur dm:)
h
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
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
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