Now let's talk about our second use case where we're going to be building a progress report for a project. So in comparison with our last use case, this is what happens on a day-to-day basis. If you have worked in a software company in any capacity, you probably are familiar with the fact that every now and then you need to write a report on how is the project going. People want to have some clarity around progress and what is being done. So for this crew, we're going to be automating that as a process. That will take emotions out of the equation, making sure that you can see a project for what it is. For this use case we're going to be using two agents the data collector and the project analyst. And these two agents are going to be doing a series of three tasks: understanding a project, then analyzing its progress and compiling a report. In order to do this, these agents need to be able to talk with an external system. In this case, it's going to be a Trello board. So this is a great example of how these integrations with external systems can actually unlock new use cases. So this is something that would not be possible if we had not integrated with an external tool. And we're going to show how easy that is. Once that our agents are able to do it, we're going to have a markdown report. This markdown is going to include things like a sprint overview, a task summary, identified issues and blockers, and also progress and delays. But it's not going to stop there. We're going to talk about a team performance review and also action items and recommendations, including anything else that might be relevant for this project. So this is going to be a great use case for the day to day of any company out there. And this is a use case that we are also seeing people do in order to get updates and projects, without having people going down and tracking every single ticket and comment in every single one of them. Now let's dive into the code and build it ourselves. So the first thing that we will do is importing the libraries that we're going to use. We're also going to load the environment variables to make sure that everything is set up. We're using the same libraries then our previous lesson, the json, the Yaml and our three major CrewAI classes. So let's go ahead and do that. After that, we're going to load our OpenAI model. And for this one we're also going to be using GPT-4o-mini. And I love to use 4o-mini because it's such a small model and so cheap. But it's still so powerful. But let's see what that's going to look like once that we actually run this crew. So let's load our agents and tasks Yaml. This code is the same snippet that we used on our previous lesson. Pretty straightforward. Load the Yaml files and assigning them into an agent's config and a task config variable. So once that we're done with this we have everything that we need to build our agents. But now it's where we're going to build our first ever external integration tool for our agents. Let's dive into that. For this crew, we are going to be integrating with Trello. And we're going to use two tools for that. If we look at those tools, they're fairly easy to put together. You can import from CrewAI's tools package the BaseTool class, and you can create any class that you like as long as it inherits from that. All your classes are going to need to have a name and a description and also an underscore run method. This method is where the integration will live. So all of your code is going to be inside this single method. And as long as you return an object or a string, you should be good to go. Now let's look at these two tools real quick. The first one is a board data fetcher tool. And what it does is fetch cards, data, comments, and activities from a single board. This is going to be a public board that I'm going to show to you in a second. But in here, you can see that we're basically calling an API to get information around this board in a few different fields that we care about. Then once that we get that a response, we return this response to our agent. You can see that we also added a fallback in here just in case we have timeouts or anything. We are hardcoding a response right in there. The second tool is a card data fetcher tool. And this is also pretty straightforward. It's basically facts information around a specific card. And you can see that again all our code live inside the underscore run function. And this is where if you're integrating with any external tool, you can do an API call, you can do a database connection, you can do a GRPC call, whatever you need. This is regular Python code that you can write down and your agent's going to be able to choose it to execute it or not, as it's trying to accomplish a task. So this is how you can do any integration. Both internal ones and external ones. And it's pretty straightforward. Now, let's put these two tools the test and see how our agents are going to use them. It's pretty fun to see how these agents actually use these tools in order to accomplish an automation that we built. Before we kick off our crew, let's check this board. This is what our board looks like. You can see that we have a few different tasks. One of them has a comment and it's actually late. It has past its due date. So with this information, we know a little bit about the project, But this could be hundreds of tickets. And it would be pretty hard for us to keep a reasonable track of it. Now, let's put together our crew agents and tasks. This is very similar to what we did in the previous lesson, where we are referring to the configuration coming out of the Yaml file. The big difference here is that this agent now has a set of tools. And we're giving it two tools, a tool that allows it to get data from a board in Trello and Trello is our project management tool, and another tool that allows it to get data from a specific card in Trello. So whatever tasks we have in our project management tool, this agent is going to be able to read them and understanding their comments, their context, and every data point associated with that. With CrewAI, you can setup tools both on agents and tasks. If you set them on agents, the agents are going to be able to use those tools to perform any task that it gets assigned to. But if you assign these tools on a task, whenever an agent is going to do it, it's going to only be able to use the tools there in the task. Now, before we actually run this crew, let's look at what are these agents and tasks in the Yaml file. So in here you can see that we have two agents a data collection agent and an analysis agent. And the two of them have a role, a goal, and a backstory. You can also see that the two of them don't allow delegation, and are set to run in a verbose mode. That will make sure that these agents don't delegate work to each other. So that they run on a streamlined way, in that we can see everything about how they're trying to accomplish their tasks. Let's take a look at the tasks itself. We have three tasks. We have a data collection tasks, a data analysis task, and a report generation task. And for any of these tasks, we have a description and an expected output. Feel free to play around with the descriptions and expected outputs. After you run this notebook. It's pretty fun for you to change it around and see how that impacts the crew output. For now, let's keep at it as is. Let's execute this crew. This crew takes no input. So kicking it off, it's as simple as just calling the kickoff method. Once that we do, we're going to be able to tag along its execution and see how these agents do the work that we expect them to do. So in here we can see our first agent, the data collection specialist, creating an initial understanding of the project. First thing that it decides to do is call our Trello board data fetcher, one of our custom external integration tools. And you can see that we get back this whole json object with every single information there is to know about our project. And now that we understand the Trello board, it will analyze individual information about certain cards. And you can see that it's using our second view, the Trello card data fetcher. Keep in mind that Trello is our management project tool. So it allows us to track progress of our project. So by looking at this board and cards, these agents are going to get a pretty deep understanding on what is happening with this project. Let's tag along the execution further down the road. If we scroll down, the final answer of our first agent is actually an overview of this project. So we now fully understand the project and gave all the information that it could find about it back to our second agent. So we can see how the tasks, the comments, some of the team involvement, and everything that we need to know. Now the project analysis expert kicks off, and it's going to use this previous information from our agent to build a full blown report. And here we can see the report being outputted. Now let's see how much running this cost us. And then let's look pretty closely at this comprehensive report. For checking the usage metrics and costs, we're going to be using the same math from our previous lesson because we're still using GPT-4o-mini, we know that costs $0.15 per million tokens. So we can tap into the usage metrics for the crew to do some simple math. You can see that this costs us $0.0053. And that's pretty cheap. And this time the amount of tokens was over 35,000 tokens. Now let's take a look at what this report actually looks like. Now, let's print this report. And we're going to be using markdown for this because we expected our crew to output a markdown file. And there we go. Here's our Sprint report. You can see that there's a sprint overview talking about a few key issues. There is a summary of things. There needs to be done. Things are in progress and things are in review. And then it goes into identified issues and blockers. It identified the lack of detail descriptions and also a few tasks that is stalled. There's one missing deadline and there's only a single team member working on this. And that's myself. Now, if we scroll further, we can see some more comments around progress and delays and even a team performance overview going over on how I'm the only active participant on this board. It also gives us some action items and recommendations on how we can improve this project, and making sure that we keep it on track, and then even gives us a conclusion paragraph explaining about how we can implement some of these recommendations and what is the value when doing it. This is a very interesting project. You can definitely see how this can be valuable for not only managers, but teams out there. They're trying to understand how is their project going without having to dive into every single specific card and reading every single specific comment. This is a pretty good automation that allows you to get a deep understanding of the project, and have agents actually do all the work for you pretty damn fast. Now let's go into our next lesson where we're going to dive even further. We're going to learn a new features and build a fairly complex crew. I'm so excited about that. So make sure that you stick around and I'm going to see you in the next lesson.