hey guys welcome to this updated crew AI tutorial where you're going to learn how to use crew ai's brand new features to build an AI newsletter from scratch and what I think you're going to love about this tutorial is that we're going to build a crew which searches the internet to find the latest AI articles to condense everything into one great looking newsletter that looks just like this and what's super cool about the newsletter you're going to be building is that it follows the same format and style that a bunch of famous Twitter accounts have
used to generate followings of hundreds of thousands of users so all around if you're looking to learn more about crew aai and its latest features and to see how this technology works in the real world this is the video for you and before we get started I just want to mention that you can grab all the source code for this video completely for free all you have to do is just hit that link down the description below and if you want to see more content just like this in the future be sure to hit that
like And subscribe button but enough of that let's go ahead and dive into the four major updates of crew Ai and then get on to building out our crew AI newsletter so the reason I'm making this video for for you guys today is because the creator of crew AI just posted it on X that he released a new version of crew aai that's more reliable and comes with a lot more features for us to use and the main features that we're going to be focusing on in this update is the fact that we can now
make things hierarchical we can also start using asynchronous task we can start working with expected outputs and callbacks now I know these might not make sense now so let's go ahead diving into each one of these new features covering what it is and how it works so the first major update for crew AI is that it now supports hierarchical processes and basically in simple terms that means our crews now have a chain of command where we have a manager agent who coordinates the rest of the crew and delegates tasks to each one of the agents
and validates the outcomes that each one of the agents produces and from what I've seen in my own experience this new hierarchical process produces much better results and much more consistent results than the previous process which was sequential and in the sequential workflow flow basically task and the crew were executed one after another in a very linear fashion and like I said sometimes things just got lost in context and just the order didn't make sense so like I said this new approach and process works much better and produces much better results and the great part
is that it's super easy to implement all you need to do in your code to make this change is you need to update your crew to update the process to now say that things are hierarchical instead of saying that they're sequential and the other thing is you need to set up a manager LL and this manager L is basically going to be you know the brand behind orchestrating all the different agents in your crew so like I said just set up manager llm and just you know you can use open AI or what other llm
you'd like to use so enough of this new process let's go ahead and move on to our new feature which is going to be asynchronous task so the next major update for crew aai is that it allows us to use a synchronous task execution and the best way I like to describe this update is pretending that you and I are writing an AI research paper so in the old way what we would do is hire a research student to go off and research the history of AI a few minutes would pass they'd give us some
updates and we go great now go research the ethics of AI great okay we'll Now find us some of the thought leaders of AI and each one of those tasks takes a few minutes to operate so all in all maybe 10 minutes for everything well what we could do now with a synchronous task execution is that we could go ahead and find our five research tasks that we want to execute in parallel so you know go find the great thinkers go find the history the ethics the new tools and we could run all those jobs
in parallel where each job you know might take 2 minutes and because they're running in parallel the whole job will now take 2 minutes instead of 10 minutes so this really speeds up the way we're able to run our cruise and gets us results much faster and it's also super easy to use this new asynchronous feature all you have to do on your task is to say if you want to use it asynchronously is you just set async execution to be true and what's cool is let's pretend that you want to then you know you
know aggregate all of your asynchronous task and look at their outputs well all you need to do on another task is say I need to set context of these five asynchronous tasks that I just triggered off and this will make a lot more example once we start building out our code example later on but I just want you know that this is the basics of working with our new asynchronous task so let's go ahead and move on to our next feature which is going to be expected outputs so like I just mentioned the next major
update for crew AI is that it allows us to add in expected output for our task now this is a super simple feature but it really improves the quality and reliability of our task so let me just give you a concrete example real fast let's pretend we had a list ideas task well what we could do is say hey my expected output for this task would be five bullet points with five ideas for an article that way there's no confusion on what this task needs to output and what I've also found really helpful is to
go ahead and give an example output in the expected output this really make sure that there's no confusion on what the task needs to be producing and you'll see a lot later when we're building out our AI newsletter we're going to be making a lot of use of this new expected output feature okay so let's go ahead and move on to the fourth and final new feature which is going to be callbacks and the final feature that we're going to be focusing on are callbacks and callbacks are super simple just think of them as functions
that get called whenever one of our tasks finished running so let me give you a concrete example let's pretend that we had an idea generation task that generated five ideas about AI well what we could do is set up a call back to either print out the results of our newly founded ideas or we can maybe set up a call back to send out emails to people to share those newly generated ideas or in our case what we're going to be doing later is we're actually going to be saving those newly generated ideas to a
CSV file so you'll see this actually in practice later on in this tutorial but those are the four major features that we're going to be focusing on for this crew AI task and if you would like to see more information about working with crew aai in general I actually made a complete crash course for beginners so you can go ahead and click the card in the upper hand corner of the video and you can go watch the entire crash course if you want to understand the basics and fundamentals of crew AI U but for the
rest of tutorial we're mostly going to be focusing on these brand new features so that you can see how everything works in action so let's go ahead and start building out our new crew AI newsletter from scratch I'm super excited let's go ahead and dive in all right guys so now we're on to the fun stuff where we're going to go ahead and actually start diving into the code and just to paint a road map of what we're about to do next I'm first going to create a new folder then we're going to set up
all of our dependencies for our project and then we're going to dive into the fun stuff where we're going to create our agents our task and our tools using all the new features we've covered so far so let's go ahead and dive into the first step where we're going to make our folder so what we're going to do is just say make dur and I'm just going to call it crew aai new feature tutorial so let's go ahead and make this folder and then what I'm going to do is head over to visual studio code
and I'm actually going to go open up that project real fast so let's see yep here's our new folder fantastic so now that we've opened this up what I'm going to do is go ahead and make the few files and folders that we need to make our lives easier and the first thing I'm going to do is go ahead and make a pi project. Tomo file now this might be a little weird if you haven't seen it before and I'm not going to go into too much detail on this one just because I covered a
lot of this in my previous video where I do a complete crash course on crew aai but I'm just going to go ahead and paste it so that you guys can actually like see see what's happening and at a high level what we're trying to do is just go ahead and actually Define all of the dependencies that you and I need to run this project and the most important ones are going to be obviously we need to have python to run our project then we're going to use crew AI most importantly we're going to be
using the new version of crew AI this is super important that you get version 0.11 um or anything greater and then you know we're just going to make sure we get our environment variables and so forth and so forth so that's the main thing that we're going to be doing and what we're going to do next is I'm going to go ahead and create our main file and our main fil is obviously we're going to be running all of our code and I'm just going to go ahead and just stub out some to-dos for us
so we know the direction and we're going to be taking this app so the first thing that we're going to be doing is setting up our agents the next thing that we're going to do is set up our task and then we're going to be setting up our tools so this is the order that we're going to be building everything today and what I'm going to also do now that we have that set up is actually go ahead and install our dependencies so that we can actually won't run into any issues as we start building
out each one of these so all we need to do is if we do a control back tick you can actually open up your terminal and what you need to do is like I said we're going to be using poetry to actually install our PI project. Tomo file and um that's actually set up inside of my zsh terminal so I'm just going have to switch to that real fast but what I'll have to do and you'll see more of this like I said in that crash course again but all I have to do is just
type in poetry install D- no- root and that's going to go ahead and install all those dependencies that we just talked about a few seconds ago and it's going to make make our lives very easy going forward so I've been loving this new way of actually installing and creating new projects and setting up all the depend dependencies for them okay cool so now that we got that out of the way let's go ahead and actually open up our new poetry file so we can see that everything's working so we just type in poetry. shell and
this will create our new environment so you can see it's spawning a new shell and a look at that it's showing that we're working with our new AI newsletter project fantastic and we can just make sure that it's working if I just run print hello fantastic and then we're just going to run python main fantastic all right yep everything's working so let's go ahead and start diving into the first task where we're actually going to start setting up all of our new agents for crew aai and when I go ahead and set up agents the
first thing I like to do is actually go ahead and create a new agents file inside inside of my file explorer so that's what I'm going to do real fast so I'm just going to call it agents. piy now what we want to do inside of this agents. piy is create a class that's going to be able to return all of our different agents and we'll talk through each one of them real quick but the important thing to note is that a lot of the new features that we've discussed in the rest of this video
actually do not come from working with agents most of the new featur we've talked about come from the crew itself and also with task so we're going to speed through this section really fast and I'm actually going to go ahead and actually just paste all of the different agents and then walk you through why we're doing what we're doing so right out the gate we need to have four different agents to run our program and what they're going to be are the editor agent who's kind of directing and overseeing the entire process of creating our
newsletter the important thing that you'll notice with this agent is that I'm actually setting Max iterations and that just allows us to make sure that we don't end up in an endless loop where this runs 200 times just to make a newsletter we just want to be very quick so this was one of the new features where they've made it a little bit more robust and actually make sure that we get a great output after this many iterations and the other thing that's important is we're allowing this agent to delegate work to other agents so
that's super important because we want people to be able to like hey I need this type of information you know news fetcher can you please go grab me that few other things we have our news fetcher this is the agent that's going to go out and search for the top AI news stories and what you'll notice for this agent that it actually has a tool and these tools allow it to go out and search the internet so you'll see how we build this in just a little bit outside that we have the news analyzer agent
who goes out and actually you know makes a detailed summary of the articles that they read and then finally we have the news compiler agent who takes in all the different content we've read from all the different articles and all the bullet points and detailed markdown summaries into one final cohesive newsletter that we're going to send out to all of our viewers Okay cool so a few things that we need to do on our side you'll notice I'm getting some squiggly marks under agent and the reason why we're getting that is because we haven't actually
imported that proper Library yet so so you know from crew AI we want to import our agent and what you'll notice is we're getting a squiggly under crew AI which is odd because we've already obviously installed all our dependencies earlier and that's because we haven't updated our Visual Studio code to start using our new python environment that we created a second ago so all we need to do is go ahead and open up your terminal and what we're going to do is you'll notice whenever we spawned a new shell it told me exactly where it
lived so what I can do is just copy that address right there click that python version down at the bottom and what I can do is you'll see it says enter interpreter path so I can click that link I can paste in our new poetry environment that we just created press enter and what you'll notice is it now says the exact python environment that we just created and you'll notice the squiggly go away because obviously we've installed everything one other thing you'll notice is that we're getting some issues with our search tools but hey we're
going to work on building those search tools in the third step of this tutorial but give yourself a pat on the back you just set up some awesome agents and now we're going to move over to go ahead and setting up all of the task that need to run inside of our crew and to create our task all we need to do once again open up our file explorer and then we're just going to make a task. py file and this one is going to be very similar where once again we're just going to make
a class and this is going to be an AI newsletter and then we're just going to call it task so it's going to be a class now this one what I'm going to do is I'm actually going to walk you through each of the three tasks we're going to make and actually walk you through why we're doing it and talk about how we're implementing the new features so the first task that we want to do is actually go off and fetch the news task that we're calling earlier so we can go out and grab all
the new AI news stories now let me walk you through what's new about this function so the first thing is we're obviously going to go off and start doing asynchronous execution and this is super important because this allows us to go off and fetch five to 10 different news stories all at the same time so that's the first one and the second one is we're going to start using expected stories now in the past what we would have done is just say hey go fetch the top new stories in the past 24 hours and you
know that's just kind of what would happen it just would have grabbed it but what we can do now is say no with my expected output I want my stories that you go grab to include titles URLs and a brief summary of each story from the past 24 hours and I go ahead and almost generate an example array where you know we have little Json objects of like Yep this is exactly what needs to come back so that I will be able to go off and you know manipulate and read all of the different news
that you go back and generate for me fantastic and the next thing that we're going to start doing is going ahead and actually analyzing the news that gets sent to us now this one is a little bit longer so let me walk you through it so once again we have a description of hey go grab the news stories and just make sure uh we have at least five well for formatted articles for our news then what we're going to do is once again we're going to have asynchronous task so this will allow us to analyze
different news articles at the same time and what is interesting is that we have context now if you remember from earlier whenever we start executing a synchronous task there was also the ability to provide context and context was basically saying like Hey whenever the previous task finishes feed the output of it into this task so in our case our analyze news task where we're going to like make sure that we're pulling out all the necessary information from researched articles so we're basically going to be feeding the output of this task into here which is going
to be the context of this task so I hope that makes since we're you know we're feeding this task into this task uh and this is all happening because everything's happening as synchronous sling and once again we're also going to be using expected outputs where we're going to say like hey when you go out and search for news stories and you get a breakdown of what happened I want your output to look just like this so as you can see everything's nice and formatted we're getting out the exact information a rundown of what happened the
details and why it matters that's exactly what we want our output to look like and the third task that we're going to be focusing on is going to be the compiling or compilation of the newsletter itself and for this one what you're going to notice is um not only are we passing in the agent and the context we're also going to be start working with callback functions and that was one of the major new things that we started talking about earlier so uh for this one what we're going to do let's go part by part
once again we're going to be compiling newsletters using our context and this one's important because this compilation task is actually going to be receiving the inputs from this previous task so you can kind of see how we're slowly building up the chain where we start off researching then analyze and then compile everything down into one F final newsletter so that's just kind of the flow of how this crew is operating and once again what you can see that's pretty cool with this expected output is that we start off with a description of what we want
and provide once again a great example of exactly what we want to see in the final output to make sure we get really consistent and reliable results and in this case we just want to say hey these are the top news stories with the headlines and then we go on and do do a deeper dive into each one of those stories with a rundown the details and why it matters for each one of those and this is the same format that's getting used like I mentioned earlier in some of the top performing newsletters that are
out there on X right now where they have hundreds of thousands of readers so this is going to produce some awesome results for us but what we're going Toad and do next is actually go ahead and clear up some of these squiggly marks so the first thing is you'll notice that we're missing task so what we need to do for task is this time instead of importing agents we need to import a task so from crew AI I want to import a task fantastic and the next squiggly mark that I see is for date time
so all we have to do to import datetime is just say hey from datetime import datetime fantastic so now this is all cleaned up so what we're going to do next is we're going to hop over to our main.py file and let's go ahead and actually start entering in some of the puzzle pieces that we have just built so far so the first thing that we want to do is go ahead and add in all of our agents and we need to import them first so so what we're going to do is we're just going
to say agents are equal to and this is just going to be our AI newsletter agents and this is what we made earlier and then we're going to have our task which are just going to be our AI newsletter task now these are obviously squiggly um so we need to go ahead and import those two so super simple just from our agents file import the AI newsletter agents and then from our task f file import the AI newsletter task great so that's looking good and the next thing that we're going to start working on now
that we have our agents is we're going to go ahead and set them up so this is going to be super simple we're just going to pull out our editor agent and this one is just going to be agents. editor agent and then our news fetcher is going to be our news fetcher one and so forth and so forth for the rest of our different agents that we've just talked about fantastic now what we're going to do is I'm actually going to pull up our task side by side so that you can see why I'm
passing in what I'm passing in okay so let's start off with a Fed fetch news task now for this one what we're going to do is say fetch news task and then for this one what you'll notice is all we need to pass in is an agent and in this case we want the news fetcher to fetch the news that's pretty straightforward the next one is going to be our analyze news task news task and for this one we're going to do is just basically a uh you got to love a co-pilot filling in the
right information but what we going to do for our analyze news task is pass in the agent who in our case is going to be the news analyzer that we created earlier and then we want to pass in the context well in our case what is the context that we want to pass in and this is where things get a little bit interesting what we actually need to do is actually break this up and put it in Array and um just because you can pass in multiple items to a context so that's super important to
remember in our case the only piece of context that we want to pass in is our fetched news items and this is basically basically just going to allow us to like I said start slowly building up from researching the internet analyzing what we've learned and then building out a final newsletter great so I'm going to keep moving this to the side so that you guys can actually see what we're doing and the final thing that we're going to do is go off and build our compile newsletter task and this one um this one's going to
be a little bit longer than the rest so let me go ahead and show you what's happening so we're going to go and create the task pull it out from over here and then what you'll notice in our final version is we need to pass in the agent the context and the call back so those are the three different items we need to pass in as parameters so in our case um we need to work on our agent who's you know going to be the news compiler then we need to pass in our context which
is the previous task like it's it's kind of cool that you can see that we're building up and then finally we're going to pass in a call back now we don't have any yet so we're going to put a to-do to say add callback function fantastic so now that we have that setup what I'm going to also do is let's just go ahead and skip a step and we're going to actually go ahead and build our crew real fast so that you you can see how everything ties together and then we'll fill in a few
of those final missing puzzle pieces for you guys so we're going to go ahead and create a crew and what we want to do with our crew is we want to pass in our agents and that's just going to be everything we created up here so that's super straightforward then we're going to work on our task now our tasks are just going to be these three tasks we created right here super simple and then this is where we're going to start using some of the newer features and more specifically this is where we're changing things
to go off from sequential over to hierarchical so all we have to do is just say process is equal to process Dot and then just hierarchical so higher arle fantastic and then lastly if you remember from the earlier training we have to start defining a manager llm in order to start actually using the hierarchical process so that's what we're going to work on implementing these next okay so we're getting a few squigglies so let's clean up these squiggle marks and then actually go ahead and get this uh filling the missing puzzle pieces so the first
thing thing is we need to go ahead and import our crew and that's super straightforward we're just going to say from crew import our crew sorry from crew AI that was my bad crew and then we also want to import our process this is what allows us to change like I said between sequential and hierarchical so that's looking great and then the next thing is we need to Define our manager llm that we want to actually you know run the entire orchestration and set up the chain of command so in our case what I'd like
to do is actually go ahead and just set up like a general open app I open AI GPT 4 so just right up here I'm just going to go ahead and initialize one real fast and we'll just do something like this so just open AI is equal to a chat open Ai and once again more squiggles so let's go ahead and knock those out real fast and this one's pretty straightforward we're just going to use Lang chain for this we're going to say from Lang chain and then o Open AI I just went to import
chat open AI great things are looking good so let's go ahead and actually start using this in our llm down here fantastic so so what you might notice is that so far I've mentioned that we're going to use a hierarchical process to go off and orchestrate and make sure there's a chain of command and that things are getting um operated in a top- down fashion inside of our crew but what's cool is if you were actually to like dig into what is happening under the hood with crew aai you'll see whenever we go with a
hierarchical process there's actually a pre-built agent that's a manager that actually looks just like our other agents right here but it's just you know it's just defined to be a manager agent so that's pretty cool that crew AI goes ahead and sets up a manager agent for us whenever we start using hierarchical Okay fantastic so now that we have went ahead and actually kind of set up a little bit more of like the final output so that you guys can see what it looks like to actually add in the new hierarchical process let's go ahead
and start actually working on the next task which is going to be setting up our tools more specifically we want to go off and start searching the internet so let me show you how we're going to do that so to set up our tools all we need to do is once again open up our file explorer and what we're going to do is just make a new folder and we're just going to call this tools just because in most projects you'll actually have a bunch of different tools so we want to keep things nice and
organized so the first thing we need to do is just go in here and create a init.py file just so that python recognizes that this is a directory and then we're going to go off and actually add our tool which we're just going to call search tools. piy now what I'm going to do in here is I'm actually just going to go ahead and like paste what the final output is is because I've already described in the previous crash course on why we've set up everything inside of this Search tool but let me walk you
through what's happening at a very high level and if you want more detail feel free to go watch the entire free crash course that I set up earlier so what's super important about this is we have set up a tool that um and we know we've set up a tool because we've added the tool decorator to this search internet function so this is what allows the crew to recognize that it has the ability to actually use this tool and what it's going to do is we're going to pass in a query and this query is
what we're going to pass into serper which is a tool that allows you to go off and search the internet so what you actually need to do is uh if you haven't used serer before all you need to do is just come over here um serper dodev and like you said you can see it's the world's fastest and cheapest Google search API it literally takes a second and produces a ton of great results so just sign up if you haven't before but whenever you do finally sign up you'll be brought to a dashboard just like
this to where you can see how many you know free credits you have left and like I said it's free to use so I definitely recommend using it but what you need to do is come over here create an API key and what you can do is just click reset key and um so I'll just go ahead and show you how you guys can do this you'll click reset key and then copy it once you've copied it what you're going to do is we're going to actually open up ourv file and this EnV file is
where we're going to go off and store all of our environment variables so I'm just going to come in here and paste it but more specifically we need to give a name to this new key and you can actually see it over here in the tools it's our serper API key so we're just going to say serper API key is equal to that fantastic and now that we've set up our tool with our key what it's going to do is go off and search the query in the internet more specifically it's going to be looking
for news articles what we're going to have happen from here is it's going to actually try and just make sure that there was no errors when it was searching the internet and then what it's going to do is create a quick string from all the information it got from its top five results that it was looking up when it searched the web so it's going to pass us back a title a link to the actual article itself the date which is super important because we're building an AI newsletter and we only want to make sure
we're including stuff that comes from the past 24 hours so this date field that we get back whenever we use serper is going to allow us to make sure we're not putting stuff in that was you know from three months ago so this going to make sure we're getting the latest and greatest and like I said this is just going to return back a list of internet search results back to the rest of our code so now that we have this set up what we can actually do is start importing it in the rest of
our code so if you remember back in our agents file we had some tools that we said that our agents can go off and use so all we need to go off and actually start fixing these squigglies is we need to import the search tools that we just created so all we're going to do is up top we're just going to say from our tools folder and our search tools file I want to import the search tools class fantastic and this will actually resolve all of our issues so fantastic you've just set up your new
tools for your agents to use so let's hop back to our final main.py to go ahead and actually finish clearing everything up cuz we're almost done guys yall yall have crushed it so far so the few other things that we need to do to actually go ahead and get this crew to run is we need to go off and actually grab our open AI keys and actually update our environment variables so that our open AI can actually you know go off and do everything it needs to to do inside of the crew so let's go
ahead and grab our open a Keys real fast so all we need to do over on open AI is go ahead and click that we want to go over to the API and once we've done that over here on the left hand side we can click API keys and once we're here we can go ahead and create some API keys for our project so I'm just going to go ahead and say this is our crew AI updated this is going to create a secret key so make sure you protect the secret key and don't share
it with anybody so I'm going to copy it and we're going to head back over to our code and it's important that you name this the proper key so you just got to call it open AI API key cuz this is what open AI is going to search for by default so now that we have our key pasted in what we're going to do is finish tying up a few loose ends so one of the main loose ends that we haven't got to do yet is implementing this callback function and the reason we're going to
create this call back function is because we want to save our newsletter to our local basically to our computer once it's done created and it's going to be saved as a markdown file so what we're going to do is go ahead and create a new file and we're going to call it our file.io now what this is going to do is allow us to save our final like I said our final newsletter as a markdown file so let's go and save it and let's start working on this so like I said this is going to
we're just going to call it save markdown and what we're going to do is we just want to like go ahead and pass in what we want to do uh the task output now the task output is going to have a results to it and you'll see that in just a second but the main thing we want to do let me just like for Speed sakes to show you what we're going to do we're going to go ahead and get today's date because that's what we're going to use as the name as the file so
we're going to set the name of the file to be today's date. MD so it's markdown and then we're going to write the output of our task to inside the markdown file and the way we can grab the result of the task is just say task output. result and that's how we can grab the string content of our output and then we're just going to print that hey you know everything was saved properly fantastic and then once we need to do to go ahead and fix our missing dependencies and we're just going to say from
datetime import datetime this is looking great yall are crushing it and then what we're going to do whenever we head back over to our main.py what we can do now is actually update our call back function and what we're going to do is just say that we want to use our save basically save markdown so I'm just going to say save markdown and then now we need to go import it so just head back up top and what we're going to do is just say um one second we're just going to go ahead and say
from our file. o file that we just created import save markdown looks great and now that's looking fantastic and the only other things that we need to do before we can run it is let's go ahead and scroll back down and now that we've created our crew it's up to us just go ahead and kick it off so what we're going to do is just say you know kick off the crew so this is just going to be results is equal to you know crew. kickoff so that's how you kick off the crew and then
we're just going to print out the final results when the when the crew is done so we're just going to say crew work results fantastic co-pilot is too smart sometimes and we're just going to print the results okay fantastic so let's go ahead try running this roll fast and then we'll debug if any issues come up so all we're going to do is go ahead open up our terminal again and now we're just going to run python. main.py to go ahead and actually run our new crew and then this should start kicking off everything and
start trying to generate our new AI newsletter that will it will later go ahead and actually save but we actually ran into a quick air so let's go and fix this real fast and it's says cannot import the name AI newsletter so I think we actually misnamed something so let's go ahead and fix that real fast and I know what we need to do if you just actually head back over to our agents file what you'll notice is that it's looking for agents plural so we're just going to update the spelling of that save it
real fast try running it again and hopefully things will work better this time and oh we ran into one more small error uh once again we misnamed it so AI newsletter task so if we head over to our task file go ahead and copy this we just misspelled it put a lowercase L Okay cool so let's go ahead rerun it again and I think we're almost there at the very end uh finally it did not find our open AI key and that's just a very quick issue that we need to resolve all we need to
do is actually just load our environment variables that we have saved over here so this one's super simple just go back to your main.py file and right up at the top what we're going to do is actually just go ahead and say Hey I want to load all the environment variables that I have saved so that we can use them throughout the rest of our project okay great so let's go ahead try running it one more time now that we're the in the home stretch and then all right our crew is Off to the Races
so what it's going to do it just go ahead and run for a few minutes where it's actually going to go ahead and work in the new hierarchical structure to where it's going to go off and search for some cool new AI articles it's going to take out yep like you see this is the exact expected output that we got or we're looking for and this is our tool our Search tool going off and actually grabbing the title the link and then sometimes it can't find the date but it will try if it can and
then it'll go off and generate Snippets and then you know it's just going to keep going from there so what I'm going to do and like this is what I was saying earlier to where it's using that expected format that we set up so like I said what we've been talking about actually does work and it actually does get implemented in our code so what I'm going to do is I'm just going to let this run for a few minutes and then I'll go ahead and show you the Final Markdown file that will get saved
over here with today's date of February 20th in just a little bit all right so our crew just got done generating our AI newsletter and it's honestly pretty awesome so to today is February 20th 20244 and the results it got were awesome so literally within the very past few days Sora just came out and there's a ton of buzz on the internet right now where people are talking about how this is awesome what it's going to replace and then it's pretty cool that our newsletter follows the exact same format that we set it up earlier
in our expected output section and what's also pretty cool is that this article actually just broke 6 hours ago where the US is now actually setting up an AI task force to make sure that you know they things they just basically enforcing regulation so this is breaking in real times and our AI newsletter found it and put it in a format that we could now go share off in our newsletter and then I guess there was also some more interesting new articles about how I guess AI compares to the tr- from back in the day
so like I said this is pulling out recent information that's happening in the last 24 hours and putting it in a way that can be synthesized by our viewers and actually you know hopefully save us some time while we go off and grow our newsletter and make millions but that's right for this video guys I hope youall enjoyed this updated crew aai tutorial where you got to learn how to use the new updated features of crew Ai and you got to build your own AI newsletter so if you enjoyed this tutorial I definitely think you'll
love some of the other AI tutorials I have on this channel and I also recommend checking out whichever video YouTube has recommended for you over here on the side of the screen but until next time I can't wait to see you guys and hope you have a great day see you