Super simple csv kb failing in all sorts of differ...
# 🤝help
n
Report ID: report_01J074B8HTY1T12JFVTWE5RXFD PART 1 I have a list of 22 attorneys. This includes their name, area of practice, their admissions (like nj, NY state bar) and a long but not too long background (max about 2500 chars). The idea is user enters their case details and location, the ai checks that list, sees which attorneys are in that practice and state then summaries the relevant part of their background. Im having two problems. One - the part where I filter from the knowledgebase, and I made it dead simple gives me bad answers. Sometimes different but equally bad answers. Two - anytime I add a knowledgebase that includes the backgrounds, be it a website or another dead simple csv with name, background, it chokes. The initial kb table doens't really work when I try and filter by practice_Area. I made a stripped down workflow using the csv: name, practice, admissions kb: *Get every legislator name from the knowledgebase and verify that their "Practice_Areas" applies to the following case details: "{{ user.legal_question }}" and add to a list. In output 1, ONLY show the names of people who match the "Practice_areas" and put a header on there saying "MATCHING" In output two, I want you to only show the names of people who were NOT selected, along withtheir practice_areas according to the knowledgebase and finally your rationale for not including them in output #1. Put the header on it "NON MATCH".* (CONTINUES IN REPLY) https://cdn.discordapp.com/attachments/1250566474255569039/1250566474494513152/88957055-707a-43ac-93ac-416dc42d24fb.png?ex=666c1109&is=666abf89&hm=80209fa71281ba43db59ea248c995b0f9b1f4dc9576e6e4b60fbfbf6f3fee5e2&
PART 2 Here is one of the responses in the "NON MATCH" list: Adlai J.J. Small - Civil Litigation & Disputes, Healthcare Litigation & Counseling,* Intellectual Property*, Banking, Finance & Securities Disputes - Practice areas do not include Intellectual Property.

https://pasteboard.co/269taetmF94A.png

wtf? OK that's the problem Im having with the simple csv knowledgebase. But the problems compound when we include the background either in that csv or on its own or via webpage. It just wholesale doesn't recognize 2/3 of the lines in the table. If I force feed it every name in the list, all 22 names, then feed that to a KB w/ names and background, I get this: "David B. Harrison: Background not provided." Like hell, that's one of the first rows in the table. See image. I've also gotten [†DONT_KNOW]. and occasionally NO CITATIONS. The full doc I've made, sorry messy, of problem is https://1drv.ms/w/s!AhBGIkI6WIgGi6w23dZ1pX2yV3vpUw?e=FPzqdx. The published project - https://mediafiles.botpress.cloud/51dfab71-3777-4ef2-bfb0-8c048038bac8/webchat/bot.html. Just type anything in the box. source site - https://www.shnlegal.com My full csv is here: https://1drv.ms/x/s!AhBGIkI6WIgGi6wthbZHX4WzIG5V-g?e=1PoCj5 The others csvs are just chopped up versions of this.
PART 3 Some general related questions: Is there some sort of thing...a character or length or hidden unicode char or like double new line or something that could spike a row in a kb table? This is copied over from the web so some weird thing could have made its way in. And when I upload it does confirm all 22 rows in the csv succeeded. Does anyone have any thoughts or best practices specifically for tables or have a clue wtf is going on? And also does it recognize the table as a table, can I, for example, refer to the columns by name? Or refer to a given "row"? If you use multiple tables can you specify a "key" ot something like that, so I could pivot on the litigators name? Can I use an array with the kb because it won't let me select the variable that is an array for output. Ps I've tried the other table manipulation stuff like select column those didn't work either though I only tried those a little but. Hell I even tried putting the csv info into a flat rtf file formatted like yaml. That didn't work either. Any good stuff I should log instead of or in addition to event? PS thanks discord for the stupid 2000 char limit.
s
Hi @numerous-secretary-37683 , I'm testing right now solution for better search in the KB/tables that might work for you. The requirement is a well-organized table - as I can see you have it. I use AI Task to use user message as task input and write a table filter. In the task I specify what columns AI should use while writing the filter command. AI Task looks something like this:
I will provide you with user questions about events. Table contains columns: title, time, location, url, img. Use inputs to write datatable filter to find records.
Next I define examples of the task:
Copy code
Input example: What events are scheduled for August
Result: time contains August
This way AI might know to use "contains" and not "is equal". Unfortunately, now, for some reason, variables have switched form array to strings, and I can't save anything from the table.
n
That might work, thanks. Especially i wasnt sure if the ai knew it was dealing with a table and you could refer to the columns etc. As for the array/strings, if you get the output in a string you can run some code to move that output to your array. if ( !workflow.your_array ) { workflow.your_array = []; } workflow.your_array.push( workflow.ai_ouput ); workflow.ai_ouput = ""; //optional, clear the output from the ai task
s
Thanks, but I mentioned the bug in botpress https://discord.com/channels/1108396290624213082/1250567994535444490. Sorry for that confusion, my bad 😉
n
oh yeah i get you all good. Im having all sorts of variable issues too, like setting default doesnt change an already set default
Maybe you can directly define a variable in the js, can you define an empty workflow.var_array in js somewhere in the flow?
11 Views