Transcript
A (0:02)
If you're a law firm owner who thinks like a business owner, not just a lawyer, this is for you. July 17th and 18th, we're hosting our next in person Mastermind in New York City. We're kicking off with a strategy workshop with Jessica Gonifiss of Silver Peaks Accounting. Dialing in your numbers so you can make smart CEO level moves. Then it's straight into Mastermind hot seats. No fluff, no filters, just real strategy, real feedback and, and breakthroughs. Plus we're hosting an exclusive dinner. Bring a plus one. Connect deeply and build the kind of relationships that transform businesses. If you're ready to think bigger, move faster and scale smarter, get your Mastermind ticket@maxlaw events.com.
B (0:48)
This is maximum Lawyer with your host, Tyson Mutrix. Welcome back to another Saturday episode of Maximum Lawyer. And today I'm going to be talking about some more AI Agents because that's what people have asked for in the comments on YouTube. And so that's something I'm going to cover. So the next four episodes we're going to be talking about AI agents. Just so you know, people ask for more detail about some of the frameworks that I talked about. And so I'm going to give you some more detail. And if there's more that you want after that, I'm happy to cover that as well. Many of the comments that we got were about wanting more detail about them. And so what I'll do is I'll show you some of the things we're doing. If you want a basic understanding, go check out my previous episode on this. And the name of that episode, if you're looking for it, is you're wasting hours. Win them back with AI Agents. That is the name of that episode. And so you can, it's. I try to explain everything in a way where if you're listening to it, you have a good picture of it. But I do show my screen on YouTube. So you might get more out of it if you do watch it on YouTube, but you're not missing anything. I'm still covering everything in a way that you can understand it. I'm more of a visual learner, so for me, actually seeing it is better. But before I get into today's episode, just a reminder, keep the text coming. We're trying to be as responsive as we can when it comes to the comments and text messages and everything else and, you know, messages we get online. That way we can cover everything. I just, there's not enough episodes in a week for us to do everything. But I'M trying to get to, trying to batch as much as I can so that if there's a certain topic that is consistently coming up trying to cover it. So that is what I'm doing and the level of detail that sort of I think people are wanting. That's why I'm doing four episodes. So, you know, I'm covering each of these so that they're sort of, they're bite sized. But there's, it's enough detail on the AI agent stuff that you have a better idea as to how it might work. But if you do want to text me with anything else you want me to cover. 314-501-9260 if you are watching on YouTube, just leave a comment. And we do check all the comments. So that's another way of an easy way of doing it as well. But I always love to hear from you. So text messages. I always prefer the text messages but you can do either one. But, but let's get into today's episode and I'm, I think what I'm going to do is I'm going to start off by showing you the first one we're going to cover and that's the one we're going to cover today. And that's prompt chaining. And I do show this in the previous episode but I'm going to show it to you again and I'm going to show you a new one. This is actually a new one and this one is an email campaign. So you can see there's two here. All right. And there's. And I'm gonna show you why we have two for in a second. This originated because one of our attorneys, she wanted a, just to have a draft email created for emails that come through that need it. Okay. And that's, that's what we built out. I, I don't know if you've seen ads for. I think it's called Fixer F F Y X E R I think is the name of it. I've seen some, some social media came ads for it. I think it's similar to that. I think that that's kind of what they're doing there based on those ads. Seems like a cool concept but we decided it's like, okay, well that's something we could easily do with N8N and so let's just do it. And that's what we did. So we set up her. The email trigger and the one we started with. And the reason why this is why we have the two different campaigns. You've Got the reply to select emails, email sequences set up, right? So you've got these, these two different sets of, of prompt chains that are set up. One of them is with. It's a little bit longer and that's the more detailed one. That's the one that's reply to select emails. And then I've got a shorter one and that's reply to all emails. And so the one that's longer, it has two AI agents. So what happens is the trigger is email comes through. You extract all the email data out of that email. An AI agent, this is the first one, goes through and evaluates whether or not a response is needed. So we give it some criteria and determine if the following email requires a response. Reply with yes or no, and we give it the email content. So AI actually goes through and determines whether or not a response is needed. So that what that does is if like a court notification comes through or a calendar invite, something like that, anything that comes through that doesn't need a response, well, guess what? No response is needed. And then if a response is needed, then a more detailed response. And so it gives the more detailed, we give it more detail. We give it the subject, the message, the sender, all that. The reason why we put the sender in there is so that we know who we're replying to, or at least the agent does. And this is one where, if you see, I'm not going to read all this for everybody, but this does give the instructions. I'll give you the beginning. I'm a personal injury attorney. You're a helpful personal assistant. And your task is to draft replies on my behalf to my incoming emails whenever I provide some text from an email, return an appropriate draft reply for it, and nothing else. And we give more detailed instructions below. And what it does is it does a pretty darn good job of creating. And I showed some of the actual draft emails in the guild a couple weeks ago. It does a pretty good job. It doesn't always get the context right. And so it. That's fine. What we're looking for here is something that it's about 80 to 90% of the way there. That way, whenever the attorney goes in and she takes a look at it, makes a couple edits and boom, can fire it off and saves a ton of time. Okay, now the reason why we created the second one here, all right in it's because, and this is the shorter one. So those of you that are not watching, there's the reply to select emails, and that's the One where it filters it out and then we created the second one because this is the one that replies. It creates a reply to all emails. The main reason is because the reply to select emails was filtering out too many of the emails. And to fix that issue we just said, okay, we'll just create a response to all emails then and if she doesn't want the other one, she'll just delete them. And that tends to have worked out better. What we could probably do is I could probably take some time here and create a better criteria for whether or not a response is needed. This is fairly new, so we. It's not something we have. I've wanted to go back and test yet, but with some fine tuning, the reply to select emails would be just fine. So. But this is the setup, okay? Just I want to give you kind of the setup as to what that looked like and when you might want to use the. The prompt chaining framework versus otherwise some of the others. So just some of the key concepts, right? What we're looking at is you're really just talking about sequential processing where you go one after the next after the next. And it's a really linear fashion. And if you're a linear thinker, that might be easy for you to understand. But just know that prompt chaining is not going to be the ideal framework for every situation. It's just not. You can't go in a lot of situations from one to the next to the next to the next. Some of these other frameworks are going to be far better in certain situations. Another key concept of this is that you're talking about really specialized agents, right? Where these are, they're optimized to do one specific role. Okay. If you'll notice, I. And in one of those there was only one AI agent, right? It just drafted an email in the other ones. And those other things in there, they're called nodes. So they might do. It's more of a thing of those as more like an automation piece where you can kind of like you could. We've had automation for years at this point, right? Well over a decade. So there's a lot of. There's a mix of AI agent and automation with some of this stuff. And so some of those other, other nodes are just automations. But in the other one, the one the reply to select emails sequence or that framework, you have two. You have one AI agent that's doing the analysis as to whether or not a response is needed and then the next one does the reply you want them to do. You know one thing really, really well, having them do everything is not a good idea. Same principle applies to AI agents. So think about that too. And when it comes to prompt chaining, you're probably going to see a little bit of higher accuracy with some of these things going through. You're also going to see, because you have so much specialization, you're going to clarify the roles quite a bit. So you're at the make sure that you each agent, since it's so specialized, it's going to need a lot of clarity. So that's why you might want to use the AI prompt chaining because you're talking about some of the improved accuracy, right. Going one after the next after the next. Because it is so well defined, you can really control the outputs. So because every single AI agent is pretty carefully tuned, it has to be, otherwise the rest of the chain doesn't work. And you can also monitor each of the agents individually and you can determine where any of the failures are coming and then you can fine tune it more and that way it gets better and better down the chain. Okay, so that's another one of the reasons why prompt chaining might work. Also related to that, debugging. It's a lot easier to debug in situations like this because you can go to the spot where the failure's happening and you can go fix it right there. It's really easy to identify, especially in a program like N8N. You can see, okay, did this fail? Okay, yes, and if so, where you can go find it pretty easily. So the ease of debugging is pretty good. I mean this could apply to one email or to millions of emails. Pretty easy to scale. This one not too bad. All right. The accuracy of it is pretty good, easy to debug, easy to scale, and that the specialization pretty darn high. The one of the things you're going to have to really think about is, is that whenever you have it's really inputs and the outputs, the inputs and the outputs. This is an important part of prompt chaining is you got to remember, if you have multiple agents, the first agent is going to get an input from somewhere, but its output is really important because the outputs are going to be used by each of the subsequent agents for the most part. And so making sure that the first agent is pretty darn important because you got to make sure that the outputs are really good Agent that we had where we had the two agents and the first one was just trying to, it was determining whether or not a reply was needed. We Just said yes or no. That's the only output we wanted. Gave it a very specific instruction, yes, no, we didn't want any other detail. And that allowed us to do some other things down the chain when it comes to filtering out different emails. So that's important. The just kind of, let's say you have a three agent framework. The way you would, you would probably set this up is agent one. It's got that initial processing, right? It's going to break down the information that's coming through. It's going to structure it in a way that with the output that it can be really easily used. Kind of like an outline for the rest of the agents. And then maybe agent number two, that evaluation sort of an agent refinement, maybe they're refining things a little bit and they're taking that output that they received from Agent 1, make the changes that are necessary and then move it down the line. And then you can use agent number three with that content generation. What we didn't do, we didn't use that second agent in our email flow because we didn't really need to. We just really wanted to know was there a. Because there was no outline created, what we were doing was, is a reply needed? That's all we needed to know. But if you were generating content, you would probably want to have that where an outline is created and then the content's created, where you're getting that more refined sort of content. Okay. And then if you wanted to add a layer onto that, like a fourth agent, you could then use an agent that really fine tunes that like edits that final content and polishes it out for you. And almost like a newspaper would use an editor, which is another way that you could use it. So just again, to give you a real world example, something that we had shown before was creating the article writer where you go through and you had the agent create the outline and then the outline editor and then the article Reddit and then you had someone, an agent write the title and then someone, an agent write the, the meta tag. And, and that was. So that's a 1, 2, 3, 4, 5 agent sequence that we have. And when it comes to writing articles, and I'm talking about blog posts is what I'm talking about. But in for that, that one, we just called it, we called it Articles. I want it to be written like an article and that's why I call it Articles. And that's also why that's the same instruction that we were, we're giving the, the agents as well. I want to get in a little bit about prompt design. Okay. And the agent specialization, because each of the I want to kind of specialization really matters. And so each of the agents system prompts should really do a really good job of describing the role of that agent, what the goal of it is, and then the output expectations. Okay. So, you know, you are an expert content planner. Your job is to create a structured blog outline with clear sections and bullet points. Right? That's like the beginning of what you'd use for like an outline agent. For like an agent that's going to evaluate. For an evaluation agent, you are a critical evaluator. Refine the provided blog outline to ensure logical flow completeness and clarity. That's how you might start the evaluation agent. And if you have other detailed instructions below that, you do that. For example, like the email one I showed before, it was having problems giving out outputs about dollar amounts. So for example, email comes in about an offer and then the reply might be, thank you for your offer of $12,500. Well, it was having problems putting the comma in there and the decimal point in there and also the dollar sign. It was just like. It was just the numbers. And I gave it instructions on where I put the dollar sign, where put the comma, all that. And so you might have to give it some further instructions like that. But that's part of the testing process too. Just know that there's gonna be some testing with this too, but you wanna make sure you're giving very specific instructions. And if there's anything unique about your practice area, you're gonna wanna make sure you add that detail as well. Hopefully you're listening to this or watching this one first before you watch the other ones. Cause I am giving a little bit more detail about how to guide some of these agents that I'm probably not gonna do in the subsequent one. So if you. It's good that you're starting here because I'm gonna give you more detail here than I will probably in the other ones. Just because I. This one's probably gonna be a little bit of a longer episode, but that'll allow me to streamline the other ones for you. So you have a pretty good understanding. And I will remind people in the other episodes to make sure to come back and watch this one first. I do want to touch on N8N and the reason why we're using N8N. I don't get paid by N8N. There's no affiliate links, nothing like that. But this is something that it's Kasha. When all the agents that we tested out, all the different platforms, this is the one that we can modify the most. This is the one that gives us the most flexibility. It has the most integrations. It is the. When it comes to the learning curve, it's higher. Luckily I have someone like Kasha that can help me get over the hump on some of this stuff. If there's other platforms out there that are a little bit easier, easier to use, you're not going to be do as much, be able to do as much with them. The flexibility with being able to do things with coding that you can't do with other platforms. It's a pretty vast system. It's pretty awesome. And there's a lot of cool GPTs built out in OpenAI that you can ask questions and it'll just give you the code that you need to copy and paste. I've done that on a few different things. It's a pretty cool platform. Let's talk about monitoring a little bit. Make sure that you're constantly checking on these to see what the outputs are, checking for error rates, all of that because you want to make sure that you, you're gonna have to refine these over time. It's just like if you're training an employee, right. That's why we train a lot with our firm and you have to kind of go back and retrain on things. Same things with the AI agents, sometimes they can kind of get off base. Especially if you're using any sort of platform that's a self learning platform where they're using something like a rag system which I'm going to talk about in a completely different episode by that's going to be. It's a lot to cover. So. And it's a pretty complex thing. So if you don't know what reg means, don't worry about it. If you, if you're using some sort of a self learning system, then you're probably going to have to retrain over time because there's probably times where you're going to have to debug or retrain and all that. So make sure you keep an eye on things. Just to kind of recap when it comes to sort of the advantages, potential challenges, I guess I'll cover to a little bit. When it comes to prompt chaining, you're probably going to get some higher content quality because you are refining it as you go down the process. And that's one of the great advantages of a prompt chaining. Easy to debug it find out where the issues are. That's pretty great. And then also it's such a simple thing that you can scale it and you can. It's also adaptable to other workflows, which is pretty cool. You can use this with pretty much every other workflow. It can be upchain, down, chain, whatever it may be of the other workflows too. That's another one of the cool features of this. Some of the challenges of it, you do have to be a little. You have to refine the agents quite a bit more. You have to be very specific when it comes to the roles. You got to clearly document each agent's roles, their interactions, the outputs and all that too. So that is, there are some challenges with that. Cost control can be another thing too, depending on which platforms you're using, which LLMs you're using, which LLMs. As you'll recall, those are the ChatGPTs of the world, the Grox Gemini. Those cost money to use. If you're just firing a bunch through it, costs can go up quite a bit. Keep that in mind, depending on what you're pushing into it and pushing out of it. That could cost you a bunch of money if you're not paying attention. All right, so just to give some final tips, make sure you clearly define those rules. I'd work with a worksheet or beforehand, like a spreadsheet, to make sure you figure out what all the roles are. Maybe scratch it out on paper, decide, okay, how do we want this thing to look? What do we think this is going to look like? And there's been a few times where I thought it was going to look one way and we ended up changing it and making it better. But having that visual is pretty handy. And then having those rules to find out, pretty good. Use Chat GPT or some other LLM to help you with some of those instructions. Pretty darn good. Like I said, that GPT just search N8N if you're using N8N in OpenAI and chat GPT and you can find there's some really good GPTs in there too. Test, test, test. Make sure you test this a bunch. Really, really important make. Okay, so this is another one too. Make sure you're using the right models. What I mean by that is if you ever go into Chat GPT, there's several different models. Claude, all of them have several different models, right? And some of them are better for creating images, some of them are better for writing, some of them are better for reasoning. Make sure you're using the right ones for the tools that you're or the agents you're creating. That's really, really important. Make sure you have some sort of schedule for monitoring things so you can go in and check and make sure everything's going right. Because if you don't, and that's really for any automation, but that's something that is important. And then make sure you iterate, make sure you get better. Don't just set it and forget it. Come back and change things if it's not working the way you want it to. All right, I think that's everything I want to cover today when it comes to prompt chain. I'm just looking through my notes and see if there's anything that I want to cover, but I think that's all. I think that's enough for prompt chaining. The next one that I'm going to do, I'm going to talk about routing. Routing is going to be a really good one for emails and routing emails and any big major flow of information that you have coming through and then routing it to where they need to go. This is going to be the episode for that. So I'll cover routing in the next episode. So stick around for that. Before you head out though, remember that we're really open up the floor for questions. So if there's anything that you have about starting or running a law firm, maxim lawyer.com forward/ask. You can also text me. 314-501-9260 it doesn't matter if you're just starting out. If you've been doing this for a while, you just want some help, right? Just let me know. You could be somewhere in the middle and you're kind of stuck. All good, we've got your back. So maxmuller.com forward/ask or shoot me a text and I'm happy to help you out. Remember that until next week, Consistent Action is the blueprint that turns your goals into into reality. Take care.
