work with me (prepping for a talk at Harvard)

In this live YouTube stream, Tony Kipkemboi walks viewers through the end‑to‑end development of a CrewAI workflow he will present at the Harvard Kennedy School. He starts by setting up a collaborative coding environment, then designs three agents – a senior web scraper, a senior research assistant, and a senior reporting analyst – each with carefully crafted prompts that assign seniority to improve output quality. Tony builds a custom web‑scraping tool, experimenting with Firecrawl, Crawl4AI, and ultimately a BeautifulSoup‑based scraper to pull all presidential executive orders from the White House website, handling API keys securely. He integrates the tool into the CrewAI framework, configures tasks, and adds necessary dependencies (lxml, Serper.dev, etc.). Throughout the session he encounters and resolves errors, adjusts model choices (Gemini vs. OpenAI), and confronts token‑limit challenges. To overcome context window constraints he implements a chunking strategy that splits the 114 executive orders into manageable groups, modifies the reporting analyst to process these chunks sequentially, and defines a detailed markdown report format styled after the New York Times. He also discusses future extensions such as daily monitoring, newsletter generation, and Slack alerts. The stream ends with a reflection on the progress made and plans for polishing the project.
Chapters
Okay, so welcome everyone. I see a few folks here in the in the stream. Cool. Like the title says, I'm just gonna be really chilling and working, so you can join me and chat. I'm just gonna be working through some some stuff that I'm working on that I'm. that I'm building for a presentation that I'm going to be giving pretty soon. So feel free to say hi in the chat and let's chat. Let me know. It's going to be a CrewAI topic or agents topic that I'm going to be presenting next week at Harvard Kennedy School. So I'm just kind of taking the time to kind of jump online and, you know, prep also and build some agents in the process and just show you how I kind of run my, I guess, my prep. So feel free to join in. I'm just going to share my screen here in a second. Let's see, cursor. There you go. Now we're gonna go over some few stuff that'll be— yes, I'll just show you what I'm doing here. So I'm working on a presentation here. Just open this project. Uh, let's go to So that way you don't see my API keys for good measure. So now I'm just putting in my API keys. I'm gonna save that and then I'm gonna turn it back on. I've already put my API keys. Music playing. Okay, just let me know if everything is good now. Just have to monitor my audio here. And also let me know if the music is too loud, you know, in the chat. I'll, I'll tune it down. I just want to make sure that y'all have a good experience. All right, cool. Now let's go back and figure this out. So first of all, here I I do have the agents. So we go through the agents. I have researcher. Those are just like the plain old vanilla agents that I have. That's not what I want per se. So I think there's some others that I could have on there that could be better. Um, let's check something here real quick. So let me start with— yeah, I can start with researcher. So I need the first one that does scraper. Let me just call him scraper web. Web scraper, and its role is just to senior. Let's just call them senior web scraper, right? So that way it has some seniority, and it knows that there's a lot expected of it in terms of output because it's it's senior. So it's just like a trick for prompting agents that I found. It's just like. If you, if you wanted to perform better, of course you've got to give it some good titles as well because it has to have a role. Um, and I think giving it a senior title, for example, like that, then it just kind of tells it this is what's expected of you. You need to produce just like senior quality content, uh, output. So, and, uh, here we'll just tell it to The goal is to script the latest executive orders from the White House website. And here we'll just— oh, it's already suggesting, so there's not really much for us to do. So you're a seasoned web scraper with a knack of uncovering— for uncovering the latest development in executive— not the latest development We use Season Web Scraper of presidential executive orders. Find the most relevant information and present it in a clear and concise manner. Not presented. All I want you to do is just scrape. That's all I want you to do. And then, um, I need a researcher, research assistant. Okay, let's see what it's suggesting here. So the role is also senior. Research assistance or research the latest executive orders. No, I don't want you to research the latest executive orders. Research. All right, so from— all right. Research, because I want— what I want to tell it here is research people that might be affected by the executive order. So research the— from the list of executive orders, find out Find out who will be affected by the order. All right, let's start with find out. What? Find out what they're about and who will be affected by them. Actually, let's just switch agencies and. Persons. Whoa, this feels like I'm writing Old English here. All right, so, okay, so, all right, let me see. Is the music loud? It's not loud. All right, cool. So from the list of executive orders, find out who— find out what they are about and which agencies and persons will be affected. Persons or citizens, citizen groups will be affected, right? Yeah, research assistants, actually agencies, even countries, right? Because Because we'll be affected by them. So cool. You're a senior researcher with a knack for finding the most relevant information. Correct. Now let's come here to senior reporting analyst and create detailed reports on the research findings, and then With a kid for detail, you're known for your ability to turn complex data into clear and concise reports, making it easy for others to understand. Okay, cool. I think that's pretty good. We just need three agents there. So we have a web scraper, we have a research assistant, and we have a reporting analyst there. Now let's go to tasks and do the same thing on the tasks. So, you know. Let's start with the web scraper task. I think that's the one we want to start with. So here we'll do web, web scraper task. Scrape the latest executive orders from the White House website. A list of executive orders with the title Okay, cool. And now research— conduct our research about the executive orders. Um, current year is 2025. A list with 10 bullet points with the most relevant information about executive orders. Let's see. All right. Conduct a thorough research about the executive orders. About the latest. Let's see. Oh, just exit. Let's just do presidential because it's then I wanted to be good views. Find out what they're about, which agencies, countries present, be affected by them. All right. The current year is twenty. 2025. All right, a list with the most relevant information about the executive orders. Um, a list with bullet points, most relevant information about which executive We're going to the citizens groups. Yep. And we're assigning that to the agent research assistant. Yeah. Now reporting task: review the contests and expand the topics into full report. Make sure your report is detailed and contains all relevant information. And citations. All right, a full afraid report with the main topics, each with a full section of information found in markdown. The report should be in the style of New York Times. All right, so we have the title, introduction, title, introduction, body, conclusion, and then under body Order name, executive, order number, order date, summary, agencies, countries, citizens versus, conclusion, references. Okay, cool. And I think what we'll need for this is context. So we're gonna put context And this should be in a list. I wanted to detect the context from research web scraper and then the research task. Web scraper task, and then we have the research research task. That's what I wanted to take it from. And also the context for this one is just taking it from web scraper task. Cool. Now let's go back here and verify. So reporting analysts, we have research assistants. I think this is research assistant task. Let's just name them correctly. And then this is reporting analyst task, just to make sure that it's mapped. And consistent. Web, web scraper task, research task. Cool, I think we've named those appropriately. So we've set up all our tasks and agents the way we want them to. The only thing that's missing is the tools. So we'll need some tools. So for research assistant here, we'll need to give them a tool, and I think here Yes, tools. The tool we're going to give it to is Serper Dev Tool. Actually, I'm not going to add the tool here. Let me just go ahead and we'll add it into the crew.py file. So close that. The other thing that I'll need here is the server, server data. Server API key. So save that. So of course again, I'm gonna turn the cursor off so I can find my server API key. Let me come here, find my server API key again. Server.dev. So if you go to serper.dev, you can find your API key there. I'm gonna turn this off so that I can pass in my API key there so you don't see where my API key is or what my API key is. Safety concerns. You should always keep your API key safe. You never know who's watching or who's trying to get it from you. So I'm going to paste that in there. Yeah, all right, cool, we're good now. Now that we've set that, this is how it looks like. So if you want to follow along with this at some point once I open source this. Now the next step is to go to CUDA.py, and we don't need a whole bunch of this to be honest, so I'm just going to delete these extra comments. We're gonna need to replace our agent names correctly. Researcher, actually that's not a researcher, so yeah, web scraper. Yes, that's correct. Research assistant, reporting analyst, that is set correctly now. So now Let's take off and let's fix the research, the, the tasks as well. So it's a good thing with having like something like Cursor and you connect it to, it's connected to an LLM on the backend that just does this work for you. Like you don't have to worry about any of this. Like it's just already automatically inferring from your repo and if figuring out what it needs to do, and it auto-suggests a lot of this stuff for you. So all you need to do is really just run it. So cool. So I think we've gotten all the stuff that we need here. Um, final report is going to be outputted, but I wanted to output to an output folder. Output folder. All right, web scraper task. Let's also have it output the web scraping tasks to this as well. Um, reporting analysts. All right, I think we're missing one task. We're missing the— we have the web scraper and then we have the reporting task. I don't think we— we're missing— I think we're missing one. So this is— here we go, research assistant. So Cool. Now we are good to go. I think the first thing that we need to do, of course, is let's go to main and fix a whole bunch of stuff here that we have. Um, I think pretty much all this is good. We just have to figure out what input we want to pass in, if we want to pass input or read just bypass it completely and add all the parameters that we need to in there. Um, I see you in the chat, bro. Hey bro, I watched your local reg system project and implemented it with some personal changes. Due to that project, I got an internship. Thank you, brother. Awesome, man. Good stuff, man. I love it. Thank you, thank you. Appreciate that a lot. I'm glad you got the internship, man. Good job. Yeah, this is what I like to hear. I'm celebrating over here with you, man. I'm celebrating with you, man. That's fantastic. I'm happy. I'm glad it helped you get an internship and anything really that, and that's the purpose, right? Like pass information out there. Hopefully somebody benefits from it, and I'm glad you did. If you have any suggestions, actually, you know, in terms of what you would like me to build on, I've seen some suggestions of people asking me to deploy that entire RAG project that I built, the one that you implemented as well, deploy it maybe on AWS or any other cloud provider and actually have it hosted where somebody can use it in like as an app, a full app that's deployed. So I think there's interest in that and I think I might actually just do that. Now I'll probably gonna get spin up some AWS, um, you know, maybe Dockerize the entire project, deploy to AWS with, uh, Ollama as well and just do it like a tutorial on it and see if, you know, anybody else might be interested in that. If you're interested in that, let Let me know. Absolutely. Got some other exciting videos that I'm planning to record pretty soon as well. But yeah, really excited for you, man. That's awesome. I love that. I love that. That's absolutely awesome. All right, let's see. I think we were here trying to get to the next stage. Now you notice we're getting errors there. So first of all, I need to create my virtual environment. So let's come here and do python3 module is virtual environment, and I'm going to name it venv. Then I'm going to activate it, and this is just like one-shot command that I'm gonna Run here to create the virtual environment, activate it, and then once it's done with that, also install CrewAI. So uv pip install, and I'm going to call it crewai-tools. And this is just one shot. It's going to install all— it's going to create a virtual environment, activate it, and then install CrewAI all in one command. And all you have to do use just like that double ampersand after each command. And that's just if you, if you're watching this and you've never played around with, um, just the bash command, just kind of learning some of these Linux commands, that's quick and easy dirty way of doing that in one shot. So cool. Now let me go ahead and verify that we have the latest version of CrewAI installed. So to do that, if you do pip freeze The delimiter and do grep CrewAI. Yeah, so we do have CrewAI 102 and CrewAI Tools 0.36. So those are the latest, so we are good on that front. So we should be good to go on that aspect. So the next thing— oh, I added the text that I meant to clear, added on to the code itself. So that would have caused the bug. So I think most of our dependencies have cleared there. The next thing I want to do is, remember we have the first agent that does the web scraping. We don't have a tool for it yet and we need a tool for it. But before we do that, there's one that we already— like the researcher, we know it's going to use SerperDev. So let's go ahead and import SerperDev here. So it's already suggesting it, so fantastic. So if you come here to research agent And let's just give this agent the tool to do that. So there you go. So we gave that Serpa Dev tool for this agent, for the research agent, which is going to do the web research. So we are good with that. The next step for this would be the reporting analyst doesn't need any tool really because you're just reporting on what you've already received from the other agents. So yeah, it doesn't need any of that. The next step here is for the web scraper. We need to actually scrape the, the White House website. I don't know, it should be illegal, I think. Presidential actions. So I'm gonna show you that website right now. This is the website. All right, so we got presidential actions here. What happened to my screen? There you go. Cool. There you go. So these are the presidential actions and it has all the— all right, I'm just going to pause here. I think Dig Vijay, can you create a roadmap for AI LLM engineer? Basically like AI engineer roadmap with project. Also me and my friend created the project UI with React adding more. Grateful for your work. Yeah. Look, if you, if you, if you could share that project, like I'm happy to like amplify on socials as well if you want to get more like reach. Um, if you want to get more viewers to your project or just get more eyes to your project, um, I like doing that because like everything I build, I like to share because it builds your brand. So it speaks for you, it speaks for your work. You know, when people say show me rather than tell me, uh, or show rather than tell, this is perfect opportunity for that. So if you're open to it, if you share with your project Like the links, if you are open sourcing it, for example, if you want to share the links and all that, you know, I'm happy to reshare that on my social accounts as well and to get you more viewers or even more users of your project. So happy that that worked out for you. And I'm excited to see what you create in terms of the UI, how that looks like. So that's awesome. And I'm guessing you already deployed it. So that's awesome, man. Love that. For the roadmap, that's a really good question. Roadmap for AI engineering. I think that's something that I could definitely build. I could definitely create. I think that would probably, for me, would probably be— I'll probably start with it as a blog first and then convert it to video, if that makes sense. Like, start with, hey, this is what I think you should have on your roadmap to become an AI engineer. And then and do a video on top of that. And actually, I'm going to be blogging more. My blog is just tonykipkemboi.com, and you'll find my blog, my page, everything on there. I should be updating it more often than I am. But cool. For this case, the agent is going to— is going to come to this website, which is the Presidential Actions website, actually using a tool. So I'm going to give you a tool. There's so many tools that I could use. So I could use I could use Firecrawl, for example, but it's a paid API. So if you come to Firecrawl, they do have— let's see what they have here. They do have an API where you can actually just scrape to like different levels because presidential actions, right? Like there's a lot of executive orders that the president already signed. So adjusting imports for aluminum, this was February 11th, February 10th. So he did sign a whole bunch of them, and this goes all the way to like, it's 12 pages now, you know, from the day he got into office on January 20th. These are all the executive orders he signed. I'm not sure, it's like more than 100 at this point. But yeah, so the goal is to scrape all of them and not just the titles, also go in and scrape, get the date, get the title of the executive order, get the dates when it was published, and also get the content because we want the agent to understand the context of all the content of the entire executive order, for example. And then figure out from all this who's getting affected by that executive order. Is it a— if it's a country, what countries, if it's people, which groups of people are getting affected, if it's agencies, government agencies, which agencies are getting affected. Basically figure out who's getting affected by which executive order and then generate a final report that just says there's this executive order and it's affecting these people. That's the goal of this really. So Firecrawl, you could use Firecrawl and let's look at the pricing. Yeah, let's go to pricing because not all APIs are free. So the free plan, you get 500 credit— 500 credits, um, one time, no credit card. So you can scrape 500 pages, 10 credits, uh, per scrape per minute, one crawl per minute. So I mean, it's still pretty good. It'll get you some stuff done there. So if you want to use Firecrawl, that's an option. And if we come here, look, let's look extract. That's their latest API. But let's look at what you could do. So try for free. Actually, let's go back. Let's see, let's see what we want to get. Maybe we want to get executive actions. Let's see, presidential actions. Let's try that. See what it gives us. So we've told it to get all the presidential actions. So you have title, description, URL. Okay, dates, description. Why not? Let's turn it on. Enable web search, uh, extract title, date, description, URL of each president. Show that the title. Okay. Let's run it. Let's see what it does. So it's running through that because one thing that I'm thinking right now is, yes, it probably could do that, but it might just scrape, you know, just the page, just all the content here. Like, hey, there's this, there's that, just the titles, the date and all that, but really not scrape the content inside of it. And I think I was right. So you do have the URL, the date. Yeah. And I don't think you paginate it either. It's just that. So I think they do have crawl, which is different, which might actually be better. So let's see. Limit crawl option, number of pages to crawl. Let's limit it to— I mean, I think we have 12 pages now in the executive orders, right? Yes, 12 pages there. So let's put max depth is— what's this about? Maximum depth to crawl relative to the entity URL. Um, let's just put 1 because when you go to that URL, if you go to The next one. Actually, it might be more. So what if we take this out? What do we get with that? We get a 404. Okay, so what if we do that? Yeah, we still get an error. So that's— I think that's one step. So Cool. So I think that's one, one step. So let's go ahead and add that max depth. Ignore sitemaps. Allow backward links enables the crawler to navigate from a specific URL to previous linked pages or pages that are not children of it. Sure, let's do that. Exclude include-only paths. Okay. Page options. Exclude tags. All right. Similar to Firecrawl. It is developed by my mentor. What, uh, what is that? What is— what are you referring to? I know you say it's similar to Firecrawl. There's so many of them actually. Um, I'm not even sure which ones. I mean, it's— there's Firecrawl, there's Exa, there's Crawl for AI, some free ones as well. And I think I'm gonna be doing the free ones, to be honest, as well in this case. I mean, I can just use vanilla all, especially if there's limitations in terms of when I include page links, especially if it's— let me run this first to see what we'll get from it. Especially if it costs a lot because I have to pay for this stuff, then I might as well just build maybe a scraper just using something like BeautifulSoup Or Selenium and do it myself. But yeah, I think it did pretty good here. So it did go to the first link. White House briefings fact sheet and then markdown White House. The White House building. No, that's not what I wanted. Ground floor corridors. Yeah, that is not what I wanted, but you know, it is what it is. So I think that's out of the picture right now for me. I think I'd rather go ahead and build my own scraper in this case that will do the job for me. So I think I had already kind of built one. So let's just— so if I go to Collab. I had built one, I think, a few days ago. I just want to go over it for, for you so you can see what, what it does. Um, man, I got a lot of stuff in here. All right, so I did try Firecrawl. It worked, which is this here. So if we install that, let me just zoom in as well. So it did work when I ran it, I think. Yeah, it did work. So let's see, it produced a lot of content here, which I wanted, but It's a lot of cleaning to do and a lot of extra information that I don't really need. Um, but I think this is the entire call to do that. So if you wanted to run this, this is where you would get it. And so if we run that, it'll get a fire call API. And basically here what I asked it is I passed an API key and then I just told it, you know, this is the link still, the presidential actions, and I gave it Limit to be 2, max depth 3, scrape options. Um, we'll actually put max depth to 2 and see what happens. Format, I wanted to do Markdown, but I told it to just get the first 2 executive orders so, so we can see what it does. So let's run it again and see. So it's currently running that. Um, But on the other hand, while that's running, um, this is just how to clean it up, and it did clean up. But here, on the other hand, here's what I ran individually, like just using, uh, Crawlful AI, which did a pretty good job, to be honest. Got what I needed. Um, but then I think I ran into some issues when I was trying to do it separately. So what I decided to do here is just use the good old BeautifulSoup to, to do the job. So I went ahead and got what I needed with BeautifulSoup, and this is what I used for BeautifulSoup, and it worked out pretty awesome. Um, so here it is. from Firecrawl. It got the first page, um, should be 2 pages that it got, but let's see what it got. Oh, I just got max depth of 2, so let's change it to 3 because I think that's the problem there. So max depth of 3, and then once that's done, we're gonna clean it up with this code. It's just gonna clean up the links so it looks pretty cool, and then it's gonna download it as well. So you should be able to see it here once it downloads. This is using Crawl4AI, and Crawl4AI is pretty good. It did get some pretty good content, fetching complete. It's free as well. You can just use it, pip install. But I think I'm not going to use it. I think I'm going to use something else. All right, I'm gonna put the chat over here so you can see what's going on. All right. Hey, Dig Vijay, I know you mentioned similar to Firecrawl. It is developed by my mentor. Could you say what that is? Like, what did he build something similar? What what that is? All right, let's go up here. So it did finish running, and let's just see what it produced. So it saved it and printed for us. But this is it. You got 2 of them, I think. It should be 2. If we look here, after I cleaned it up, this is how it looks like. So you can see here we have presidential executive orders, flying the star, flying the flag half-mast. This should not be there because it just really takes Where does this take? I think it takes us to the main page. Yeah, I don't know why I saved that, but that should not be there. But anyway, so this is their full executive order content. So flying the flag at half mast or at full staff on inauguration day. They did sign that proclamation, and then February 18th. See, we got a bunch of links that we don't need. But anyways, that was that. That was me trying Firecrawl there, which it did pretty good. Let me not, you know, bash it. Crawl4AI, same thing, did pretty awesome. But I think what I was going for here is, let me see, on GitHub. Okay. Do you have a link for it? You know, I would love to try it as well and see what How it looks like. Maybe I could use it in one of my, uh, let's see, in one of my tutorials as well. All right, background color. All right, cool. So let's go over the, the other one that I did by myself. So this is the one with Beautiful Soup, which worked out great. And so for this one, we're getting the index, which is a function here to get the index, uh, get_index_page, and you just pass in the URL. We'll just go ahead and this is using requests in this case, so it's just getting all the HTML for that page and getting all the text, and then extract all the links is just extracting all the links for the executive orders and then getting the next page. So paginating when they come to the next section down here. So if they come to, you know, once it scripts the page, it looks for this next button here and it goes to the next page and does the same thing, gets everything from there as well. And extract date from page. So it's also getting the, you know, from the page, you know, getting the The dates, it's trying to— it's just using regex really here to be able to match that. And then get order content that we need. And then the main function here, we're just setting the start date. We want it to start from January 20th. So that's when the president was sworn in, starting from there and then coming to today. So it should be able to fetch all the pages. If there's any failure, it should tell us what it is. And then paginate, go over each page and do that same thing and grab all the, you know, all the pages and put them in this processed order list. And then it should just print. And once it's done that, it should organize them and put them in a file, executive_orders.md. And that's what it's going to do. And then just give us all the code. So if we run that and let's just monitor here, we should Have executive orders .md file once it's done. So here it is. It's running. You can see it's just. I'm sending you the link, but it's not visible, I guess. Yeah, I don't think it's visible for some reason. You could. Let's see. We connected on LinkedIn by any chance? If we are, just you can shoot it to me there. Right. So processed all the executive orders, and how many did we get? 114. Man, that's a lot. He signed 114 executive orders so far. So here's how it's organized. It looks much cleaner, right, than the previous one, which is awesome. Executive Order Number 1. So this was on 18th, yesterday, and ensuring accountability for all agencies. So, so we have here the content, we have the date, we have the content, the URL. So we have the content there. Then the order number 2 there has all the content. And this one is just expanding access to in vitro fertilization. There's money included there, which is pretty good. Such eget by which Yeah, Vishwa Ji. Let me look for that. So you get— all right, let me go to this GitHub. Okay, I see here. You get crawl of web scraping framework both for applications. Extract clean structured content from any website with dynamic content handling, markdown conversion, intelligent crawling capability, proper RAG applications, AI training pipelines. Features this async process. Okay, pretty cool. Let's see for JavaScript rendering. Configuration weights. Okay, how many stars did he get so far? He has 40 stars. Okay, pretty good. 15 forks, that's awesome. Let's see, so you got the structure there as the core, he has the models, the API as well, crawler scraper, chunker converter. Okay, it's pretty big. Here, clone, activate environment, install. So he's using Chromium Playwright as well. Cool, his Docker setup there. Single page scraping. Okay, content crawling for RAG. So using the regex there, response structure. Okay, pretty good, pretty good. I'll leave it there so I can check it out later. Um, awesome, thanks for sharing that. So yeah, I think for me this works the way I want it to. And so it scraped all the 114 executive orders, so it's quite a lot. So all the way to the first one that he signed and the beginning of his time in office, which is pretty cool. That's all we wanted. So let's come up here and see what we got. Order URL. So if I want to have this to do the scraping that I need and actually pass it to my agents, then I would need to build that as a tool within, within my crew. So if you come to tools, there's custom tools that you could build for the agent here. And I could add that as a tool in here. So we have the custom tools already. Ready to build, and I can just build a tool in here to do that. So that is the next step that I'm going to be doing. But in this case, I don't want to save anything. I don't want to save the file because it will save— it will be saved by the agent. The input that I'm trying to pass in here is the URL because that's what I want to be able to pass in. So that narrows down exactly what we want to do here in the main.py. So we'll just say here URL, and the goal for that would be just the actions. That's all we'll be passing in there. So we want to make sure that we're not passing in different URLs. All right, so if you come to getIndexPages, just want to see where we adding that current URL. Okay, so the URL that we want, cuz this is very specific to a specific URL. We don't want that, so we're passing this in as the URL. We also want to go back to our agent and actually tell it, uh, Senior Web Scraper, scrape the latest executive orders from the White House website URL. So it will infer from this URL that we just gave it and The tool that will give that agent is what we'll be building here as a custom tool. So for custom tool, let's call it— just rename this and call it, um, uh, Porter's Actions. That doesn't sound right. Actions Tool. I'm just going to call it Portus Actions Tool, so that should work. Now actually, that is not what we want to do. Let me just change this to— yeah, actually Why not? Why not? Why not? So that's the goal of this. So we have the first section here is Yeah, the first section that we have— oh man, I think I'm frozen on— am I frozen? Yeah, I think I'm frozen, right? And with this bandwidth All right, I'm gonna have to close a whole bunch of these other tabs to free up some bandwidth. So yeah, I'm gonna have to cancel the music too because I want to relieve the bandwidth a little bit to get some, some airtime because I think that's what's causing the lag. Cool. I think we're back. I'm not frozen anymore. So cool. I just had a lot of things there competing for bandwidth. So now no music, but at least we are working. It's online now. So let me go ahead and Just check if somebody's looking for me. Oh yeah. Let's just make sure that this is correct. All right, interesting. Let's see. Let me check. Just responding to some emails here, but should be able to catch up here in a sec. Um, see. Yeah, I think. Okay, cool. Let me go ahead and build. Let's build the tool, right? So we already have the tool there. I was responding to some emails there, so took a took a pause. So I'm gonna go ahead and start working on building the tool. So the tool that we have, let me see if I can paste it in here. So we have this tool, and this is just. Just a messy old long tool. So we just have to clean this up a little bit. Actually, let me just clean that up. Let me go ahead and create an extra file here, tool.py. I'm just going to have it in here and I'm just going to clean it up. And we're gonna need all this in our code up here. So I'm just gonna have to do split screen, both as actions, and just go up here. For now, let's close the sidebar. I have a split screen. Now what I can do here is come up here And add this as the next kind of tools that we need for this, for this tool, tools that we need for this tool. So awesome. Now, we can go ahead and create the index page. So we could run it. But also, first of all, see, Okay, okay, we're gonna— I could actually use What's it called? Let's let's use cursor, right? We have all this you know agents that we can use. Why not use it? So all right, so let's use the agent here. So let's ask him create a QAI tool. Scrapes all the executive orders from the Presidential Actions website. Then we'll pass in the URL. From the main.py file. We just need the code for scraping and parsing and formatting so the agent can use the data. And then we tell it here is working code from Google Colab that does this. We don't need to save the final output. To a file. We just need to return it. So cool. And now we give it the full code that we got from— now we just also want to make sure, make sure your, your Building the tool following CrewAI's way of building a custom tool as documented in their In their docs here. And then we're just going to call in the web. We tell it, I want you to access the website. So we're going to go ahead here and find the docs website from CrewAI where it talks about how to build or how to create custom tools. So I'm going to get that website, which it should go and find information from. Learn how the tool is built. Then using the code that we already kind of built, convert that into a fully functioning tool so I don't have to build it myself. And it's going to do that and hopefully fill it in here with the new tool that we wanted to actually build. So it went ahead and it says, I'll help you create a CrewAI tool for script executive orders based on the working code you provided. I'll first examine the current files. And then create the appropriate tool. Let me create a proper Create tool that incorporates the scraping functionality. Perfect. So there it is. It's already working. So it's going through here. So let's see. All right. And let's set the start date. The start date from to collect the executive orders. All right, here it's, uh, so this is the just the base model. So it's taking in, it's gonna get the, the URL, the start date, and the year. Um, cool, which is good. So it's split those into good actions. So this is the tool now, and it just says the description of the tool there. And then, um, get the index page, that's So just going to get the index page and then it's just using exactly what I had, but it's just making it fit to this tool. It's going through everything that we had instructed it to do and then it's going to run, do what it needs to do there, sort it and then output. So perfect. This is what it's doing here. So let's see where it's going to output. So we have the output executive orders by year and date, total orders. And yeah, it's just adding dollar and then it's just going to give us the full output. Let me just ask it here. Can we also extract the title of the executive order as part of the output? See if it's going to fix it. I'll modify the tool to extract and include the title of each executive order. Let me update the code. Okay, so it should be updating pretty soon here. So this is the new way of coding. I guess, you know, a lot of folks are like, well, is coding dead? Yeah, don't think it is exactly. It just it's just evolving in my opinion as well. And this is the new way of coding. You know, you call it. I think most of people are calling it you know vibe coding. So you just talk into it and letting it output stuff for you now. So I guess that works. Cool. I think our tool is ready now. So let's go ahead and close the composer. We don't need you composer. Thank you for the help. Where's that other file? I don't need this file anymore, so let's just delete that file. Cool. Now we've created the Porters Action tool. We need to add it to our agent. So let's go back to crew.py, and then we need to import, which it's already doing it for me, from tools Porters Action. Actually, we need to say from executive, the full path. Because sometimes it throws a fit if you don't do that. And we need to pass that to this first agent. So let's save that. Awesome. So it's going to go ahead, generate that. And before we run this, this should be ready to run. And I'm almost guaranteed we're going to get some errors, which is a good thing. That means we just need to fix a few things. But if we come here, we just want to make sure that in We have the executive number, executive order name, actually title. That's what I wanted us to fix. URL, publication date, all that. Fantastic. Depending on how we'll get the report, we should definitely come back and fix that. But we should be ready to go now. So if we go back to our main, let's just make sure we're doing the right thing. Yes, that's what we're passing in. As the URL, so save that. Now let's do crew AI install. So it should install all our packages that we need for crew AI, and then after that we do the run and we see what we get. There you go. There you go. Should be good. Now let's run crew AI run. And let's see what we get. It's kicking off now. Also, just for your info, I'm using O1. So it might take a minute to like respond just because the model takes a minute to think. All right. The first one is starting at least. And it's using the tool that we got that we had to actually go do the scraping. So at least we should see some, like the scraping process happening. And I believe on the tool, we should have added the print statement. So we should see the print statements happening here. Just want to verify that here before I say, okay, so are we running into issues already? Yeah. Couldn't find a tree builder with features requested. lxml. Do you? Oh, There we go. Need to install something. URL. Okay. Okay. Cool. Yeah. So we are running into some issues. I think what I need to do is add lxml. I just wanna make sure that— because I think that tool didn't really give us an error. So it's interesting to see that it's not— it's saying that it didn't find the tool. But quick and easy, we could also just give it to Composer. Yay, right? Just tell, hey yo, we got that error. Got some errors. Let's see what it suggests. My thinking is we'll just have to do uv add lxml. So we could do uv add lxml. All right, we've added lxml. So lxml-parser is not installed, which requires which is required by BeautifulSoup. Let me— what did you modify? Create— it says, what is it? I've made several improvements to handle the errors and make the tool more robust. Added create_soup helper method that tries to use lxml first but falls back to Python's built-in HTML parser if lxml is not available. Added better error handling throughout the code. 4 bags. Okay, I'll take that. All right, let's also add BeautifulSoup, right? If in case it gives us errors. So uv.add BeautifulSoup. Or it should already be there. Yeah, should already be there. Also request. Although request comes in with Python now, so should be good. Let's clear that. Cool. Now let's just accept all of that. Close that. Now let's rerun it again. Do create run. And let's see what we get this time around. It's going to build what we just added first, and then we get to the run. Not sure why I'm getting all these deprecated messages. I need to check the version that I'm on right now as well. All right. Do something. Come on now. It's taking a minute there, which is all good. Let's wait for it to to do its thing. All right. Y'all so quiet in the chat now. What are you all up to? Let me know what you're up to. Let's see what we got. Okay, so it actually went and did the thing. Oof. That's quite a lot. Yeah, it went and scraped all of it, which it—I mean—you use a tool that we wanted to. Ah, one thing that I'm thinking right now is I'm probably going to run into rate limits or context limits with. Okay, all done. Conduct the thorough research about the presidential executive vote. So now the research assistant kicks in. Interested to see what it's going to do. It should take the context from the first agent. Okay. So there it is. We have agencies research 10 executive orders. All right. I don't know if it's doing this correctly. Is it really reading from what we want? So it says list of 2023 to 2025. And their perspective. No, that's not what I want you to do. So you went and used a list of U.S. executive orders and their prospective impacts. And this was around 2025 to 2023. That's not what I want you to do. It's not what I want you to do. And then you also asked full text of 2023 Federal Register. No, you went and did what basically the other agent did, but it's going back to like way, way, way, way back. So it's getting like 2021 stuff. I don't want that. So I'm gonna have to change that. I think what I'm gonna have to do is not give it access to the internet at all. I just wanted to think through the orders that we've already kind of downloaded and look through them and figure out, okay, which one of these are gonna affect who and what is it gonna look like? And then from there, just think by itself and produce that Rather than having it go ahead and look up the internet. But it generated a report which I kind of don't agree with, but it's fine because when I looked up extra information, I think what I'm looking here as well is maybe I should go ahead. So let's see, researches. Let's go to the web scrapers first. It says it's just all done. It didn't really It didn't really give me all the scrape data, which is unfortunate, man. Very unfortunate. I don't want you to say all done. I just want you to give me the final output. The research assistant. Yeah, you went and did the research there. Okay. Here's the final report. Now let's look at the final report and See what we have. If we close this, just go ahead and it says let's close the side tab so we can see what's what's happening in here. All right, it says protecting the future of America of American policy. A report on recent executive orders. Uh, I like that title. Okay, introduction. In a transformative period of federal governance, various administrations have issued significant executive orders shaping immigration, energy, national security, blah blah blah. Okay, body. Protecting the meaning and value of American citizenship. Executive order title. No Federal Register. Yeah, see, he just went and looked up a bunch of stuff. I don't want him to do that, or her to do that. Executive order. All right, it definitely is, but it's not the one I want. Then here is as executive order persons or groups of citizens, citizens born in the US undocumented. Okay. Executive order countries, permanent effect nationals. Okay. Executive order agencies. All right. Agencies, countries. Persons. Yeah, no, don't want none of this. This is not a report that I want. So let's go ahead and fix it. So first of all, let's delete this. We don't need that. And the next step here is for us to go ahead and And actually, from the file that we have, I actually want to save the full report because the agent didn't give me any good report when I saved it. So I want to go ahead and fix that. And let's fix the tasks as well. We're not going to go onto the internet anymore. And maybe we can start here, the crude API. Let's take out Serper.dev. I don't want you to go to Serper.dev. So no more super dev for now. Just take that out. Just want you to review the raw data that we get, and from there give me the final output. So if you come here to tasks, the research assistant should I call him research assistant? Let's just here. Let's tell it conduct a thorough research about presidential executive orders from the output of the web of the web scraper. That's what we wanted to tell it. And so that's just yeah. And then expected output: conduct thorough research and analysis about the presidential executive orders from the output of the okay. A list with bullet points, most relevant information about which you go. I don't know if that should be. That doesn't sound. Doesn't flow. A well, well-structured report with the main topics, each with a full section of information on a well-structured report with the main topics. Actually, this is just researching. So we have the other one down here that does the specific kind of ordering. For this agent here, all we want it to do is— let's see here. This is not executive orders. Order title. Order URL, order publication date. So just want to make sure that everything is covered. Order summary. Summary should be at the top, really. So, okay, so that's good. Title, URL, publication date. Summary agencies. Let's just say this: agencies affected, countries impacted, persons citizens affected. All right. Is it affected? Let me just impact. It sounds better. To be honest, than affected. Affected just sounds sounds a bit extreme there. Yeah, because it's just impact. That's better. Conclusion. The conclusion should be recommendations. References. Okay, why would they even— like, what would I need as a conclusion? I don't need a conclusion. We don't need to make a conclusion on nothing. It's just recommendations, um, for the next steps, or recommendations, recommendations. Well, we do need recommendations in an out— in a final output here. Okay. Let's just report. I don't think there's a recommendation that we need. We just need maybe conclusion and takeaways. Makes much sense. Okay. Cool. Now, Style of New York Times. Okay. Format the report with the following structure. Review the context that you got and expand each topic into a full section for a report. Make sure the report is detailed. These are relevant. Actually, we could collapse this into just 2 agents, the scraper and the report generator. We don't need the middle one. It's just extra, extra stuff. So let's go ahead and I'm just going to copy this. So review the context you got and expand each topic into a full report. All right. Conduct a thorough research analysis about the presidential executive orders. Okay. Um, then here, let's just take this out. We don't need you anymore, so let's take them out. You're gonna need to take that out too. So cool, we just need this too. Same thing with the agents, we just take out the research assistant. We don't need the research assistants. Um, create detailed report based on research findings. Based on the web scraping, web scraping data. Okay, you're meticulous analyst looking for detail. You're known for your ability to turn complex data into clear and concise reports, making it easy for others to understand and outline information you provided. That is very succinct. Awesome. Now let's go to crew.py here and take out this research assistant because we don't— we've taken them out on all the other spots. And then take out their tasks too so it doesn't cause any confusion. Save that. And let's go through this one more time. And maybe one thing we could do here as well is Guess we have a structured way. So we have this and format as markdown without. Cool. I think we could maybe do a better job here with outputting the final output. So let me ask our handy helper here. So we have the tool. So we have the main, you have crew.py. And then we have our porters is already there. Boom. So I want my agent to output the full report or the full scraped data in an MD file. Currently, it only outputs data, it outputs scraping done. So just want to make sure that we actually output the full output to a file. So if it refuses to do that, we can just go ahead and add the download here to the tool as well, because we don't want to Redo that. I see the issue. Let's modify the task configuration and tool to ensure the full data is saved. First, let's update the tool to return a more structured output that can be saved directly to Markdown. It's gonna go ahead and figure out what I need to change and try to get that done. So down here, what is it doing? It's saying there's just an error message capturing that. And then if not all order links, right? And then it's cool. Just going through this and generating the full thing here. Okay, cool. And then returning the full. So if you go to change my tasks as well. So here, web scraper, scrape the latest executive orders from the White House, save them in a detailed markdown. Okay, let me just— detailed markdown report. Report should include all executive orders found with their full content, titles, dates, and URLs. And then here it says a comprehensive markdown report containing overview of the data collected, list of all executive orders, full content for each publication, dates and URLs. Make sure that Save all the data from scraping tool to the output file. So the website, you forgot to add the URL because it will hallucinate if we don't put that in there. I will just go ahead and think about, oh, just gonna scrape the White House now. So we want to make sure that we're very clear there. So that is good. Now what else did it change? Did it change anything else? So it's saying the output will now be saved in properly formatted markdown file with the following structure. So it should look like this: executive order analysis report overview, time period, orders from owners, total orders found, data collected, and then it should say executive orders number 1, publication date, full content. Boom, that's what I want. So let's give it a try. I have a feeling that we'll get some disappointments as well with this one, but at least it'll be some progress from the previous one. So also, I think I might want to use Gemini. And I said I wasn't going to show my API key, but I just did. If you caught that, well and good. I'm going to have to delete those now. And here I can do Gemini, Gemini API key. I have to get my Gemini API key now. Let's come here. Let's do AI Studio. I'm going to get this one, Gemini AI Studio. I'm going to turn off my screen again. Or let's go for intermission for now. All right, let's go for an intermission. Uh, intermission is not working today, huh? All right, live scene still. Cool. Well, let me get my API key for Gemini. The reason why I'm using Gemini here is because of the larger context window. And that is the only reason why. So let's come here. And I'm going to turn off my screen here. So you can see what I'm doing or how I'm adding my API key. So Gemini API key, and then let's just paste the API key. Here, and I'm going to change the model up here to Gemini. And it's Gemini 2.0 Flash. That's what I'm going to be using as the model. Has a bigger context window, so it should be able to take all that data if we run into any issues because Don't want to run into any issues. Cool. Now I think we're ready to go. Let me turn on my screen back on. Cool. Now close that. Now let me go ahead and look through this. It's all good. Everything should be changed up now. Now let's run this and see what we get this time. Okay. All right, I— let me check on Twitch. I haven't checked on Twitch in a minute. All right, I think I already see an issue here already. Um, it's setting the dates So first of all, I'm gonna stop him on the tracks right there because it's taking in the dates. It's just making up the dates. Yeah, so it's using different dates and I don't blame it. That's when the model was trained and those are dates it thinks are, um, it should use. So it's coming here. Let's come here to the dates default description. Maybe I should pass in those as inputs as well. So let me just ask our handyman here. Maybe we should also pass in the, the date. And here in the inputs in main.py, I'm just going to ask it as a question and want to see what it thinks because this is what's happening here. Yeah, because we have several parameters there as well. And we want to make sure that that is taken care of. But if we come here, set the default start date to January 2025, next presidential term. It's not the next, it's the current. It's the Start of the current presidential term. All right, default year. Boom. Can't be modified to any date time format. Cool. Yay. I think that's what we want for that. Now let's go to tasks. It did pass the same thing, so let's see what it did. Script the latest executive orders from the White House URL. And for the year, year. Okay. Overview the data. List all executive orders from start date onwards. Perfect. Perfect. Now let's go down here. Just want to make sure it doesn't hallucinate about this stuff. Let's run it again. Let's see what we get this time. Oops, something broke. Interpolation. Did we get something with the wrong here? So start date should be the correct one. Let's see. Start date, year, start date. Ah, are we adding several here? Starting from the year. Okay. What is it exactly saying? So it's saying. Interpolate only. Okay, unsupported type DateTime inputs, only string are allowed. Okay, so I just need to actually just change a few things on the tool itself, and we could just pass that in, um, and we could just let our handy helper here fix it for us. Doesn't support datetime objects. So main.py, just gonna convert it to strings again. Hmm, that works. Can't fault them for that. We come here to tools. We should also modify this to fit that so that way it knows how to convert Both ways. Did anything change in here? What else did it change? It changed— okay, publish and start date. Start date. It just modified the dates. Not bad. That's the only file that modified. All right, main.py, that got modified already, so we are good. Now let's go ahead and run it again. Let's see what we get. All right, I think I've been streaming for an hour 43, so I'm probably gonna stop at around 50 or maybe after this run. And I mean, it's been fun getting to hang out with all of you, so should catch up again soon. I'll try to stream tomorrow again or later if I have time, but I think this should be it for the day for me. Got a bunch of stuff to do. This is just more of like a morning thing. Just get it off the morning to get some work done in as well. But let's see. So it's interpolating correctly. Executive orders from White House website from 2021, 2025, January 20. Okay, it's doing its thing. It's doing the scraping. There you go. Awesome. Now we just chill back, drink the coffee, right? We'll just watch out for the folders. That's the next thing now, is, is it outputting to the right folder? That's what— that's the next step. I just want to make sure that— not the right folder, but is it outputting the actual output to the folder that we want it to? So that's kind of like the next thing to watch out for. Oh yeah, look at that! Boom! We got all the stuff we need. That's just freaking awesome. So it told us here, time period 2020, uh, 2025 onwards. Data collected date today, which is awesome. Uh, data found, total orders found 114. That should be correct. And then publication date, great, starting from yesterday, the most recent one. And it's just going through it all the way down. Let's see how far— oh wait, I think they might be less than that. So that's February 2nd, February 13th. It didn't get all of it. It's kind of sad. Did it hit a context window limit? It probably did because it's just eight. There's 114. What's going on, dude? You didn't get all of it. Well, anyway, let's see the final report. I could try to fix this. It's already doing it. It's just a matter of you know when are you gonna get all of them, right? But it's already doing what I wanted to do. It's capturing what I needed to do. Now I just needed to output the full thing, which is okay. Now let's look at the report, which is the important piece from whatever ones it's saved on there. Let's see how many of it it got them right. Let's close the side screen there. You can close the bottom one. So it did go here. Presidential executive orders, a deep dive. So January to February. So we got January and February 2025. And then we have the introduction in by your name, whatever. In the early weeks of 2022, the newly inaugurated president has issued a series of executive orders and proclamations signaling a clear direction for the administration. This report analyzes a selection of these presidential actions, examining their stated purpose, potential impact, and the government entities and citizens likely to be affected. The analysis covers orders published from 2025 Inauguration Day Through February 19th, based on available data collected on the lighter date, this report aims to provide a clear concise objective overview of these initial policy directives. Okay, let's see executive orders. So number one, extraordinary accountability for all agencies. That is the title of that. That is the link, and then it was published yesterday. And then the order summary, it just gives us a full summary there. And then agencies impacted: all executive branch agencies, including independent regulatory agencies such as Federal Election Commission, CFTC, and all that. The order primarily impacts— its impact is domestic, affecting the regulatory landscape within the United States. However, because the regulations of these agencies can be— can have international reach, um, they could be Okay, persons associated— all American citizens and businesses are potentially impacted by this order as it affects the regulation that governs various aspects of daily life and commerce. The specific impact on different groups will be— will depend on the regulations issued by the affected agencies. Business in particular will be affected by changes in regulatory costs and compliance burdens. Expanding access to in vitro fertilization. So What is this executive order aims to increase access to in vitro by lowering cost and reducing barriers to treatment? Okay, reducing out-of-pocket costs and help for IVF treatment within 90 days. So the primary agency impacted is Department of Health and Human Services, HHS, and countries impacted or impact is primarily domestic American citizens. Okay. Persons or citizen groups impacted. The order directly impacts individuals and couples experiencing infertility, as well as healthcare providers and clinics that offer IVF services. It also directly— indirectly impacts health insurance companies and employers who provide health benefits. Radical transparency about wasteful spending. Direct heads of executive department agencies to make public complete details of every terminated Program cancel contracts, terminate grants, or any discontinued obligations of federal funds. Agencies impacted: this all executive departments. All American taxpayers are potentially impacted by this order as it aims to increase transparency about how their tax dollars are spent. Organizations and individuals that previously received funding from terminated programs or contracts will be directly affected. That is true. President George Washington's birthday, 2025. Um, this is a proclamation declaring February 17th as a reserved holiday commemorating George Washington's birthday. Celebrates Washington's legacy and contributions to the nation. Okay, pretty good. Federal employees receive a paid holiday. The proclamation also serves to promote patriotism and national unity among all American citizens. Okay. Kentucky emergency declaration. Um, other is FEMA to coordinate disaster relief efforts and provide assistance as required. Emergency measures. Okay, residents of Kentucky affected by severe weather and directly impacted, as they will receive assistance from FEMA and other government agencies. Okay, all right, so it did what it did. It went ahead and really got the aid of all the ones. So if you could do this for all of them, this is the goal, for it to do this for all of the 114 as of today, um, Wednesday, February 19th. If it gets all of it, like the 114, and does this, and then what I— maybe what I could do next is it every day it checks to see if there's new executive orders. If there is, it does the same thing for that individual one and just updates the record. This could be saved in a database and or just converted to like a newsletter, to be honest. And it could just post these out every day if there's a new executive order. It runs it and sends it out as an alert, maybe to a Slack channel or triggers an email newsletter that could go out. So a lot of a lot of things could be done there. Which is pretty cool. All right. And also just to keep in mind, most of this could be done by— you don't really need an agent, but I think an agent does a better job of orchestrating all this instead of you having to come up with chaining together all different LLMs to do this. You could do that. There's no harm in that. But I think agent also does a better job with this. Easy to orchestrate in my opinion. So conclusion here. The executive orders are issued in the early weeks of administration, reading key priorities, increasing presidential control over regulatory agencies, all that good stuff. References: the White House, Presidential Actions, United States Code. All right, cool. I like what it did. The only thing it didn't do is it didn't capture all of So let me just just see here on the side first of all to see if it generated any full report. So we know let me just add this report as report.md. So we know there are 114. Executive orders as of today. But the agent only returned and saved 8 of them. Our code probably got all There, our tool probably got them, but it seems the agent saved only 8. So I just wanted to do some investigation on that because Just want to make sure that it's not something that we've configured as well in our agent here to make sure that it didn't limit to eight. Okay, so it's just going through that to check to see if it's if there's anything specific. I think it might just be a context window issue here that unfound. As shown in the overview section of, but the reporting analyst only selecting subset of to analyze in detail. All right. So we're looking through the report and let's see. So it's saying review all executive orders from the web scraper task output, create a comprehensive analysis. Every executive order found, not just a subset. Conduct thorough research and analysis about all the presidential executive orders. Okay. Do not skip or omit the executive orders. Each one must be included in the analysis. That is true. Cool. But we also, we also need the scraping agent to save all In the output, in the output file. All of them are being saved. Okay. I don't, I don't know if this, this will be just an issue of tweaking the prompt, in my opinion. But we'll see. Let's change the agents too. It could, it could work. So let's see. Great detail report. Okay. And there is an attention to detail. That's what I like. Every single executive order. Okay, perfect. Okay, I'll try that one more time before I end. I know it's past 54, but we'll just give it one more shot and we'll be good to go here. So create a run. Okay, so it's kicking off. I just want to wait and see if it's going to save all of it to, to the folder. So yeah, let's just delete that. Why not? So let's wait and see if it's going to save it. If you have your coffee, I'm a coffee drinker, say, you know, time to grab a coffee and wait for it. Okay, just let me just verify. Did we not add any print statements in in here? I don't think we did. Oh, I'm gonna add some print statements in there. Let me just go ask the agent. Also. Add print statements in the tool so we know when, when scraping. Okay, so it's still going through this. January 20th. The scraper is doing its thing here. So we got all of it up to 114. Okay, so save that. Now it finished all the, the work that it needed to do. But I think it still did not give us a full report, which is a shame. But let's go ahead and look and see, see what we got in the output. So we go to output. Let's look at the web scraper first. It did add extra backticks here, which we told it not to. I think this could be fixed with another added step that I could give it. But let's just confirm that it, you know, make sure, let's see what it generated. Yeah, this time it still got 8. I think it's just a matter of context window in this case. It's just a context window issue. It's not nothing to do with the report. It's just the context window is not maximized. To what it should, and I think I can fix that by adding more LLM parameters to to our draw LLM. Deep dive into first month of president executive orders and nation transformed, and total orders analyzed in this case is just eight. Wait, why are they putting New York Times? It's not the New York Times. Come on. So we just went over that. Okay, countries impacted, expanding access to in vitro, which is cool, but you only analyze 8 and I wanted you to give me the full report. Anyways, that was all right. I'm gonna have to tweak that at another time, but for now, um, All right, I added in Washington Post. So anyways, extra flavors. I think the issue might actually be within my context window. So just go ahead to crew. I already have my model. What I could do up here to be able to fix that is I'll do LLM, and then in here I'll create my LLM class. And model, we'll say, say Gemini, and then it's Gemini 2.0. I believe this is flash temperature. Let's put half because we don't want to overthink stuff. Max tokens, timeout. Let's take out the timeout. Do we need verbose? Why do you need verbose in a, in a, in an LLM? Do we even have verbose in here? Yeah, there's no verbose. I don't even know why it's hallucinating that. You have model timeout, temperature, top P, stop, max completion tokens, max tokens. So we could do max, I could do max tokens there. And then presence penalty, API version, API keys, callback, reasoning effort. Actually, you could tweak the reasoning effort. But I think this is for OpenAI, if I'm not wrong, the the model. But let's come up here and do max tokens, which we already have there, and we could do API key here. All right, we already imported OS there. Now I just want to verify the context window for Gemini. Let's look here. AI Studio. Let's look for Gemini Flash. What's the max tokens? Best for multimodal, starting real-time streaming, 82. Yeah, yeah, yeah. All right. Alrighty, all right, let's do max tokens for— let's see, did somebody message me? Let me just check. Okay, so the input token is a million, but the output token is 8,192. So let me see if I can find one that's— I guess all of them are same. Input tokens is the most, but the output tokens is less. Um, okay, let me see. Let me just ask here. So techniques, so I think agent returning only 8 orders is due to the output token limit by our model. 8192. Let's just ask it any thoughts. Actually, let me look at OpenAI as well. So what is it doing? It's saying increase. Yeah, you can increase beyond that, buddy. It's not— let's modify the reporting to handle large numbers of orders in batch. Um, yeah, switch from Gemini 2 to Gemini 2 Pro. Is there even like a 2 Pro? Like, dude, what are you talking about? Yeah, it's no 2 Pro. Anyway, that's a major hallucination. That's why you gotta verify these models, man. I think the next step for me is to look at OpenAI, and actually I think it. It's a better one here. Yeah, absolutely. I think I'm gonna use 01, man. I'm gonna go back and switch to 01 because this ain't it. Reject, reject. And do I want to accept any of this? No, I'm gonna reject all because, buddy, today you just hallucinated. So let's use OpenAI here. API key. And here I'm going to put as 01. Save that. Temperature 5. I'm going to give it 100,000 max tokens so that it could give us full max tokens. So for each agent, I'm going to do LLM. Which you have 2 agents here. Just gonna give them the full 100K tokens for them to use. Now I'm gonna, of course, turn off my screen here in a sec to be able to go back and figure out my API keys here. So I'm just gonna change this back to 01, save that. And for these 2 that I'm not using anymore, I'm just gonna comment those out. Now we are in business. Well, do I need to instantiate that there? Probably not. I don't need to add that model there since I'm doing something different. Cool. Now I think we are in business. Now let me take that off. And this 100K context, you know, tokens Hopefully gets us a lot to do here. So run this one more time. And this time I'm serious. I'm just going to close it after this. So let's go ahead and run it. And let's see what we get from that. Well, well, well. I'm using O1 because it has 100K tokens, output tokens that I could use. So that is the only reason why I'm doing that. All right, so we are our remember like that we wanted to stay in touch with what it's doing and here it is. So it's telling us you know it's scraping that it went and got all of them and it's processing the orders now. You know one by one it's just going through it. Here it is. It's processing all of them. That should be live now. It's moving. Yeah, because the other time we were just kind of sitting there wondering what's happening, and here it is. It just went ahead and did all of them, but we threw an error. Yay! Invalid request. So context window error. So this model maximum length is model's maximum context length is 200,000 tokens. However, you requested Wait, 271 tokens in the messages, 100 in the completion. Please reduce the length of the message or completion. Okay, I see. All right. I'm just gonna have to figure out, maybe I should chunk them. Um, so let's tell it switched to OpenAI's L1, which, which has an output token limits of 40K. I got, I got this error. Um, maybe we should do chunking, or I could just go ahead and spit all those out into a vector database. And then, and this is why I think it's very important for me to kind of have a storage outside of just kind of saving this within a file, which actually makes sense. So it's trying to implement something clever. Let's see what that thing is. But yeah, it didn't even output anything just because it hit hit that error down there. Project pending completion of a comprehensive assessment. Okay. Not too bad. Let's see what it did here. So, but exactly now let's update. No, it doesn't say humane Yes, we need to do some clever chunking since even with OpenAI Cloud, we're hitting token limits. Let's modify the tool to chunk the data more effectively. It's hallucinating there. Now let's update the reporting task to handle these chunks. I've met significant changes to handle the token limit issues. Modify the Web Scraper Tool to split orders into chunks of 20 orders each. Create a directory structure, overview of all orders, link to each chunk file. Each chunk file contains 20 orders with full content, clear numbering. Update— updated the reporting analyst to process chunks sequentially. Clear instructions on handling the chunk data. New report structure that folds the chunks. Sections for overall themes and patterns. Um, this approach to solve the token limit issues. Each chunk is small enough to be processed within the agents. Okay, let me just accept all of them and run because If it fails, I could always just kind of time travel back to when— before we added this extra step it gave us, and it will just kind of delete all the stuff that it added and go back to reset our memory. Yeah, so the stream will be ending very soon, so All right. We're rocking and rolling there. Okay, let's see if it created those chunks. Oh yeah, it did. All right, so you did, but did you get it right? Did you get all the chunks? So orders 1 to 20. Huh, let's see if you got to 20. Let's see, what order is this? It actually might have gotten all the 20 here. Oh, I see. And let's go to number 6. Okay, it did. Can't blame him, it did get it actually. Okay. But I think the agent here is, why are you going in circles when you already have the final input here? You already got the final output. Maybe I should just add a human in the loop aspect of it after the web scraper, just to tell it, look, you already got what you need. Let's just move on, right? Like, let's not Keep retrying because it's still retrying stuff here. Still retrying to put that. I'm like, we already got that. You don't need to redo. Yes, there you go. Finally figured out. Let me just go ahead. So they are currently no executive order available on the White House website for requested time period. Yeah, because you already got them all. So. I see what it did there. I see what it did. So those are the chunks. We have the report, which is sad because it went ahead and Generate a weird report. But the good thing here is like it's working where you got all the chunks that we need, which is good. But the report, um, reporting analyst— what we could do with the reporting analyst, we could give it a tool called file reader. And then what it would do is it would go read all the files that are under chunks, under outputs, and under chunks folder, which are this. Get each one of them, read it, Process it. I'll put the final drafts of the report here. So that's kind of like the next steps. But I wouldn't be covering that in this video or in this live stream because we are over time. Been streaming for the past hour and 18 minutes. So that's the longest I think I've done so far. But thank you all for following along with me. I think the project is way ahead of where I expected it or where I wanted it to be. This should be ready for me to move to the next steps of just kind of polishing it. But thank you all for sticking around with me. I'll see you on the next one. Bye.
More from Tony

Summarize Videos and Research Companies with CrewAI + Gemini Models [Quickstart Guide]

How to Make Your AI Agents More Reliable with CrewAI Task Guardrails (Step-by-Step Tutorial)








