Your First AI Agent in 20 minutes (Real World Use Cases)

Phil Choi builds a working 3-agent YouTube consultant system with CrewAI in 20 minutes. The agents research channels, analyze data, and give advice. He walks through installation, config files, adding web search, and debugging the output.
Questions this video answers
July 25, 2025
Chapters
You ever have that idea for a startup in your head that's going to make you a million dollars but you lack the team to execute it? During my studies about AI agents, I recently came across crewai. And in this video I'm going to show you how you can go from starting your own business to having a team of AI agents with very minimal code. It's going to blow your mind how easy it is. So now you guys are probably wondering what CREWAI is. So this is crazy Website, the leading multi agent platform. Streamline workflows across industries with powerful AI agents. Build and deploy automated workflows using any LM and cloud platform. Okay, so career is kind of like a framework for agents and it just like scaffolds or structures your project in a way that they want you to use it. So it is not like that agnostic, but they make it super easy. So you just like have a couple of YAML files, you define your agents and, and then you define your tasks and then you just set up like, hey, do you want this to be in sequence or do you want it to run with a project manager or something? And you can kind of have these workflows. So I think it's pretty cool. But Crew AI has several different products, but what we're going to focus on is the open source one. And all you do is just pip, install crewai or whatever you need to do. And you can basically just define your agents and your tasks. And so basically just three steps, create your crew, define tasks and kick off. So that's about it. So it's super easy. I'm looking for the documentation. So in the documentation when you install they really want you to use UV as a dependency. And I've already installed it. But you just run UV tool, install crewai and if you do not have UV yet, you just run one of these commands for your command system and for your operating system. And UV is just kind of like a replacement for pip, but it makes it super easy and then you don't have to work with like virtual environments and stuff. So you know, like recently I'm like, I don't know if you guys know, but I have a YouTube channel and I'm trying to be like a better YouTuber. So you know, one way that we did it in the beginning, like Minnie and I, we used to like find viral videos like with a small YouTube subscriber count. But you know, that's very time consuming. But basically what we need to do now is research YouTube channels and see, you know, why they're doing good. What their growth strategies are and what, like, how it could help our channel. So maybe we can make a YouTube consultant or something like that. So, yeah, that's enough explanation. Let's get started. So I'll just come to my visual studio code. I already have this open. This is all the contents. We have the YouTube Git repo repository already inside of GitHub. So I'm just going to come here and see this. I'm just going to run crew AI create crew. And I'll just put YouTube consultant. All right? Now it'll ask me a bunch of questions. So I'll say select provider to set up. You can use multiple LLMs, but today we're just going to use one. We're going to use OpenAI and I'm going to use GPT4 mini the. There you go. And then. Cool. So it made a project for us. It created this YouTube content consultant and then made a pyproject toml file. That's very important because that's where you're going to run the crewai commands. It created an src folder, and in there you have a main PY file, a crew py file, and then you have your config, your agents, where you define your agents and your tasks. And now the only things that we really need to change up are the src in the config. And we're just going to work with the config folder today, the crew py file and the main PY file. So I'll go to the config and we'll think about the. These are the agents, so you can kind of think about them like LLMs with a little bit of context. So like they already set up like a researcher and analyst for us, but we're probably going to use some other guys. So. So I'm just going to comment this out and we're going to use GitHub Copilot to help us with some of the context to speed this up. Or else it's going to take forever. So just go. I'm going to do YouTube top channel researcher. Okay. And then maybe I'll just go roll. And then if you see these curly braces later on in inputs, it can be like a variable that you send in or a parameter. So coding YouTube, we'll put coding YouTube top channel researcher. Identify and analyze the top YouTube channels in the coding niche and then with a backstory. You're a dedicated researcher with a passion for YouTube content. Your expertise lies in identifying the most influential channels in the topic niche and or coding niche, analyzing their content strategies, providing insights on how to leverage their success. You will make a list list of the 10 channels that are similar to and then we'll say channel name and then we'll put channel URL and list of 10 that are similar to channel name and channel URL. So just to have the URL more context and give back channel name URL and description and top video URL. Okay, so what we want from their channel is the give back channel name URL, description and top video URL. And we're going to have a structured output for this guy to give to the analyst. All right, so next we're going to have maybe a YouTube channel analyst. So let's just say coding YouTube channel analyst. Analyze the performance and content strategy of a specific of. Wait, so let's say, let's anal. YouTube channel analysts will say analyze given list of YouTube YouTube channels and provide insights on their performance. Okay, sounds okay, I think that's good. Okay, so all right, you're an analytical expert with deep understanding of YouTube's algorithms and content strategies. Role is to dissect the performance metrics of each channel in the list, providing insights into what makes them successful and how they can be improved. And then we'll have maybe a YouTube channel consultant. Okay, so we'll just do a coding YouTube channel consultant provides strategic recommendations for the improving the YouTube channel performance for you. Provide strategic recommendations for improving YouTube channel performance for channel name, channel URL with given analysis report. Okay, backstory, you're a seasoned consultant with a track record of helping YouTube channels grow and thrive. Blah, blah. So we have three workers, basically we have three agents. Let me just go into here real quick. This is going to be YouTube consultants. Cool. So now we're in here and maybe those are the only three guys that we need. We could add like a manager here, like a project manager, but I think we can just kind of think about in sequence. We're going to research, then we're going to give it to the analyst, he's going to analyze it and then he's going to give it to the consultant and then we're going to have him give us a report. So let's keep going. And all of them, I think we will also have them have, we'll just specify the LLM that they want to use. So, so let's just do LLM and then we'll do open AI GPT4OH mini. And it's the cheapest one LLM. And then maybe the consultant who's the final guy, almost like the final boss who's going to actually perform the report. We'll actually make him use a little bit of more expensive but not the mini. But we'll do 4o. All right, so those are cool guys. So now we'll do the tasks. So let's, I just like to name, put a task at the end of the agent. So I just put it side by side. Let's go like this. So YouTube channel researcher task. And then we'll just do description expected output list of 10 YouTube channels with their names, URLs, description, top video URLs. And that's going to be used by the YouTube channel researcher. He's going. That's his task research, top YouTube channels. Okay, cool. All right, now, YouTube channel analyst, let's just have copilot help us here. All right, cool. So analyze, provide list of YouTube channels, provide insights and blah, blah, detail analysis reports on the channels. Cool. And then we'll just do one more. We'll just do the YouTube channel consultation. I just, I'm gonna name it the same because I was getting some key errors earlier. YouTube chop. Top channel researcher task. YouTube channel analyst task. YouTube channel consultant task. And let's just do that real quick. All right, so these are the agents and these are their tasks. One to one, you can do like more tasks for, you know, one. One guy, one agent. But you know, we'll keep it simple today. And then one thing that we're going to need to do is in the tasks we set the agent, but the YouTube researcher task, I'm going to have the output file and then we're going to top channels, topic.JSON inside of our output output file there. And then here we'll do output file and we'll do channel analysis md and then we can do output file channel consultation for tap for channel name. Cool. All right, so I think we're good here. So now, now we have our agents and our tasks set up. I know that like maybe some of the goals are kind of mixed in with the tasks, but it's fine. And now we'll just put this guy over here. I will just close these files out and the next thing we're going to edit is the crew PY file. So here I'm just going to delete a lot of this stuff here. Delete everything here. You don't really need it. So just delete all this stuff. Okay, so some stuff that I'm going to use, I am using this thing called serper. So serper is it lets the LLM search for like use web searches. It's really good and it's easy to use and it's really cheap and they give you like 2500 credits for free and it helps your LLM kind of search. So let's search the web. So let's, let's keep on going. So now we'll just do. So we'll do from crew AI tools import serper, dev tool and that's all we need there. And then, and then we'll just do one more. We'll do from pydantic, import base model and field. Cool. So in the first task we have the YouTube researcher and we said that he's going to make a list of 10 channels. I said that I'm going to give back channel name, URL, description, top video. So I'm going to say class YouTube channel research. And then here we're going to pass in base agent from Pedantic. And then we're going to do the channel. We said channel name and oh, look at copilot already finishing it for us. But that's good, we don't need that. And then next is going to be channel URL. There you go. And description. Cool. And then top video URL there. So and then next what we're going to DO is class YouTube channel research list. We just pass in base agent. There you go, channels. And then we'll just have it be a list of the YouTube channel research and the field just list of YouTube channels research. Cool. So now we have our structured outputs all set up. And then now we just set up our agents. So you'll see agent here, crew and task. These are actually decorators and crew base is a decorator too. A decorator is just like something you just put like with an at symbol on top of your functions or your class. And it's like a wrapper for your function. It adds some stuff to it injects. So add agent and then I'll just define our agents here. So def YouTube, YouTube top channel. Now it's actually agent and because we already defined everything there we just. Here I'll just do like this. We define everything. The YAML file. We don't need this kind of stuff. We need this to add the ability to search the web. But then all you need to do here is config equals and then self dot agents config. So that's already inside. And the key is the YouTube top channel researcher. Cool. And then we'll just say verbose equals true. All right, nice. That's our first agent defined. Now at agent the next is the YouTube channel analyst. So YouTube channel analyst. There you go. And I don't think the analyst needs to search the Internet because he's just given a list by the researcher. So we we just not give him a server dever dev tool. And then next we'll do agent and we'll do a def YouTube channel cons consultant. There you go. And we'll just set this super easy because the config we already set everything in the YAML file so you don't need to make these too large. And then next you just. Now we have our three agents defined and then we just need to define the tasks. So add task because this is the actual file that's going to be run. So now we say def research top channel. Did I do channel channel researcher task. There you go. And what we're going to do here is we're going to say not agent. We're going to take config equals self task config research top channel researcher task. It's going to look for that in the configuration. And then this one is going to be verbose. Here we're going to say we want to use the structured output that we created earlier from the class. So output pydantic and then equals the YouTube researcher researcher list. YouTube channel research list. And then that should be good right there at task. And then definitely YouTube channel analyst task. And then he does not have a pedantic. So that's. That should be just fine right there. And then the last task is the consultant task. I'm just going to let copilot help us there. And then the last thing that we need to do is just set up our crew, add crew and then we just say def crew and we'll do self. And then this is a little bit wrong. So we'll just say we'll get that and we'll do agents equals self dot agents because we decorated now it knows that it's self dot tasks. And then we just say process equals. This is where you can kind of add in manager and stuff like that. But here we're going to use sequential and then here we're going to say verbose equals true and that should be it right there. There's some other stuff here like memory and like the manager. Like if you want the tasks to run in sequence, I mean in parallels but this should be done. And then now you just go to the main PY file. I just like to get rid of all this stuff here. The test Replay train. Get rid of that stuff. And then just run. And then here in the topic, I think I put coding. And then here we can do. I said I put channel name. Let's let fill. And channel URL is let fill. Cool. I'm pretty sure that's. Hold on. Let me check the Internet real quick. What is my YouTube.com. there you go. There you go. All right. Go back to VS code. It's actually. All right, cool. And I think we're done. So let's just run it now. And everything should pop out in the output file here. So now I just run crewai run. It's going to install the dependencies the first time. Okay, so we got a little bit of an error. An error occurred while running the crew research top channel researcher task. Yeah, because there's no such thing called that. YouTube just gonna. This is the problem with AI it autocompletes two fast. So the task is actually YouTube top channel researcher task. There you go. And let's just make sure this is all the same. This is wrong as well. Analysis task. Select the name of the same thing. Then just. That should be good. All right, let's try one more time. Create. I run. All right, so now he's working. Right? So coding research the top. Blah blah. I need to search for their. You similar to let Phil. And now it's searching top coding YouTube channel similar to Let Phil. It's searching that on with Serper. And now he's searching and. Oh, crap. No, wait, wait, wait, wait. Hold on. We got an error. Once the crew starts running. I don't really. Let's see here. Validation errors here. See, I think in our structured output, it's a little bit broken. Channel name, channel URL description, top video URL. Oh, AI is. Yeah, but it's okay, you know? Yeah, it's okay. Yeah, he's like. Now he's provided strategic recommendations for improving the performance. And now he's finished. Right? Perfect. So now the output file. So now we have the top channels. So we have a list of channels. Where is it? Where are the top channel. No, I saved and then. Oh, there it is. I was like scrolled all the way to the right. Free code camp Coding train fireship. Very cool. They have top video URL and it gives us a little description. And then the next was the analyst analysis. This is pretty cool. Channel URL description, top video link performance insights. So it gives us a whole bunch of stuff. And then I'm the channel consultant. So let's check this out. Open preview. Enhance the performance of the YouTube channel left field based on analysis report here. Strategic recommendation focusing on the content strategy, engagement tactics and growth opportunities. Content strategy diversification, project based learning series and playlists, real world applications, engagement tactics. That's pretty cool. Maybe we'll add more quizzes and polls and stuff and growth opportunities, collaborations. If you want to collaborate, let me know, you know. And yeah, I think definitely helpful and I'm sure we can make it a lot better. You know what I mean? But that was it for today. I'll push this code to the code base that we have and I highly urge everyone to kind of like look into this kind of stuff. Very fun YouTube consultant. Push. And definitely if you want to learn this kind of stuff, we're going to. We definitely teach all this stuff inside of the courses. We also teach web dev and this is kind of like, you know, on the edge. Like I feel like newer technology and we're definitely adding this kind of stuff to our courses as well our program. And definitely reach out because this stuff's super fun and super exciting and thank you. Like comment share really helps the algorithm. And if I can do it, you can do it too. Coding saves lives.
More from Phil

day in the life of a software engineer | 5 hour productivity | building my dev agency 🔥

day in the life of a software engineer | 3 hour productivity | coding my 6-figure community startup

day in the life of a software engineer | 5 hour productivity | coding our sns startup app LFG

day in the life of a software engineer | 5 hour productivity | creating apps that makes big money

day in the life of a software engineer | 4 hour productivity | building a dev team for my agency





