Latest / Agentic Conversations (formally mlops.community) / RAG Quality Starts with Data Quality // Adam Kamor // #262
Transcript
- 0:00Hey everyone, my name is Adam K Moore.
- 0:02I'm the Co founder and head of engineering at Tonic dot AI and
- 0:06I take my coffee black using a normal coffee machine like with
- 0:14the Philtre, the drip. The drip coffee I think is what
- 0:17it's called and I use Folgers because that's what they have at
- 0:21Costco. Welcome back to the MLF
- 0:25Community Podcast. Surprise, surprise, today we're
- 0:27talking about data, not just any kind of data, the data that is a
- 0:31little bit more sensitive that PII data and how when you are
- 0:36dealing with rags, when you've got that chatbot that you think
- 0:39is going to change the whole direction of your company, it's
- 0:43going to inform all of your leaders on the status of
- 0:47projects. How do you make sure that all
- 0:51that sensitive data does not get leaked by the chatbot?
- 0:55Well, we get into it today with Adam.
- 0:58Huge shout out to the folks at Tonic for supporting the
- 1:02community on this one. If you enjoy this episode, feel
- 1:05free to share it with one friend.
- 1:08And let's get into the show. So we got to start with the name
- 1:20of the tool. Did you guys know what you were
- 1:24doing when you called it textual?
- 1:26Because in my mind, getting textual with somebody is
- 1:29something totally different. We, we realised that connection
- 1:35after we came out with the name. It's like, you know, we come up
- 1:39with the name and I start using it in all of like the sales
- 1:41calls and for like the third or fourth sales call, I'm like,
- 1:45wait a minute. And then it kind of hit me and
- 1:48it has been an ongoing annoying joke and within the company
- 1:53since then. I, I think it, you know, there's
- 1:57that saying among like, like in software development, like the
- 1:59two hardest things are like, like cash problems and variable
- 2:03naming. Well, product naming is way
- 2:06harder. And by the way, the biggest
- 2:09constraint in naming a product is figuring out what domains are
- 2:13available. Of course, like that, Kate, when
- 2:16we started Tonic AI, like before we, we were like naming our
- 2:18products like specific names. We went with Tonic AI because
- 2:22like everything else is taken, man.
- 2:24There are there's just no domains out there.
- 2:27And unless you're willing to just like, like really, really
- 2:31misspell the name of your product.
- 2:32Oh yeah, then you just can't get a good domain.
- 2:35And I refuse to. Yeah, I hate the miss the
- 2:37misspelling of products as it's impossible to search for them.
- 2:40Exactly. Or you go with some random dot
- 2:44like that and the dot iOS got popular the dot SOS are pushing
- 2:48it. Or then you have I've seen you
- 2:51can go with the.ca or the.co and.
- 2:55That's right. That's right.
- 2:56I, I mean, we're dot AI and I mean, so yeah, I you're loud and
- 2:59clear that that was an issue that we had as well.
- 3:02Well, good call on Tonic because that gives an aura of sleekness
- 3:10and like a gin and tonic type thing.
- 3:12Yeah, and you know. We actually had a product for a
- 3:14while named Gin, but we spelled it.
- 3:18We didn't spell it. GIN actually going to not
- 3:21spelling things correctly. We spelled it DJINN like, you
- 3:24know, like a gin, like a genie. Oh yeah, yeah, it was.
- 3:27Kind of like a clever play on that.
- 3:28But I, I, I think it was perhaps too clever.
- 3:31And no, really. Got it.
- 3:32Yeah, yeah, sometimes you can outdo yourself and yeah, that's
- 3:37right. So the but Speaking of textual,
- 3:39let's get textual right now. Yes, I did do that.
- 3:43I I can only imagine how much you hear that that's.
- 3:45Actually a great I might put that on T-shirts for
- 3:47conferences. Let's get textual.
- 3:49There you go. That's great textual.
- 3:51Textual healing, perhaps? Exactly, that is 100% what I was
- 3:57thinking of so. All right.
- 3:59Thank you that. Is not exactly the road we're
- 4:02going to go down right now though.
- 4:03I will switch it up because yeah, yeah, I mean, we could go
- 4:08PG13 if you aren't, but we've been known to go R sometimes.
- 4:14But for this very thing, I think what you all are doing with
- 4:19textual is, is really cool and it's going to the data layer and
- 4:25making sure that some of these challenges that you face in the
- 4:30data layer can help you downstream when you're working
- 4:33with AI and ML. And so can you just give us this
- 4:38overarching idea of what textual is real fast so we can
- 4:42understand it? And then I'll I'll dive into
- 4:44some of the challenges that come off of it or it helps to curb.
- 4:48Yeah, absolutely. So Tonic Textual is a tool that
- 4:53is used to build top quality data pipelines for people that
- 4:58are building RAG systems. We, we, we got started on this
- 5:03because we realised quickly when we were building our own like
- 5:05internal RAG solutions, that data quality really Trump's
- 5:09everything else when it comes to getting good quality answers
- 5:14from your RAG system. If you're not providing your LLM
- 5:17with the right context, then especially like when you're
- 5:20asking questions about like private data, you're, you're
- 5:23just never going to get the right answer.
- 5:24So building a pipelining tool that actually gives you like
- 5:29good quality chunks where you're kind of like optimising for RAG
- 5:31retrieval is really the best way to building a good RAG system.
- 5:37So the obvious statement here is you got to have the quality data
- 5:46before you can do anything with it, right?
- 5:49And I've heard a lot of people complain about how well my
- 5:52knowledge assistant would be much better if people actually
- 5:56documented properly in my company.
- 5:58Yeah, that's, yeah. Well, and yeah, you have to have
- 6:02the data that that's definitely the prerequisite.
- 6:03I, I, you know, I, I can't do anything about that for you,
- 6:05unfortunately. I'd say getting people to
- 6:07document is not something that that anyone is going to ever
- 6:10solve. Yeah, but yeah.
- 6:12Doesn't that scare you? Doesn't it feel like you're
- 6:14built on found a House of Cards there?
- 6:17Because it's like documenting, getting people just fighting.
- 6:19Human nature every step of the way.
- 6:21No, I mean, so like when, when, when you look at like most
- 6:24enterprises, they're not even enterprises, just really
- 6:26companies of any size. They, they, they always have,
- 6:29you know, very large amounts of data.
- 6:32I mean, sometimes too much data, honestly, where, where like you
- 6:35actually don't even need all of it.
- 6:37And a lot of it can be a distraction for what you're
- 6:38trying to do. And especially as organisations
- 6:43are starting to like, like what we, what we were seeing early
- 6:45on, and it's still mostly true today is that companies are
- 6:49building rag systems to solve internal problems.
- 6:52Like here's our HR chat bot that, you know, employees can go
- 6:55to to ask HR questions or you know, here, here's my chat bot
- 7:00where people can ask about the company handbook, you know,
- 7:02things of this nature. So like internal chat bots that
- 7:05were mostly, I don't want to say that they were there for
- 7:08entertainment. They're certainly solving a
- 7:10need, but people were doing things that were, I think
- 7:13relatively straightforward to begin with to kind of figure out
- 7:15what's going on. Because this is new to
- 7:16everybody. And we're starting to see like
- 7:19organisations starting to like build more serious RAG systems
- 7:23as as time progresses. And then we're now starting to
- 7:26see companies building externally facing chat box or
- 7:30RAG systems. And then when you get into the
- 7:33externally basing ones, it's typically being used by their
- 7:35customers and it's incorporating customers personal data into the
- 7:40experience. And that's where we really come
- 7:43to play when we're dealing with information that isn't just
- 7:46publicly available and like a company's policies or on some
- 7:49like internal ocean page, like we're getting into like the
- 7:52actual data of the enterprise that involves their customers.
- 7:56And then that's where we prefer to focus.
- 7:59Yeah. And I know one of the huge
- 8:03benefits of this is you don't get that leakage.
- 8:06And the I have a fairly full understanding of how you can
- 8:12swap out a lot of this PII because I've looked at what you
- 8:15all are doing before and I've gotten textual we could say.
- 8:19But maybe you can give me a quick overview or the rest of us
- 8:24a quick overview of like how you make sure what data stays and
- 8:29what data goes and what is not safe versus safe.
- 8:32Sure. So behind Tonic Textual is a set
- 8:37of proprietary like built in house NER models.
- 8:41So NER is a subset of NLP, which is natural language processing
- 8:44and NER means named entity recognition.
- 8:47It's essentially a machine learning solution that
- 8:51identifies entities within unstructured text.
- 8:54So I say, hey, my name is Adam, I work at Tonic.
- 8:58You know, presumably the entities that we would pull out
- 9:00from that are Adam being a name and Tonic being a company.
- 9:03So that that would be an example of named entity recognition.
- 9:07All of the data that you bring into Tonic Textual, you know,
- 9:10for the purposes of building your data pipeline, run through
- 9:14our NER models to identify entities that that are A
- 9:18sensitive so that we can kind of address any sensitive
- 9:21information to prevent data leakage and B entities that are
- 9:25interesting, like not all entities we find are sensitive.
- 9:29Like, yeah, OK, sure. We can find SSNS and credit card
- 9:31numbers. Those should probably never land
- 9:33in your RAG system. But we can also identify things
- 9:36like what product is being discussed in this customer
- 9:39service transcript or like, OK, what, what company does this
- 9:44person work at that might not be sensitive, right?
- 9:47And then we can use the entities that we find to actually build
- 9:51for you better chunks that can optimise your RAG retrieval to
- 9:55get better quality answers. So all of the data goes through
- 9:59these NER models and we address anything that's sensitive
- 10:01through a variety of factors or a variety of techniques rather.
- 10:05And then we also kind of augment your chunks with additional
- 10:09entity metadata that we find. So, you know, we talked about
- 10:12both quality and safety of the data in general.
- 10:15OK, and I know that chunking is one of the hardest things,
- 10:20making sure that a you don't have too many chunks, but you
- 10:24give it enough context, right? And have you figured out some
- 10:28tricks around that? I mean tricks, yes, you know,
- 10:32general solution that works for everybody perfectly every time.
- 10:35No, of course not. I don't think such a thing
- 10:37exists. It might not even be possible.
- 10:41What we our approach is of course our solution ships with,
- 10:45you know, different chunking techniques that that we've
- 10:47developed. I, I wouldn't what to claim any
- 10:50of them are state-of-the-art or revolutionary.
- 10:53Our approach instead is that our system plugs very well into the
- 10:58existing work you've already done and you can really
- 11:00integrate into like the workflow that we provide to you any
- 11:04chunking algorithm you like. So, you know, you might already
- 11:06have your own like purpose built chunking algorithm that you,
- 11:10that you think is ideal for your data that you developed in
- 11:12house. And you can, you can work that
- 11:14into your, you know, textual pipeline without issue.
- 11:17I'm so, you know, we basically take this approach
- 11:19out-of-the-box. We have something for you if you
- 11:21think you can do better. And maybe you can, you could
- 11:24also bring in your own algorithm.
- 11:27Nice. I, I think that the idea that
- 11:29like there's going to be like 11 chunky algorithm to rule them
- 11:32all. I, I don't think it'll, I don't
- 11:36think you know we're there yet. No, I like how you say that it
- 11:41is very case by case basis because we don't really
- 11:46understand until you have lots of cycles and lots of iterations
- 11:50on what this looks like and how it performs on this specific use
- 11:55case with this set of data or this embedding model that we're
- 12:00using, whatever it may be. You've got a lot of different
- 12:02variables in there. That's right, I'll give a real
- 12:05trivial example. Let's say you are building a
- 12:08rack system where some of the documents are like FAQs, right?
- 12:12You know, typically for an FAQ, what I've seen work very well is
- 12:15you want to chunk each question answer pair separately.
- 12:18So you kind of like don't really look at like length as much, but
- 12:20it's just like, OK, here's the question, here's the answer.
- 12:23That's one chunk and then go to the next.
- 12:25Like that. That's a very simple solution,
- 12:28but it's also incredibly bespoke and does not apply to like any
- 12:31other document out there, right? So like, you know, it's like you
- 12:35might not even have one chunky algorithm for your entire
- 12:37corpus. It might be like, this is what I
- 12:39do with these types of documents.
- 12:40This is what I do with these other types of documents.
- 12:42It could really be all over the place.
- 12:45Dude, what a good point. That is how you don't need to be
- 12:49stuck with one chunking algorithm.
- 12:51And no, no, figure out what the best algorithm is for the
- 12:57different documents that you're working with.
- 12:59That's right. And I think this good, like that
- 13:02idea, like, I don't know, we, we, you know, we've been, we've
- 13:05been doing rag stuff now for a while.
- 13:07And, and we, it, it's, it gets more complex every day.
- 13:11I'm not saying like that's like the most complex concepts in the
- 13:14world or anything, but like it's one example of like, you know,
- 13:17things are like ramping up, you know, quickly in this space.
- 13:20Yeah, I always laugh because it's a little bit to me, like we
- 13:26are engineering band aids, but not really going to the root
- 13:31cause of what the problem is that these LLMS can spit out
- 13:38things that are absolutely made-up sometimes.
- 13:40And so we have to try and do all this engineering work to make
- 13:44sure that we cover our asses so that it doesn't happen.
- 13:48That's right. It's, it is, it's a very
- 13:51challenging, I mean, it's all, it's all very challenging.
- 13:54Like I, I think you, you can get to like a decent quality system.
- 13:57I think, I'm not going to say with ease, but like you can, you
- 14:00can get something that mostly works out there quickly and then
- 14:04dealing with the edge cases and like the occasional
- 14:07hallucination. Like it, it just the, the
- 14:10complexity goes high quick. It's like, you know, the last
- 14:1310% is the hardest that that that type.
- 14:15Exactly. Couldn't.
- 14:17It's so true. So aside from scrubbing the PII
- 14:22or the entities that are actually worth scrubbing versus
- 14:26ones that can give you insight and making sure that you're
- 14:31chunking properly depending on documents and your algorithms
- 14:35you're using, are there any other things that you feel like
- 14:39are essential for this data preparation before you're
- 14:42sending it to the RAG or when you're using the data for RAG
- 14:47use cases? So I like, let me give you the,
- 14:50the common workflow that we see among our, our users.
- 14:53And I think that that paints a pretty good picture of both of
- 14:55our capabilities. And really, like, I think what
- 14:58should be done when building these pipelines.
- 15:00The first is like, you kind of need to understand, OK, well,
- 15:03what kind of documents do I have and where do they live?
- 15:06Like every, every document type, you know, there's a different
- 15:08way of extracting out the relevant information.
- 15:10Like in a Word document, a Word document actually is just a zip
- 15:14file. It's a zip archive.
- 15:16And inside the zip archive is a bunch of XML.
- 15:19So programmatically you can actually traverse through like
- 15:21Word documents, Excel sheets, PowerPoints, etcetera.
- 15:24You can programmatically traverse through these files and
- 15:27extract out all of the content and material you need.
- 15:29Like within these XML files is all of the information you need
- 15:32about these documents. So for for office documents, you
- 15:36know, extraction is just a, a programming problem.
- 15:39PDFs on the other hand, typically you're using some type
- 15:41of OCR process to extract information and then you have
- 15:45other file types like images, which is also OCR plain text,
- 15:50which is relatively straightforward.
- 15:53But you know, for every file, it's like you got to consider
- 15:55how am I going to extract out this information?
- 15:57Then you have the question, OK, where does my data live?
- 16:00You know, we commonly see data being stored in like S3 and the
- 16:04and like, you know, Azure BLOB Store and GCS, but it's also
- 16:07going to be stored in like Confluence pages and Jared
- 16:10tickets and. Notion docs.
- 16:13Etcetera, right. So how are you going to access
- 16:14this data? And then you have this question
- 16:17of, OK, well, in all of these file systems, and I'm using the
- 16:20Word file system loosely here, how often are files changing?
- 16:24Like what process do I need to go through to ensure that like
- 16:27as files are being added, modified and deleted, how is how
- 16:30are those changes like, you know, percolating into my vector
- 16:32database? OK.
- 16:34And obviously I'm bringing this up because, you know, we have a
- 16:36solution to it, which I'll get to momentarily.
- 16:39So then, OK, you've identified like where the files live, what
- 16:41the files are, how frequently they're changing.
- 16:44And then what essentially you want to do is begin extracting
- 16:48out all of the information that you need, which typically means
- 16:50just like converting all of these documents into some
- 16:53version of plain text, we prefer to use Markdown.
- 16:56So what we do is we convert all of your complex file formats
- 16:59into Markdown, which is plain text with some, you know, syntax
- 17:04sugar that you could add on top, right?
- 17:06And it's nice because, like you can represent complex file
- 17:09formats like PDFs and Word documents in plain text and
- 17:12preserve a lot of the layout and formatting still.
- 17:15Like you get like, you know, lists, tables, headers, titles,
- 17:19you know, things of that nature. OK, let me stop you right there
- 17:22because you are bringing up such a great point that goes right in
- 17:25line with the idea of how important data quality is for
- 17:30your AI systems. How are you confident or how can
- 17:37you know you as a a user or an engineer that's creating these
- 17:42systems know that when I just ingested that PDF and it
- 17:45references, there's a paragraph in there that references table
- 17:49one. Table 1 is in there labelled
- 17:53table one. All that fun stuff, you know,
- 17:55which is, I've heard an incredibly challenging problem
- 17:58when you're trying to do it at Yale.
- 18:00Yeah, it, it, it is. So I mean, the, the, the first
- 18:04step is you need to be able to extract tables from your
- 18:07documents. And that means like identifying,
- 18:10you know, something, some section of the PDF actually has
- 18:13a table in it. And, and especially like in, in,
- 18:16you know, in an Excel sheet, it's, it's pretty obvious in
- 18:19Microsoft Word, you can make a table object and add rows and
- 18:21columns. That's all relatively
- 18:23straightforward. But in APDF the, the table could
- 18:26be anything. It could even be like very like
- 18:30artistic in nature where it's like like a designer crafted a
- 18:33table like that that is highly stylized.
- 18:36So there's like, so the first step in what you're asking is,
- 18:39OK, well, how do you identify tables and documents and PDFs?
- 18:43That alone is pretty challenging.
- 18:46There's a few techniques out there and there's a few
- 18:48libraries that'll just kind of solve it for you.
- 18:50And I say solve meaning like they do decent like a comment
- 18:54OCR system that most folks know is Tesseract.
- 18:57Tesseract out-of-the-box doesn't support like table
- 19:00identification. You can use.
- 19:02There's some other open source OCR systems that do a better job
- 19:05like paddle OCR is one that I've looked into recently that
- 19:09actually does support table detection.
- 19:11And then there's also like cloud providers like you know, Azure
- 19:14has the document intelligence service and AW is text tracked.
- 19:17And these OCR providers actually support table identification and
- 19:20like extraction out-of-the-box. So, you know, you could just go
- 19:24with one of these, you know, cloud providers and get this
- 19:26table extraction. There's also cool techniques
- 19:28actually that combine using tesseracts like this open source
- 19:32OCR engine along with an LLM and kind of combining the two to
- 19:37identify tables, like extract all the text with text tract,
- 19:40send it to the LLM, ask it to kind of format this in the way
- 19:44that you might expect. And it'll typically do a pretty
- 19:47good job at identifying tables for you.
- 19:49So that's another approach you have, but you got to figure out
- 19:52how you're going to do your table identification.
- 19:53And of course, you know, this goes without saying.
- 19:56Tonic textual supports the identification and extraction of
- 19:58tables as well as key value pairs, which is another like
- 20:01pretty common concept in, in, in OCR documents.
- 20:06Like imagine a tax form. Like it's got the name box, you
- 20:08put your name, it's got the SSN box, you put your SSN.
- 20:11Like, you know, the, the, the keys would be name in SSN and
- 20:14the values would be the name in SSN itself.
- 20:17Yeah. And then, you know, the second
- 20:20point you're asking, OK, well, like there's a paragraph that
- 20:22references the table. How do you tie them together?
- 20:26Yep, typically it requires like a second pass be done with some
- 20:30additional model that can kind of help associate things
- 20:33together. And, and it's, it's not easy,
- 20:36but like what a lot of folks will do is they will use like
- 20:41they're, they're like they'll, they'll typically take like
- 20:43follow up passes with like large language models.
- 20:46It could be open AI or it could be like a lower weight or a, a
- 20:49lower parameter count model that they deployed locally.
- 20:52But they're going to have to do a second pass with an LLM to
- 20:54kind of like draw those associations.
- 20:56Yeah, that's awesome. All right, continue back with
- 21:00the rest of what you were talking about, where I just had
- 21:03to ask because, dude, that is such a difficult problem to get
- 21:08into and really have the confidence that, all right, I
- 21:13just ingested two gigs of PDFs. What?
- 21:17Or let's say 2 terabytes of PDFs.
- 21:20Yeah. How do I know that all these
- 21:22tables are A showing the right data, B, being referenced and
- 21:27connected correctly. And so I like this, a very
- 21:31robust way of going about it and just throw another model at it
- 21:35when in doubt basically. I know I, I, I don't like
- 21:39saying, oh, just run it through an LLMA second time.
- 21:43I don't, you know, but like they're incredibly effective at
- 21:46those types of challenges. Yeah.
- 21:48And like, look, in an ideal world, you have your data
- 21:51science team, you guys go train your own birth specific model to
- 21:53do it. And you can do that and it'll
- 21:56run faster and more efficiently and you can run it for cheaper,
- 21:59but it's gonna take time to develop.
- 22:01And at the end of the day, it might be faster just to go send
- 22:03it to like your LLM of choice. Yeah.
- 22:06And it all comes down to like, you know, the Co pros and cons
- 22:10and like the opportunity cost for your specific situation.
- 22:14Yeah, right. So for example, like in Tonic
- 22:17Textual out-of-the-box, we don't use any large language models.
- 22:21All of the models that we kind of had developed and that we
- 22:23ship with, they're all proprietary models trained and
- 22:27fine-tuned by us. Typically we focus on Bert or
- 22:30Roberta models as like our, our like core architecture and then
- 22:33we fine to it and improve on top of those.
- 22:37But we found those to just be more cost effective and better
- 22:41at like very specific tasks that we're doing.
- 22:43Like specifically like our NER models, there's no LLM in use
- 22:47for any of our NER detection. Yeah, I was going to say
- 22:51potentially what you're looking at is better, cheaper, faster,
- 22:53right? Yes, it is.
- 22:55It's, it's more expensive to develop on the front end because
- 22:58we have to go train, we have to go manually annotate large
- 23:03bodies of text so that we can kind of feed these models.
- 23:06But once you got to build out that machinery, it becomes
- 23:09actually relatively straightforward and quick to
- 23:11like improve, add new entities to detect things of that nature.
- 23:15And that's kind of where we're at now, yeah.
- 23:17I imagine once you developed one and you saw the payoff, it's
- 23:22hard to go back to or do anything else besides that, even
- 23:25though you have that initial upfront cost.
- 23:28Yeah. And as you're going through it,
- 23:30you're thinking to yourself, I don't know, should we just use
- 23:34an LLM? It might end up being cheaper.
- 23:37But after you see that this actually works, no, I can see
- 23:42why you would only want to use that.
- 23:44Yeah, that, that, that's right. I mean it's essentially like it.
- 23:47It also really pays off for our customers in terms of like cost
- 23:50of operating both in terms of like how long it takes to run
- 23:54like, you know, a, a, a ARNER models like running on like
- 23:58commodity hardware. You know, it's 10s of thousands
- 24:01of words per second that are being scanned.
- 24:03And you can scale that out like, you know, to whatever desired
- 24:06throughput you want. And like, you just won't get
- 24:08that from it's just, no, it's not going to happen at this
- 24:13point. And if you could, it would
- 24:14probably be very expensive. So back, back to that question
- 24:18about like, OK, you know, what are folks doing to build these
- 24:20pipelines? So, you know, they, they,
- 24:22they've begun extracting all the data.
- 24:23Our approach, and I think this works well is we give her all of
- 24:26your documents into markdown. And we do this in like I, I
- 24:29think a really high quality way where the markdown is really
- 24:32representative of the original document.
- 24:34But then we also provide our users with essentially a
- 24:37structured output of their document.
- 24:39So you know, think of our solution essentially as taking
- 24:42every unstructured document you have sitting in S3 for example,
- 24:46and creating a structured counterpart to it.
- 24:49Our counterparts are typically Jason.
- 24:51So essentially every document you have gets converted into a
- 24:54Jason document regardless of the file type and make the details
- 24:58of the file. Every Jason document has the
- 25:00same like structure and schema to it.
- 25:03So you essentially end up now with a huge body of Jason
- 25:07documents that are all schematically structurally the
- 25:10same that you can interact with for building your back system in
- 25:13lieu of the original files and the different file formats that
- 25:17you have. And then on top of this, you
- 25:19know, body of Jason that we give you, we provide like nice
- 25:22utilities and SDKS for like kind of interacting with it and then
- 25:26like quickly and efficiently getting the Jason into your data
- 25:29pipeline. So that that is typically the
- 25:31approach we take. But the data isn't.
- 25:34So you basically transform the data, but then you throw it back
- 25:39into S3 or you have that in the database.
- 25:44Where does that? It's really like up to the user.
- 25:47Like by default, if the user, for example has all of their
- 25:50PDFs or Word docs or whatever in S3, then we're gonna dump a
- 25:54bunch of Jason documents into S3 as well.
- 25:56Like you kind of specify where, but they'll be sitting in S3 and
- 26:00it's very easy then to programmatically like interact
- 26:02with these documents via our like SDK.
- 26:05And then from there you can do whatever you like.
- 26:07So for example, our solution is also available in the Snowflake
- 26:10native app Marketplace. So for customers that want to
- 26:13keep all of their compute within Snowflake, you can run our
- 26:16entire solution on your Snowflake compute.
- 26:18Everything stays within Snowflake all like all the web
- 26:20calls, all of the models are running in Snowflake, etcetera.
- 26:23And in that solution, we don't dump into S3.
- 26:26That doesn't make as much sense. We're writing these Jason blobs
- 26:29directly into a Snowflake table. Snowflake has a column type
- 26:32called a variant, which is basically, it's not exactly
- 26:37Jason, but it's very analogous to Jason.
- 26:39And we're just writing all of the results into a variant
- 26:41column in a Snowflake table, and then you can programmatically
- 26:44access it that way. Nice.
- 26:46So you're ingesting and then transforming this data and
- 26:52making it real pretty for anybody to use with I I can
- 26:58imagine the next steps are all right.
- 27:00How do we throw this at the embedding models?
- 27:04Yeah. Well, how do we chunk it and
- 27:05then how do we throw it at the embedding models, which is,
- 27:06yeah, it's sorry, that's what you said.
- 27:08So yes. Yeah, yeah, exactly.
- 27:11And so, so then once you're there, there was something that
- 27:14you mentioned before, which I know is another very sticky
- 27:19problem. And how do you know those
- 27:24documents like you, you reference JIRA tickets, right?
- 27:27Those are getting updated all the time, right?
- 27:30How can you ensure that if somebody is an end user of that
- 27:35internal chat bot and asking a question about a project that is
- 27:40continuously being updated on JIRA, they're getting the most
- 27:44up to date? Information that's right.
- 27:46So for all of like the different look like data locations that we
- 27:50support, like on the input side, there's, there's this notion
- 27:53that we have of like, I want to say this in a generic way.
- 27:59You know what, I'm going to stick with S3 as my example for
- 28:01now because I, I think most folks know S3 or Azure BLOB or
- 28:05GCS, they're all roughly equivalent.
- 28:07So let's say I upload a file to S3.
- 28:10There's, there's, there's two things that can happen, right?
- 28:13Maybe I upload a new file. So we want to be, we want to
- 28:16know our system needs to know when a new file has been added.
- 28:19Meaning we're we're reprocessing and we encounter a file we
- 28:22haven't seen before. We also want to know when a file
- 28:26has been changed. Meaning yeah, we've processed
- 28:28this file before, but wait a second, it's checksum isn't the
- 28:30same as it was the last time. And then there's the issue of
- 28:33when a file is deleted and we need to know that as well.
- 28:35Meaning we've seen it before, but we're not seeing it this
- 28:37time. So those are kind of the three
- 28:39situations that we find ourselves in.
- 28:40And and if we wanted to have JIRA tickets, like the
- 28:43equivalent would be like JIRA will have a notion for a ticket
- 28:46of like last, last modified or last updated.
- 28:49And we'll be hooking into like columns of that type in JIRA.
- 28:53But regardless, whenever you process data using tonic
- 28:56textual, whether it's an S3 JIRA or somewhere else, we are
- 28:59keeping track of the three things that I just mentioned.
- 29:02And every time we process, it's just running a delta.
- 29:04So like everything we do is like a delta operation.
- 29:06So the first time you run, it's the whole thing, right?
- 29:09Like we have to, we have to process the entire backlog
- 29:12that'll take time. The next time you run, we're
- 29:15only processing the things that have changed since the previous
- 29:17run. So like because of that ability,
- 29:20you can be running our pipelines like as frequently as you like.
- 29:23Like the more frequently you run them, the smaller the delta will
- 29:27have will be each time. And then they just complete very
- 29:30quickly. Like, you know, you run it every
- 29:3130 seconds. Well, most of those runs the
- 29:34delta is 0, nothing has happened.
- 29:36And then occasionally like a file's been added, modified,
- 29:38deleted, etcetera. And then we pick up on that.
- 29:41And then we just provide nice hooks to the SDK user to allow
- 29:48them to easily say, OK, compute the delta in files between the
- 29:52the current run and the previous run.
- 29:53Give me all files that have been changed and then you can kind of
- 29:56like, you know, do your pipelining based on that change.
- 29:59Set is typically how we approach it.
- 30:02And what have you seen once you know OK, this has changed, I I
- 30:07think the real sticky part happens in the vector database,
- 30:11right? Oh, this file has been deleted.
- 30:13Now how do I go and RIP that out of the vector database?
- 30:16Yeah, that's right. So you know whether so most
- 30:20common situation is the files hasn't been modified.
- 30:22So in that case, skip it, Do nothing.
- 30:25If the file, if a file has been added, then you're gonna go
- 30:27through your chunking and embedding and you know,
- 30:29inserting process just like you did for the initial backlog.
- 30:33If the file's been modified, you're kind of having to do
- 30:36initial initially, you'll do the deletion.
- 30:38You got to delete the original chunks.
- 30:40Like it's better just delete those chunks as opposed to like
- 30:43trying to do like a delta on a chunk level.
- 30:45Just do it on the file level, delete all the chunks for the
- 30:48file and then you're gonna go and re chunk it using, you know,
- 30:51whatever, you know, strategy that you have already kind of
- 30:54selected. That's typically what we see.
- 30:58And so, so basically, if if a certain file has been deleted,
- 31:02you just go and find those chunks and delete those chunks.
- 31:06Yes, that's right. And.
- 31:08Yeah. And you know, it's, it's like
- 31:10how to identify those chunks in the database.
- 31:12It's that's left how just, you know, quoting like a textbook,
- 31:17you know, it's left as an exercise to the reader.
- 31:20So they they'll right, so they'll, you know, you know, you
- 31:23need to set up your vector database in a way that kind of
- 31:25like makes this easy and straightforward.
- 31:28Like, you know, typically what we'll see is like, you know,
- 31:30folks will include like a, a pointer to the file alongside
- 31:34the chunk that the chunk, you know, alongside the chunk, you
- 31:38know, to kind of show where the chunk came from.
- 31:40So you know, some approach like that, where it's just easy to
- 31:43identify which chunks came from which files makes this a a
- 31:46straightforward process. Yeah, I've also heard trying to
- 31:49link up the creation dates and then inside the vector database
- 31:54you can also philtre for creation dates and say, OK, this
- 31:58one goes here and it's true. Seems like it can get a little
- 32:02bit messy. Yeah, I.
- 32:06Mean it's all like a vector database is a database first and
- 32:10foremost, right? Yeah, like these are very
- 32:11standard database operations that like no one would bat an
- 32:15eye at doing in like a traditional like RDBMS. And it's
- 32:21you gotta play the same games here like, yeah, OK, you have
- 32:24chunks and that's cool and you have your embeddings that's
- 32:26neat. But there's other columns too.
- 32:28And you know, it's still software engineering.
- 32:31Yeah, nothing's changed just because if we call it a vector
- 32:34database, yeah, that's great. It's.
- 32:36Still a database. It falls under the umbrella of
- 32:38databases, so treat it like a database, not some new fancy
- 32:42thing that is specific for AI. Although it is.
- 32:46But it's not. It doesn't change everything.
- 32:48Yeah, that's right. I like that.
- 32:50You know a good example of this. You can create your vector
- 32:53database in Postgres. Just go install the PGA vector
- 32:55extension. Exactly.
- 32:56You get all the power in Postgres and you have your
- 33:00vector columns as well. So many, yeah, I, I just saw a
- 33:04company that was doing that basically their, their whole
- 33:10thing was, hey, we're Postgres. We're managed Postgres.
- 33:13And one of the big selling points was we can give you a
- 33:16managed. Postgres database, vector
- 33:18database. Vector database.
- 33:19Yeah, we, we create. We when, when we were initially
- 33:23building rat systems, we were just using God, I hope, I hope
- 33:27this is correct. We were using just Postgres in
- 33:29RDS, you know, the managed service in Amazon and I, I think
- 33:32we were just installing PG vector on the boxes.
- 33:36I think that, you know, I think that's what we did.
- 33:40I was debating if PG vector was available in RDS then and I
- 33:42believe it was. Well, I think that's best
- 33:45practise, right? Like use it until you outgrow it
- 33:50and then you need something more specific.
- 33:53OK, make the transfer. Get one of these like the Milvis
- 33:58or the Quadrant type or Lance DB, whatever it may be.
- 34:03That is when you hit your limitations with what you're
- 34:09already very good at. Because if you already know PG
- 34:14or Postgres and you've been working with PG vector, then
- 34:19that is probably going to be the best tool that you can work with
- 34:22until you can't work with it. Yeah, until you, until you
- 34:24can't, you know, that might never come.
- 34:27So you know. Yeah, if you're live.
- 34:29Advice to everyone building companies is start simple, make
- 34:34no assumptions about the future, just focus on today.
- 34:38I think that's. That's focus on good names and
- 34:41dot AI's and dot coms. That's what you want, folks.
- 34:45Thanks for including the AI in there.
- 34:46I appreciate that. Yeah.
- 34:49So there, there was another thing that I, I wanted to
- 34:52mention when it comes to like the data prep side.
- 34:56So we before we hit record, one thing that we were talking about
- 35:00was role based access control and allowing certain things to
- 35:06come into the database or certain people to look at the
- 35:09database. And this feels like again, it
- 35:11goes back to that same theory of this is a database.
- 35:16So database things should happen at the database level.
- 35:21And I was asking you, OK, so do you allow with text rule, do you
- 35:28allow certain people to have certain access to certain files?
- 35:32And you kind of push back on that.
- 35:35So I would love to hear, let's like try and rehash that
- 35:39conversation and act like it's the first time that we're having
- 35:41it. Yeah, that's good.
- 35:43That's good. So I think that, you know, the,
- 35:46the question that I was supposed to be before we started
- 35:47recording was does tonic textual help with, you know, granting
- 35:53access, you know, on an individual basis or on a user
- 35:56basis to the different portions of like the, the vector database
- 36:00tables? Like, you know, chunks basically
- 36:02like, can you, can you, you know, ensure that user A only
- 36:06has access to this set of chunks for as user B has access to this
- 36:09other set of chunks? And my response is, no, we don't
- 36:12do that. I, I, I see that more as the
- 36:14responsibility of the database system.
- 36:16Like to me that is a very, you know, vanilla use case for row
- 36:19based access control, You know, given users have access to given
- 36:23rows. And, and that's really the end
- 36:24of it where where we come into play more is an organisation is
- 36:30going to have certain requirements on it as in terms
- 36:33of like what types of user data can land in the vector database,
- 36:38you know, and, and the common fear that these organisations
- 36:40have, and rightfully so, is data leakage, right?
- 36:44Yeah. Anything you put into the vector
- 36:46database is fair game for the chat bot to regurgitate to the
- 36:50end user that's interacting with it.
- 36:51Yeah. So how do you deal with that?
- 36:53That's really where Tonic Textual comes in.
- 36:55Yeah. We give you very high quality
- 36:58data to make your VAC system better.
- 36:59And then this is empirically proven.
- 37:01And I'm, I'm, you know, happy to go into those details, but
- 37:05really what we do is we ensure that an organisation that says,
- 37:07hey, these types of entities cannot land in the vector
- 37:11database. They are too sensitive.
- 37:12We cannot have them regurgitated.
- 37:13We don't want that data leakage. That's where we come into play
- 37:16with our NER models to ensure that that data is either never
- 37:20included in the vector database, or it is it is somehow
- 37:24rectified, typically by either redacting certain pieces of
- 37:27information or by synthesising it in order to get, you know,
- 37:31high quality chunks. So there's a fascinating kind of
- 37:37screw up recently that happened with Slack, I don't know if you
- 37:40saw it, how Slack AI can give data leakage for private
- 37:47channels. So you can ask Slack AI, did you
- 37:49see that? I I think I saw it on like
- 37:52Hacker News or something. Honestly, I should have probably
- 37:55read the whole thing because it's incredibly pertinent to
- 37:57what we do, but I must have been busy that day.
- 38:00So, so you know, I, I, I have the high level, but I don't have
- 38:03all the details which maybe you could share.
- 38:05Yeah, that so it, it's basically saying the long and short of it
- 38:09is that you can do some prompt injection and get information
- 38:15from the private channels out in the open when you're talking
- 38:21with Slack AF. Yeah, OK.
- 38:23And I, I just wonder from your approach, how would you combat
- 38:30something like that? Because it's not necessarily
- 38:32like you can say this channel is 100% entities that we don't
- 38:39want. Maybe it's certain things that
- 38:41come up we don't want others to see, but actually maybe
- 38:45everything is we don't want to even touch that or put in the,
- 38:50that's right, vector database. Like would you just, yeah, just
- 38:55not put it in or I? Mean, yeah, certainly you can do
- 38:59that and then you have a worse system because of it.
- 39:01So that's not ideal, that specific problem.
- 39:04And I, I, like I said, I, I don't know, you know all the
- 39:07details. I, I, what you said, I'm, I'm
- 39:10hearing for the first time on the surface, it seems like
- 39:14that's more of like access control issue where like how,
- 39:19how could I, how should I be or why would I be given access to
- 39:23chunks that were generated by other users in private DMS?
- 39:29So to me that that's that on the surface, it sounds like a row
- 39:32based access control type deal. Let let me give you an example
- 39:36of where you would want to use our solution for kind of, you
- 39:41know, removing sensitive information.
- 39:43Like let's say you are building a customer service chat bot that
- 39:48customer service users, customer service agents can use to
- 39:52quickly answer questions that come in from users, where users
- 39:55might interact with themselves directly on the website.
- 39:59OK, now one solution could be a user comes in, they're
- 40:03authenticated. So the chunks that they can act,
- 40:06the chunks that you know they can retrieve are only the only
- 40:09going to be chunks that have been generated from previous
- 40:12conversations of that user with the customer service system.
- 40:16OK, well you could do that, but every user's probably going to
- 40:19have a very small amount of data, like maybe some user only
- 40:22ever calls customer service once.
- 40:24So it's kind of not very helpful.
- 40:26So really though, you know that like customers called in with
- 40:30the same issues, like if one person's confused, then 10,000
- 40:34people are confused, OK, so you want to basically use all of the
- 40:38data generated by everyone to answer any individual's problem.
- 40:42Well, OK, I call, you know, customer support for some place.
- 40:45First thing I do. They're like, OK, what's your
- 40:46name? OK, give them my first and last
- 40:48name. What's your address?
- 40:49What's your credit card number? Like what's your what's the last
- 40:51four of your SSN? Like all of these things they
- 40:53got to do to identify, you know, you are who you say you are.
- 40:55You are right in that situation. Those are the types of chunks or
- 41:00entities rather that we need to remove prior to like building
- 41:04our RAG application and exposing this chatbot.
- 41:07Because that type of information like my name has no bearing on
- 41:11like the actual problem on basing or the solution or
- 41:15whether or not it's going to be useful to someone else.
- 41:17We need to remove that. We need to remove obviously the
- 41:20last four of my SSN or my like my, my 3 digit credit card code,
- 41:24you know, things of that nature. So that's more where we come
- 41:27into play. So previously an organisation
- 41:29just couldn't use this data. It's like, oh man, we there,
- 41:32there is literally nothing we can do.
- 41:34We can't touch this data because anything that we put it into the
- 41:37vector database, we are just going to be in a load of pain
- 41:40and trouble, right? But now they can do that because
- 41:43we will go in, we'll identify every entity, every utterance
- 41:46said that is potentially sensitive.
- 41:48And then we can either redact it, meaning we just kind of like
- 41:51strike it from the record, replace the the utterances with
- 41:53tokens, or we can synthesise it. You know, given a chunk that has
- 41:57a bunch of sensitive entities, we will create for you a new
- 41:59chunk that is semantically identical.
- 42:01But you know, Adam is replaced with John, my SSN is replaced
- 42:05with a fake SSN, you know, things of that nature.
- 42:07And of course it's sort of the very intelligent way where even
- 42:10like the semantics across multiple chunks is still
- 42:12maintained so that that's the approach we take.
- 42:15So previously an organisation that couldn't use any of this
- 42:17data now gets to use it safely and in a high quality way to
- 42:21build their experience. Yeah.
- 42:23So that first of all, I do like that you can kind of do a hot
- 42:30swap so that you still retain the information that is being
- 42:36said. It's just has no meaning because
- 42:40it's not the person's name, it's not the company, it's not their
- 42:42screen or their Social Security number.
- 42:45None of the actual valuable stuff is there, but the whole
- 42:48meaning is there and so you can understand it.
- 42:51It hot swapping as you call it. We call it synthesis, but hot
- 42:55swapping, it's actually safer. Let's say I'm given a corpus of
- 42:59text and I think, OK, let's replace every name with a token.
- 43:03You know, that's like redacting it essentially.
- 43:05OK, well, you get now the safe text and you see Adam.
- 43:10You're like the model missed Adam.
- 43:12Adam's a real person in the data because every other name is
- 43:14tokenized. So you know, the model missed.
- 43:17And these NER models, by the way, and this is true for any
- 43:20NER model out there, they miss. They're not 100%.
- 43:24I mean, this is true for, yeah, any ML model, that's right.
- 43:29Folks, they will miss downer. You have to consider that when
- 43:31building the system. Yeah, no.
- 43:33But instead, if you do this synthesis or the hotswapping
- 43:35that you called it, well, OK, Demetrios goes to John Adam,
- 43:40though is missed. The attacker or the end user,
- 43:43whoever sees this data, you don't know.
- 43:47You don't, you know you have some more plausible deniability
- 43:49there. It actually gives you a safer
- 43:51footing. So I just pulled up the report
- 43:56on Slack AI just because I wanted to scratch my own edge.
- 43:59And you really should have read this because it is.
- 44:03It is talking about how it is leaking API keys, which is
- 44:07totally what you could have done.
- 44:08You could have saved Slack. I mean, it looks like they would
- 44:12be a good customer for OK, you, you know, you guys, somebody
- 44:16from the sales team should reach out to the Slack AI team because
- 44:20in private channels someone set up API keys and then they put in
- 44:26a public channel basically some prompt injection.
- 44:30And from that, they were able to leak the API key when talking
- 44:34with the LLM. And so the, The funny thing here
- 44:40though, that I, I think is the sticky problem with Slack or the
- 44:45the messy problem, I think we should call it, is that private
- 44:48channels you, you kind of think they're going to be private.
- 44:51So you might be talking shit about Karen.
- 44:54And now if all of a sudden the LLM can leak that data.
- 45:01Yeah, yeah, no, I can't talk shit on Karen.
- 45:04That's right for her. That's right.
- 45:06Like I got to do it on. Signal the work.
- 45:07If you can't do that, you know it's not under anymore.
- 45:11Yeah, now it's coming out. That is, that's interesting.
- 45:16I mean, yeah, like I, I would expect my DMS on really any
- 45:22system I use, not, not Slack in particular to certainly stay
- 45:26private. And, and the thought of them
- 45:28going into a, a vector database is certainly concerning.
- 45:32And not even the ones where you're just like, you know, was
- 45:35it, is it wait, is it spilling tea?
- 45:38Is it? That's the phrase for gossiping.
- 45:40Yeah, I'm showing my. I think so.
- 45:42That's what the cool kids are calling it these days.
- 45:44So not even those situations, but imagine it's like the the
- 45:47private channel of like leadership and like they're
- 45:49talking about like, you know, presumably like important
- 45:52things. Yeah.
- 45:53Or yeah, just important stuff. Yeah, that's right.
- 45:57Important stuff. That's right.
- 45:58I don't know. You're you're on the leadership
- 46:00team, right? You know what those
- 46:01conversations are? Yeah, yeah, absolutely.
- 46:03It's not just spilling tea. There's other things discussed.
- 46:06Too, Yeah, there's there's a quote unquote important stuff
- 46:08happening like the direction of the company and you want to be
- 46:12able to have those conversations in private before you bring them
- 46:15out to the team. But if somebody can prompt
- 46:18inject the LLM, then that's a little bit dangerous.
- 46:22And this, this is true of this, this is going to be true of
- 46:25like, you know, a company comes in saying, OK, we're building a
- 46:29rack system on our documents in Notion or in Google Drive or
- 46:33really in any system where like there's this notion of like
- 46:36shared private, you know, this group can see it, this group
- 46:40can't. You know, you have to, like, you
- 46:42have to like, you know, when I create a document in Google
- 46:45Drive or in, in like in Google Sheets or whatever, like I have
- 46:49faith that the sharing functionality works and, and
- 46:53just cuz I've used it for years, right?
- 46:55And but it's complex and like, if you're going to be like
- 46:58building something on top of that, you need to be as good as
- 47:01Google Drive is in that situation.
- 47:03Well, what a great point because it's not only Slack that has the
- 47:08notion of private channels and the public channels.
- 47:11It's everything that we're using any documents, If you're on
- 47:14Notion and you have your private workspace or you have your
- 47:17private documents in there that you've shared with a few people
- 47:21to socialise around, do you want that to be publicly questionable
- 47:27through the QA bot, like the chat bot?
- 47:30And how, how have you seen best practises on what to do?
- 47:35So what's private stays private, and what's public is public.
- 47:40So we, we don't take a like our, our product doesn't take a
- 47:45position here. It's like our, our product
- 47:48typically does not it, it, it, it doesn't like hook into like,
- 47:54you know, the sharing and like the, the access controls of
- 47:56given documents. You can certainly feed that into
- 48:00our system like as metadata as you're processing documents and
- 48:02like we can assist in, in landing the metadata in the
- 48:05right place. But in terms of like what, what
- 48:09happens once the data goes into the vector database and who can
- 48:11access it that, that it's, it's really up to the end user.
- 48:15And really, in my opinion, like the responsibility of the
- 48:18database system to provide like reasonable, like RBAC.
- 48:22I think the problem that you're describing though, like the
- 48:25ultimate form of this problem is we have tonnes of data, we need
- 48:30to make it shareable among everyone, right?
- 48:33Like the customer service example I gave her, I would have
- 48:35trained my model on all customer service engagements, not per
- 48:37user. So how do I, how do I basically
- 48:40in a world where you have tonnes of documents and there is
- 48:43implicit sharing in the sense that like, you know, everyone's
- 48:47discussing their own private stuff, but you have no
- 48:49structured way of knowing what's what, how do you deal with that?
- 48:52And and that's where we shine just because of like what we're
- 48:54able to do in terms of like identifying in information
- 48:58within documents in an unstructured way.
- 49:01Yeah. And in the ways that you've seen
- 49:03customers building their chat bots, have you seen much of
- 49:08these design patterns of like trying to have some kind of
- 49:14guard rails for the question or guard rails on the output?
- 49:18And or is it mainly around just hey, the database has got to
- 49:22take the brunt of this one and it's got to be the roles on
- 49:26that? Well you know, I thought you
- 49:27were going a different direction with this.
- 49:29When I hear guard rails, I, my mind immediately goes to guard
- 49:33rails around like answer quality and preventing hallucinations
- 49:39and ensuring that like the answer given isn't just like
- 49:42complete and utter nonsense. I, I, I the, the guardrails in
- 49:49terms of like who can see what? I, I, I don't, I'm not really
- 49:54Privy to those like portions of like the setup of our customers.
- 49:57Like what we try to do for our customers is help them easily
- 50:02build a safe and like high quality data pipeline where we
- 50:06try to optimise your retrieval metrics.
- 50:09Meaning for a given question, you're always retrieving the
- 50:12optimal set of chunks or the optimal collection of chunks.
- 50:16Like that. That's where we typically draw
- 50:18the line and down the stream of that tonic textual doesn't
- 50:23doesn't kind of go further. Yeah, you don't have the.
- 50:27There's like things on our road map that we're doing that that I
- 50:29think actually will end up going further over time, but beyond
- 50:33right now, like the data layer, we we kind of stop playing at
- 50:36the moment. Yeah.
- 50:39And since it feels like in the last six months Graph Rag has
- 50:44have an explosion. Do you have thoughts on that?
- 50:49I am interested to see where it goes, it is I guess my only
- 50:54qualm with it at the moment and I don't even know if it's really
- 50:57a a problem I have or just just an.
- 51:00It's more of an observation really.
- 51:02It, it, it is relatively expensive right now to build out
- 51:05your graph. And it's expensive because it
- 51:07typically requires an obscene number of LLM calls in order to
- 51:12like kind of like build out the connections between documents or
- 51:15chunks or just depending on what level you're working at.
- 51:18We're, we're working on our own technology here at the moment,
- 51:21kind of powered by Legar entity recognition to help like
- 51:25identify connections between different documents and between
- 51:28different chunks. I think the first version of
- 51:30this we're, we're aiming to kind of release over the next week or
- 51:33two. And it's, it's not going to be
- 51:35as powerful as like as a graph rack approach at the moment, but
- 51:38it'll eventually get there. And it, it's more like a
- 51:42technique for grouping documents together that all pertain to a
- 51:46same or similar topic. So it's more of like a document
- 51:49level topic analysis that's being done.
- 51:52And I, I think from there we'll, we'll likely move to finer grain
- 51:55like per chunk and then building in like, you know, ways to
- 51:58connect documents and chunks together.
- 52:01But I'm, I'm excited by graph rag and approaches like it.
- 52:04I, I, I think there will be a way to do it that is like
- 52:08reasonable for like large enterprise sets of data.
- 52:12And I, I, I think hopefully you know, we're the ones to do it,
- 52:15but you know, that will tell. Nice, I cannot wait to hear what
- 52:20name you come up with for the. Yeah, I mean, you, you have a,
- 52:24you have a, you have a good take on all that.
- 52:26Maybe you'll if you think of something funny, you know puns
- 52:28allowed, then let me know. There we go.
- 52:31All right, you where? If anybody listening has some
- 52:34good names we would love to hear them too.
- 52:36Yeah, that's that's. Awesome.
- 52:38We can give. Yeah, we can have it.
- 52:40You know, when I was in 3rd grade, they had all the third
- 52:43graders and all the basically all the elementary kids in the
- 52:48city that I was from try and compete to create the new mascot
- 52:53for the the recycling trash tick up.
- 52:57Yeah, yeah, yeah. And that's good.
- 52:59A kid in my class actually won. So from that point in time, I
- 53:03believe that anything is possible.
- 53:04All right, that is the big learning in my top takeaway is
- 53:08like that kid created the mascot that I now see driving all over
- 53:12town and that's my buddy right there.
- 53:15And no. That's that's incredible
- 53:16actually. Did the kid win like an award or
- 53:19anything? So these days you would think
- 53:22like, wow, he probably should have gotten like 10 grand or at
- 53:25least free trash for a year or something.
- 53:27Yeah, they didn't get anything, man.
- 53:29And they just used that. They they blatantly stole it.
- 53:32They were like, hey, thanks. You applied to this, which we
- 53:35didn't really have a choice, right?
- 53:37We had to do it as part of school.
- 53:39It was like, now we're going to submit this to the trash, the
- 53:43recycling folks. I mean, that's.
- 53:45That's if my kid won that, I'd be very pleased that that's
- 53:49going on the college application for at least you know that out
- 53:54of it at least. Exactly.
- 53:57You got a lot. You could juice that for a lot
- 53:59of miles. Yeah, yeah, 100.
- 54:00Percent for sure, yeah. Anything to get ahead.
- 54:03So the like that very same use case if someone out there is
- 54:09listening and they have a great name and you end up using it.
- 54:13Yeah, yeah. Just like your friend, we won't
- 54:15pay for it, just give it to me. And put it on your college or
- 54:22your MBA or PhD application. Yeah, yeah.
- 54:25Yeah, we're going to pay you an. Exposure.
- 54:28Perfect. People love that.
- 54:30Or at the very least, you might get a promotion.
- 54:35We'll let your boss know that, right?
- 54:37You should, you deserve, you deserve a pay bump.
- 54:41So all right, last one before we jump and we'll stop bullshitting
- 54:44on this retrieval evaluation. Let's practise it.
- 54:51Oh man, that's a hell of a question to end on.
- 54:55That's tough. So look, I mean, I'll say
- 55:00something at first that I think is obvious to people, but I'm
- 55:03going to say it anyways. Like when you're building a
- 55:05system, you write tests in general and you know, given,
- 55:09given this input, this is what I want the output to be.
- 55:11Well, OK, that that paradigm doesn't work as well when you're
- 55:14working with large language models because they're not like
- 55:17deterministic in the way that like a normal, you know,
- 55:20software system that you build would be.
- 55:21So how do you test the quality of the system you're building,
- 55:26the end to end quality? Given this question, I want an
- 55:29answer that touches on these points or contains at least this
- 55:34and it's answer things of that nature.
- 55:36How do you test this? There's different approaches out
- 55:40there. We actually have our own open
- 55:41source solution in this space. It's called Tonic Validate and
- 55:45it's a it's a rag. Performance.
- 55:47I was hoping for a better name than that honestly, after all
- 55:50this talk. I mean, it's actually like, you
- 55:54know, traditionally it's a good name.
- 55:56It says what it does. Because people understand it.
- 55:59You can, you can spell it. There's no like there's no jokes
- 56:02to make. It's just, you know, tonic
- 56:04validate. So the tonic.
- 56:06By those standards. Yeah, it's, yeah, very, very
- 56:08vanilla. So Tonic validate works
- 56:12essentially, but like by treating your RAG application or
- 56:16really any LLM backed application as a black box, you
- 56:20know, given this input, we're going to evaluate both the
- 56:24context retrieved and the answer given to determine if it's a
- 56:28good answer. And there's different metrics
- 56:30that we support that that we support out-of-the-box that you
- 56:34can kind of use. And the metrics themselves
- 56:37aren't perfect. Many of them require the use of
- 56:39like a large language model to do the evaluation.
- 56:42But what they get you is a consistent and easily
- 56:46automatable observer, which which it is.
- 56:49It's worth a lot, right? Because it allows you to see in
- 56:52a consistent way like trends over time, like trends in your
- 56:56scoring. So then I'll give you an example
- 56:58of some of the metrics that that we see as being like the more
- 57:01popular ones. One is called answer similarity.
- 57:06This is probably the best metric, but it's a very
- 57:08expensive 1 to compute because it requires every test question
- 57:12to have a human provided reference answer.
- 57:15And essentially we evaluate the RAG answer with the reference
- 57:18answer and we check for similarity.
- 57:21That's a very powerful metric, but again, expensive.
- 57:24And then we have other metrics, for example, like one metric, it
- 57:27looks at the question and it looks at the context retreat and
- 57:31it kind of tries to determine, you know, how relevant is the
- 57:35context to the question. And then on the flip side, we
- 57:38look at the context retrieved and the answer, how much of the
- 57:40answer is derived from the context.
- 57:43So, you know, we're doing metrics like that to kind of
- 57:46help you understand both answer quality, retrieval quality,
- 57:51answer generation quality, etcetera.
- 57:54And then there's other metrics that that that don't require LO
- 57:56Ms. Like does the does the context contain Phi?
- 57:59Does the answer contain PII, you know, things of that nature?
- 58:02Or what's the latency? What's the response time?
- 58:05How much did the call cost? How many tokens were used?
- 58:07Did the answer contain this exact substring?
- 58:10You know, simple things like this.
- 58:11And we make all this available in a open source Python SDK and
- 58:15then we provide a web UI to help you visualise and understand
- 58:18metrics over time. But the, the, the problem is not
- 58:21solved. It's very challenging,
- 58:24especially as you get into like more complex rag systems coming
- 58:28on the market that, that become that, that are, they're just,
- 58:31they're complex and they're hard to evaluate and they have like
- 58:33multiple steps and they're agentic and then they're
- 58:36multimodal. And like, you know, you can't
- 58:39just do like a black box evaluation at that point.
- 58:41You want to do like careful testing of each step in the
- 58:43process. And I, I don't think there's a
- 58:45great answer yet. I, I think there's like there,
- 58:49there's no, like there's no great solution out there yet.
- 58:51I think Tonic Validate does a decent job.
- 58:53It does a good job, but it, it's a very challenging problem.
- 58:57And I, I think it's one that's going to get more and more
- 59:00relevant, especially as rag systems go from being just like
- 59:03internal tools to externally facing production, you know,
- 59:08deployments. Yeah.
- 59:09And they leak data. And they leak data.
- 59:13And let's and they have more agency.
- 59:15Yes, that's right, all all of the above.
- 59:18Yeah, dude, this has been great.