https://discord.gg/botpress logo
Dynamic KB
# 🤝help
l
Dyanmic Knowledge Bases
@high-room-45079
h
hello sir
l
Hello hello 🙂
Just to confirm are you taking a look here?
Under the advanced options?
i have it set to dynamic, and workflow.clientKB is an array
it is then defined in you web based api, and the array values are knowledge base Ids
l
And essentially its only referencing 1 singular KB where it should be refrencing all of them
h
specifically only kb-25de73de1e, and only when it is first in the array
l
Got it, Ill explore a little further and get back 🫡
the conversation log json also
so they are there
h
so this specific call, it does not reference any of the kb's, because kb-25de73de1e is not first
l
ahhh its reading kb-25
h
i have no clue why its only that specific one
l
which is value 1 not 0 yeah weird
h
oh no, sorry im not clear here
if i were to have kb-25 as value 0 it would read it
as it is value 1 rn it doesnt read any
l
I understand, so only kb-25 is being read no matter the position of the array
im still trouble shooting - as we converse will hope to get an answer soon 🫡
and the prompt
l
For some context Sam, I am new here at Botpress so please do understand If there is a delay before we find the solution!
h
no worries, i cant even find a single sentance in the documentation on dynamic mode so im fully stumped
i tried to see if it was an llm issue by forcing it to iterate through the array but no dice
and also by making it list out the kbs
l
Just a quick question have you tried doing this in the non-dynamic mode?
simply selecting all kbs in the standard mode
h
the response is exactly the same
l
Ill get back to you when I can!
@high-room-45079 We have a little update! You would have to define the variable as a string with KB ids seperated by semi collons
h
oh interesting
"clientKB": "kb-20014d3fa3; kb-4ff730a995; kb-074b38def2; kb-25de73de1e"
like this?
l
Correct!
l
can you send a screenshot of your workflow
l
Could I see your botpress workflow i mean (nodes)
h
ah ofc
the one in the top left is not connected to anything
l
could you click on search knowledge bases
and send another screenshot for the inspector
incase it has any affect the knowledge bases are all like 4 sentence long .txt files on various different topics
l
hey so i just tested this, it works with a non dynamic knoweldge base but when changing it to dynamic I seem to be running into the same issue
can you change it back to non dynamic and try again?
still the same
gonna try making new knowledge bases
l
Try that and let me know!
h
l
your 3 kbs are what exactly? links?
h
i deleted and remade every one
all 4 are .txt files
l
are they generally equal in size?
h
message has been deleted
yeah
these are the 4
l
okay cool let me test with these now!
It works on my end
try defining your variables using an execute code card instead
h
okay yep, so i just added the execute code card on my workflow also and when that assigned the variable it worked
awesome 😄
h
the issue is i need to to work via the api call
and also it was able to access a database that it did not have the KB ID for
l
did you select all KBs ?
also, did you consider combining all text files onto 1 singular KB? would that make things easier or no
h
the reason for this is the agent is going to work as a chatbot in my companies ERP software, and the "api call" is going to dictate the version of the software that is being used, and each verison is going to have differing documentation
so v1 will be kb-xxxx1, and v2 will be kb-xxxx2. and the api call from the software will have the relevant kb id for its version
if that makes sense
l
I just got informed that a Fix is coming for the dynamic KB, thank you for your patience today 😄
h
Okay fantastic, can I ask what was wrong and what the fix is?
@loud-crowd-60573 i did a little bit of testing and found that variables sent through the api are a bit funky and needed this code in an execute code node to actually be useable in the workflow https://cdn.discordapp.com/attachments/1419709115449737216/1420422015151505580/cUL6SwAAAAZJREFUAwC4nXwhVIwAHAAAAABJRU5ErkJggg.png?ex=68d55696&is=68d40516&hm=7f19e3fc18de065700576c82435b637a989a35a5c713c348d2823867da450abb&
and that goes for arrays, strings etc etc