
Better AI filters
Some new tuning to AI query to improve filter construction using more structured LLM endpoints. Plus some improvements to make sure global AI query (outside of topics) is more scalable on…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
I can jump in with a a demo if here all Don Ariel oky dokie let me see I think it's this window yep share all right so hopefully you all can see omniomni apppp um the first thing I want to show is just a bug fix and a call out for a feature flag that would maybe be nice to start turning on um so on Omni Omni app we have this blank AI blank workbook state that we landed but it had an issue where if you have too many topics that are too complicated it just overflows um the llm there's just too much model metadata and so we we couldn't actually use this we just blow up and say trying to you like put too
much metadata into your query um so the bug fix is now there is a kind of a two-step process where it tries to send a fully hydrated model metadata to LM if that is too large then we start to trim back the metadata that we send so that we can eventually fit it inside the query um so if I say something like show me how many issues were closed this week um I would expect it to now even though I don't have a topic selected go look through all the topics pick yeah GitHub issues closed history looks like we close 96 issues last week and so um yeah it might be nice to to start turning this on now that we can handle uh quite
large models with lots of metadata and we can uh we can you know someone who comes in and asks a new does a new analysis um they don't need to necessarily select a topic they can just ask their question right away and it'll try to Route them to the correct topic and run the correct query so the bug fix is um something we'll see you probably didn't even know there but now we can start turning this on hopefully and then the second piece is I spent some time this week um trying to improve the ai's ability to filter on dates most of our errors come from well not most a lot of our errors come from creating malformed date filters on months or you know
periods of time like December 1st to de December 15th and so what I did is is um I want to run this same query on my local um and you can see that there should be two filters in this query right we want ORD placed in December so that's one filter and then the second one is delivered in the last 72 hours and I want to talk about the differences and and some of the changes so the first is let's talk about orders let's run this query on demo so show me orders that were placed in December and delivered in the last 72 hours oh it actually did a pretty good job that time um it did this exact filter with these exact times um
and then it looks like it also did some funky stuff here with the dates but it it may have gotten pretty close to the right answer and the reason that demo is trying to create weird filters like this that are prone to errors is because when we tell the llm how to generate an omni query um we're just describing it in plain English we're like hey in plain English here's what filter is here's what a a a field is and all that sort of stuff and so we're trying to basically tell LM to create um this not this one I can close this topic my gosh we're trying to tell it to create this query but using plain English which is prone to it coming
up with really weird filters that are prone to falling over um and open AI uh lets us instead of doing that um pass in an actual schema object so we can say like hey fields are a list of strings a limit is a number a sort is an object with the column that you're sorting on and the direction you're sorting so it lets us actually adhere to the specific types which hopefully should make our filters correct uh more often so the example is that I've come up with is I'm going to run the same query against my local instance where I have where I'm using these much stricter types to create the Omni query and hopefully the result comes back uh with a more reasonable
filter is there performance trade-off to this kind of stuff it's not huge I would say like maybe like 25% on either side it's not like it takes like three times as long or four times as long it's marginal um and so you can see here right it got the in the month December and it also did in the 72 hours um and so the Hope here is like one the filters are be more logical and two we'll have far fewer errors with filters because it's actually reading from our data types in our code for an omni filter as opposed to me trying to prompt engineer and explain what an omn for is so um i' would like to put this behind a flag and start
testing it to see if it actually reduces the error rates um but hopefully this is makes users happier and and seeing fewer that don't make sense when they're trying to filter my dates