[0:00] hello, everyone, uh, welcome, to, my, code [0:02] deare, uh, video, series, um, what, I'm, doing [0:06] is, I'm, rotating, through, three, different [0:08] types, of, topics, educational, topics, uh [0:11] use, case, topics, and, then, kind, of, bias [0:13] ethics, safety, uh, topic, so, now, on, the [0:17] education, rotation, and, today, what, I [0:19] wanted, to, talk, about, is, uh, what, is [0:21] retrieval, augmented, generation, or, rag, uh [0:26] and, you, may, think, that, I'm, going, into [0:28] some, kind, of, nook, and, cranny, of, the, AI [0:31] uh, field, but, this, is, a, very, important [0:33] and, popular, kind, of, solution, pattern [0:36] that, I, see, um, being, used, over, and, over [0:39] and, over, again, for, uh, how, to, leverage [0:42] large, language, models, so, I, thought, I [0:44] would, explain, it, uh, to, you, uh, and, the [0:47] the, the, thing, that, this, is, used, for, is [0:49] basically, systems, that, leverage, large [0:51] language, models, but, on, your, own, content [0:55] so, let, me, describe, that, if, you, think, of [0:57] like, the, chat, GPT, experience, and, if, you [1:00] think, about, that, um, relative, to, like, the [1:02] search, engine, experience, that, we, had [1:05] before, if, you, ask, a, question, like, um, I [1:08] don't, know, what, color, is, the, sky, or, how [1:10] do, I, fix, this, plumbing, issue, or [1:12] something, like, that, a, search, engine [1:14] would, go, out, uh, or, appear, to, go, out [1:17] search, the, internet, find, relevant [1:19] content, and, then, just, list, that, content [1:21] for, you, list, those, links, and, then, you, as [1:24] a, user, would, need, to, click, on, the, links [1:26] that, seem, seem, right, read, it, digest, it [1:29] and, figure, out, the, answer, to, your [1:31] question, what, a, large, language, model [1:33] does, is, it, seems, to, do, that, first, part [1:35] meaning, leverage, the, content, on, the [1:37] whole, internet, but, instead, of, just [1:39] listing, that, content, it, sort, of, digests [1:41] it, digests, it, combines, it, assembles, it [1:44] together, and, answers, your, question, sort [1:46] of, generates, an, answer, um, so, it's, a [1:49] whole, lot, better, I, mean, search, engines [1:51] have, been, great, but, this, is, taking, the [1:52] whole, experience, to, another, level, and, in [1:55] addition, the, question, and, answering, uh [1:57] you, can, also, give, it, instructions, like [1:59] write, me, this, document, or, write, me, a [2:01] lesson, plan, to, teach, geometry, to, seventh [2:03] graders, uh, and, it, will, do, something [2:05] similar, it, will, kind, of, assemble, content [2:08] that, it, SE, that, it, has, seen, uh, that [2:10] talks, about, geometry, or, seventh, graders [2:12] or, how, to, do, lesson, plans, or, whatever, uh [2:15] pulls, that, together, assembles, it, and [2:17] then, writes, out, a, lesson, plan, okay, so [2:21] it's, a, much, better, experience, than, just [2:23] taking, the, raw, content, from, the, internet [2:25] but, it, really, uh, creates, something, new [2:28] from, that, now, let's, say, you, want, that [2:30] same, experience, but, on, your, own, content [2:33] so, it, might, be, a, chatbot, on, your, website [2:36] or, you, might, have, a, library, of, PDF [2:37] documents, that, this, documentation, for [2:40] one, of, your, products, uh, and, instead, of [2:42] just, linking, the, user, to, parag, sections [2:46] of, the, documentation, you, want, to [2:47] actually, answer, their, question, uh, it [2:50] might, be, your, service, ticketing, uh [2:52] system, so, when, a, new, issue, comes, in, you [2:54] could, say, how, would, I, resolve, this, issue [2:56] and, it, can, assemble, past, similar, issues [2:59] uh, and, then, come, up, with, a, new, uh, new [3:01] solution, based, on, that, so, this, is, an [3:04] incredible, experience, that, these, large [3:07] language, models, offer, but, how, can, you [3:09] create, that, experience, on, your, own [3:11] content, uh, that, might, not, be, available [3:14] to, the, internet, or, available, to, these [3:16] large, language, models, well, the, solution [3:18] to, this, is, this, rag, um, architecture, this [3:22] retrieval, augmented, uh, generation [3:24] architecture, so, now, I'm, going, to, do, my [3:25] best, to, explain, that, uh, to [3:28] you, so, let's, say, you, have, a, um [3:32] user, and, I'm, going, to, use, the, example, of [3:35] a, uh, patient, chatbot, and, the, content [3:39] source, is, going, to, be, that, content, from [3:41] your, website, let's, say, or, could, be [3:43] content, from, PDF, documents, or, or [3:46] whatever, but, you, want, this, to, be, the [3:47] content, to, answer, the, patient's [3:49] questions, so, if, the, patient, has, a [3:50] question, like, how, do, I, prepare, for, my [3:52] knee, surgery, instead, of, just, going, to [3:55] chat, sheet, PT, and, getting, a, generic [3:56] answer, you'd, like, to, provide, an, answer [3:59] that's, from, your, health, system, or, a [4:02] question, like, do, you, have, parking, you'd [4:04] like, to, provide, an, answer, for, your [4:06] health, system, for, your, the, office, where [4:07] the, patient, is, seen, okay, so, that's, a [4:10] scenario, that, I'd, like, to, do, so, the [4:12] patient, has, a [4:13] question, uh, and, I'm, going, to, do, do, you [4:16] have [4:17] parking, have [4:23] parking, um, you, can, uh, imagine, that [4:26] question, being, bundled, up, into, a, prompt [4:30] what's, called, a, prompt, and, I'll, describe [4:32] this, more [4:33] later, so, there, is, the, question, that [4:37] prompt, is, sent, to, a, large, language [4:40] model, and, that, large, language, model, will [4:44] come, up, with, a, response, to, that, question [4:48] okay, now, um, if, you, just, wanted, to, use, uh [4:51] chat, GPT, let's, say, or, some, other, llm, uh [4:54] without, any, extra, content, you, could, just [4:57] use, this, flow, how, do, I, prepare, for, my [4:59] knee, surgery, or, do, you, have, parking, put [5:02] that, into, a, prompt, send, that, to, the, uh [5:04] large, language, model, and, get, a, response [5:06] back, okay, but, uh, but, what, we, want, to, do [5:09] is, enhance, this, experience, with, our, own [5:11] content, so, let's, say, here, is, your [5:13] content [5:14] source, and, again, this, might, be, all, the [5:17] content, of, your, website, or, PDF, documents [5:21] or, internal, ticketing, system, or [5:23] databases, or, that, uh, that, sort, of, thing [5:27] and, what, you'd, like, to, do, is, something [5:29] called, called, the, prop, before, the, propt [5:32] so, in, these, systems, you, don't, just, send [5:34] the, user, question, to, the, large, language [5:36] model, you, usually, have, some, level, of [5:38] instructions, So, the, instructions, might [5:41] be, you, are, a, contact, center, specialist [5:44] working, for, a, hospital, answering, patient [5:47] questions, that, come, in, over, the, Internet [5:50] uh, please, be, uh, nice, to, the, patients, and [5:53] responsive, and, folksy, because, that, fits [5:55] with, our, brand, or, some, instructions, like [5:58] that, are, sometimes, sent, with, the, prompt [6:01] um, and, then, uh [6:03] Additionally, you, want, to, provide, the [6:06] information, that, the, L, llm, needs, to [6:08] answer, the, question, so, what, you'd [6:11] ideally, like, is, information, from, your [6:14] website, to, be, included, here, um, and, uh [6:18] and, that, to, be, sent, to, the, llm, as, well [6:20] so, the, full, prompt, might, be, your [6:23] instructions, it, might, be, something, like [6:25] please, use, this, content, um, in, order, to [6:28] answer, the, patient, question, at, the, end [6:30] and, then, you, put, in, a, bunch, of [6:32] information, about, parking, or, about, knee [6:34] surgery, or, whatever, the, patient, asked [6:36] you, put, that, in, the, prompt, before, the [6:38] prompt, then, you, have, the, question, then [6:40] you, send, that, whole, package, to, the, llm [6:43] and, the, llm, will, give, a, great, response [6:45] based, on, your [6:47] content, okay, with, me, so, far, so, um, so [6:51] this, notion, is, the, prop, before, the [6:53] prompt, um, and, and, that's, why, prompt [6:56] engineering, and, these, types, of, things [6:58] are, a, big, field, right, now, now, because [7:00] you, can, really, hone, the, um, these, systems [7:03] by, doing, a, better, and, better, job, with [7:05] the, actual, prompt, before, the, prompt, um [7:08] in, uh, in, this [7:10] style, now, the, last, trick, here, is, your [7:14] website, or, your, content, is, huge, and, it [7:16] talks, about, all, kinds, of, topics, Beyond [7:19] parking, and, Beyond, knee, surgery, so, you [7:21] really, want, to, somehow, pull, out, only, the [7:24] parts, of, your, content, that, are, relevant [7:26] to, the, patient's, question, so, this, is [7:29] another, um, a, tricky, part, of, this, whole [7:32] rag, architecture, uh, and, the, way, that [7:34] works, is, that, um, you, take, all, your [7:37] content, and, you, break, it, into, chunks, or [7:40] these, systems, will, break, it, into, chunks [7:42] so, chunk, might, be, a, paragraph, of, content [7:44] or, a, p, or, a, couple, paragraphs, a, page [7:46] something, like, that, and, then, those, um [7:50] chunks, are, sent, to, a, large, language [7:53] model, could, be, the, same, one, or, a [7:55] different, one, and, they, are, turned, into, a [7:58] vector [8:01] and, uh, so, each, each, paragraph, or, each [8:04] chunk, will, have, a [8:06] vector, which, is, just, is, just, a, series, of [8:09] numbers, and, that, series, of [8:12] numbers, you, can, think, of, it, as, the [8:14] numeric, representation, of, the, essence, of [8:17] that [8:18] paragraph, and, what's, uh, different, about [8:21] these, numbers, just, they're, not, random [8:23] numbers, but, paragraphs, that, talk, about, a [8:25] similar, topic, have, close, by, numbers, they [8:28] almost, have, the, same, vectors, okay, so, in [8:31] addition, to, the, uh, it's, a, numera, Zed [8:33] version, of, the, paragraph, but, it's, such [8:37] that, similar, paragraphs, on, similar [8:39] topics, will, have, similar, vectors, will [8:42] have, similar, numbers, so, that, means, that [8:46] what, happens, is, when, um, uh, a, user, will [8:49] ask, a, question, like, do, you, have, parking [8:51] let's [8:52] say, then, that, is, also, sent, to, the, llm, in [8:55] real, time, right, after, the, user, asked, the [8:58] question [8:59] that, comes, up, with, the, vector, as, well [9:02] you, could, think, of, that, as, the, question [9:04] vector, and, then, what, happens, we, do, we, do [9:06] a, mathematical, comparison, real, quick [9:09] between, the, vector, of, the, question, and [9:11] then, the, vectors, of, your, content, and [9:13] pick, like, the, top, five, documents, that [9:15] are, closest, to, this, question, so, do, you [9:17] have, parking, will, be, a, vector, then, you [9:21] have, all, your, content, and, it's, going, to [9:23] try, and, find, the, five, documents, that [9:25] taught, the, most, about, parking, basically [9:28] um, and, so, it'll, find, those, I, don't, know [9:30] what, that, is, it'll, find, those, documents [9:32] let's, say, uh, from, these, it'll, grab, the [9:34] paragraphs, associated, with, those [9:37] documents, um, and, it'll, use, that [9:41] here, so, those, will, be, the, subset, of, your [9:45] content, basically, that, is, used, as, part [9:48] of, the, prompt, before, the, prompt, okay, so [9:51] this, whole, uh, concept, is, uh, kind, of [9:54] vectorizing, your, content, uh, typically [9:58] that, then, our, storage, in, something [9:59] called, a, vector, database, which, is [10:01] basically, a, representation, of, your [10:03] content, in, this, numeric, form, and, then [10:06] this, system, that, you, build, this, rag [10:08] system, will, uh, take, the, question, find [10:12] retrieve, the, most, relevant, content, make [10:15] that, as, part, of, the, prompt, before, the [10:17] prompt, send, that, to, the, llm, and, then [10:20] you'll, get, a, good, response, back, actually [10:23] so, it's, a, little, bit, confusing, but, um [10:25] but, it's, actually, not, that, confusing, um [10:28] uh, I, just, made, it, more, confusing, by, this [10:30] horrible, uh, horrible, drawing, but, this [10:32] whole, thing, is, um, what, is, uh, called, rag [10:37] retrieval, so, you're, retrieving, the [10:39] relevant, documents, from, your, content [10:42] you're, augmenting, the, generation, process [10:45] so, you're, augmenting, the, lm's, ability, to [10:48] do, generative, AI, based, on, the, documents [10:51] that, you, retrieve, so, that's, why, it's [10:52] retrieval, augmenting [10:55] generation, okay, so, I, hope, that, made [10:58] sense, uh, like, I, said, this, is, a, very [11:00] popular, um, solution, pattern, that, I'm [11:03] seeing, over, and, over, again, in, fact, the [11:05] majority, of, llm, projects, that, I, see, are [11:08] this, kind, of, thing, using, my, content [11:11] packaging, that, up, with, an, llm, system, to [11:14] create, a, kind, of, chat, chpt, like [11:16] experience, for, my, employees, or, for, my [11:20] customers, for, my, users, that, kind, of [11:22] thing, and, it, works, extremely, well, that's [11:24] why, uh, that's, why, it's, so, popular, so, I [11:27] hope, that, was, interesting, and [11:29] educational, and, made, sense, if, you, have [11:31] any, questions, please, leave, them, for, me [11:33] uh, as, part, of, the, comments, uh, thank, you [11:35] very, much