🛠️ What You’ll Learn in This Crash Course: In this step-by-step tutorial, I’ll walk you through CrewAI Chat, the brand-new feature that lets you interact with your AI agents in real time. You’ll learn how to:
✅ Use CrewAI Chat to build and refine AI-generated content with live feedback. ✅ Automate newsletter writing using an AI-powered workflow. ✅ Master the code behind CrewAI Chat so you can integrate it into your own projects. ✅ Iterate and improve AI outputs without manually editing responses.
This tutorial is perfect for developers, content creators, and AI enthusiasts who want to automate content creation and build smarter AI workflows.
⏰ Video Timestamps: 00:00 - Intro 01:00 - Free AI Developer Accelerator Skool 01:27 - CrewAI Chat Overview 05:54 - Write an AI Newsletter With CrewAI Chat in 3 Minutes 12:57 - CrewAI Chat Visualized 17:19 - Chat Code Deep Dive 22:55 - Outro
Hey guys, in today's video,
I'm super excited to share with you
one of the newest crew app features
called Conversational Crews
that allows you to chat with your crews.
And to help you guys see how powerful this new feature is,
we're gonna go off and chat with a newsletter crew
that's gonna write an AI-driven newsletter
just like this one in under three minutes
using this new feature.
Also, I'm so excited for you guys
because I'm gonna be giving away my favorite crew
that I've ever built.
In this crew, it packs in a bunch of lessons learned
and all the best practices for content generation
from a bunch of different expensive courses
I've bought over the years.
So in this video,
you're basically gonna get an AI content generation
specialist completely for free,
and you can check it out in the link in the description below
to go ahead and download it for free.
Also, to help you guys master Conversational Crews,
at the end of this video,
we're gonna dive into some of the important code
behind the scenes
that actually allows this crew AI chat feature to work
so that you can fully understand exactly how it all works
and how it connects together
so that you can fully master this new feature.
But enough talking, let's go ahead and dive in
and see crew AI chat in action.
Oh, by the way,
if you're looking to join a community
of like-minded AI developers
and get support on your own AI projects,
you'll definitely wanna check out
the free school community I created for you guys.
So far, we have over 4,000 members just like you,
and we also do weekly free coaching calls
where you can hop on a call with me
and a bunch of other members in the community
so we can get you unstuck on your problems
and you can keep making progress.
But enough of that,
let's go ahead and hop back to Conversational Crews.
All right, guys,
so before we just start chatting with this newsletter crew,
I wanna give you a quick breakdown
of the agents and tasks inside of it
so that you understand exactly what's going on
so that when we do start chatting with it,
you're like, cool, I know exactly what we're doing here.
All right, so a quick brain dump.
Our whole goal is we want to give this crew
a brain dump of everything we wanna do for a newsletter
and then let the crew go off,
take that brain dump,
create an awesome subject line
and create the content for the actual newsletter itself
and then save it to a file for us.
That's our whole goal.
All right, so here's exactly how it works.
Like I said, we have three agents.
The synthesizer is just gonna take in our raw ideas.
It's going to go off
and actually create that subject line for us
to go ahead and define the direction of the newsletter.
It's also gonna go off and create an outline.
This information is going to get passed over
to a newsletter writer agent
and the whole purpose of this newsletter writer
is to go, cool, I know the subject line.
I also know the outline of the entire article.
I'm gonna use some of my previous training
to go off and actually now generate
an awesome looking newsletter
that follows all the best practices.
I'll show you more of this in just a second
and then finally, what we're gonna do is at the end,
we're just gonna do a quick pass through
of the article that we just wrote
and just make sure that it follows all the best practices.
Specifically, do we follow the proper word count
because we're trying to generate articles
that are between close to a thousand words
for a really nice looking newsletter
and quick shout out to a post I did the other day.
The reason we're passing in these tools
like the word counter tool is just because by default,
these LLMs were maxing out at like 800 words
so we're gonna give our agents a tool
so they can actually see like, oh yeah, this is 700 words.
That's not a thousand.
I need to do another iteration to hit that proper word count.
So pretty cool tool.
You'll see this in action in just a second.
And for each agent, there's a corresponding task
that basically just does the thing.
Okay, so the only other part that's important,
whenever it comes to actually starting
to chat with your crew,
the only thing you need to add going forward
is this chat LLM feature right here.
So you're just gonna go ahead and define the model
you want to use when it comes to chatting with your crew.
We'll go much deeper into this later on,
but just know that you can actually pass in any model here
and that model is gonna be the one
who kind of facilitates the conversation
and actually goes, okay, cool.
You've given me all the information I need.
I'll go ahead and kick off the crew.
But we'll dive into this much later on.
I just wanna go ahead and plant a few seeds
in your head for what's going on.
All right, so let's quick recap
into this actual agent and task
because I think this newsletter crew is amazing.
So when it comes to synthesizing our ideas
for the synthesizer agent,
few of the cool things that I just wanna point out,
we're gonna go ahead and make sure
that we give it an exact process to follow
when it comes to generating the subject line and outline.
So we just walk it through exactly
what to do with a brain dump.
When it comes to subject lines,
we go ahead and give it the best practices
for writing the headline itself.
We give it examples of an actual execution
so it goes and understands like,
oh, here's exactly what I had to do.
I spent so much time on this crew,
so please study this one
because there's so many golden nuggets in here
of following best practices.
And you're gonna see it in action in just a second.
Finally, when it comes to writing our crew,
our actual newsletter, this one, once again,
it's packed with a bunch of actionable insights
that the agent needs to do
when it goes to writing a newsletter.
So, you know, like, hey, you have the intro.
Basically, we're following the template
of a general newsletter, like the general structure,
which includes like intro, a deep dive,
a curated resources, and conclusion.
So we just say, like,
here's exactly the steps you need to execute.
Here's an example of this execution in action.
And so it just knows exactly what to do.
So this is, if you go off and write,
wanna write your own newsletters,
definitely recommend following this crew right here.
And I'm not gonna keep going into it
because the agent's basically just,
this final one just reviews
to make sure it did everything properly.
And the task, what you'll notice is
it also just has a little bit of the same information,
but we just kind of dive into a little bit more
like bulleted structure of like,
here's some best practices.
So the agent has all the context of like the process
and the task kind of just defines exactly right now,
like here's what needs to happen.
And you can kind of move the information back and forth.
At the end of the day,
all of the information eventually gets fed into the LLM.
So where you put it doesn't matter as much,
but this, I do like the structure.
So I would recommend copying it.
All right, so enough talking,
let's go ahead and actually start hopping over to a terminal
so we can actually start chatting with our crew
so you can see it in action.
And if you have any questions about this group,
please drop a question down below.
I'd love to help you out in the comments below.
All right, let's go ahead and open up a terminal real fast.
All right guys, so now it's time for the fun stuff
where we're gonna go ahead
and start chatting with our newsletter crew
to go ahead and write that AI developer newsletter.
And you're going to be amazed
with how quickly it's able to do it.
So let me walk you through the process.
So first things first,
we're gonna go ahead and type in crew AI chat.
And this is gonna go ahead
and actually start analyzing the crew
to figure out exactly what input the crew needs.
And then it's going to go ahead and understand like,
oh, you're a newsletter crew who outlined subject lines
and goes off and actually goes ahead
and creates an AI developer newsletter.
It understands exactly what we did.
We didn't have to tell it any of it.
It analyzed our entire crew,
figured out what was going on and knows what to do next.
Super cool.
All right, so let me walk you through
exactly what we're gonna do next.
First, we're going to go off and pass it in an input.
And let me walk you through what this is doing first.
And then I'm gonna show you how I was able to do it
in like just a few seconds.
So I was like, hey, I need your help writing a newsletter.
For my audience, the main topic I want to talk about
are there's four types of luck.
Here's the four types.
I didn't type these all out.
I just went over to Google and said,
please give me the four types of luck.
Copy and paste.
Cool, that's fast.
So that's my topic I wanna cover.
Then what's the angle I wanna cover?
Well, in my case, I want my AI developer audience
to know how they can use these four types of luck
to go off and just open their chances
for good opportunities to come their way.
So what I did is I went into each one of these topics
and just gave a quick little blurb.
So let me just show you real fast.
So I was like, all right, when it comes to blind luck,
there's nothing we can do.
We just pray that it comes to us.
For luck in motion, I just talk about how when you go off
and start building like an AI personal brand
and start posting content online, you're taking action.
You're going off and exploring new technologies.
So like you're taking action
and opportunities come that way.
Luck from awareness, I basically do the same thing.
When you're in the weeds,
you understand what's going on in the AI developer field.
You're open to understanding exactly what's going on
and can take actions.
So you can invest, you can join a company,
you can build an app, all sorts of things.
And then luck from uniqueness, this is,
hey, you put your personal brand out there.
People understand exactly who you are,
what you're capable of.
And because you are known as basically a specialist
at what you do, opportunities come to you
because they want you to do the work
because they understand what you can do and trust you.
So this took, up top was a copy and paste,
down below took about probably five minutes of writing
of like, yep, here's what my thoughts are
and here's a few examples.
So all around pretty cool.
And just a quick thing I do want to call out.
This came from Sean Puri,
basically episode on how to be lucky as an entrepreneur.
That's where like the idea came to me
about these four different types of luck.
So definitely an awesome channel to check out
if you haven't seen that already.
All right, so enough talking,
let me go ahead and show you
how we can actually start chatting with our crew.
So we're gonna go ahead and grab this input.
Next, what we're going to do
is go ahead and actually start pasting it into our chat.
And what I'm gonna go ahead and do
is once you're done pasting in your message,
all you have to do is hit enter
and on a new line, it's like, cool.
We're gonna go ahead and process your input.
Now, this will take a few seconds
because it's actually gonna go ahead
and run the entire crew.
So it's gonna go ahead
and go through those three different tasks
and all those agents are gonna work
on each one of those tasks.
So I'm gonna pause for a second
and come back once it's done
and I'm gonna show you how we can actually chat with it
to make sure we get the exact perfect newsletter
that we're excited to go ahead and publish.
All right, guys, so it took just a few seconds,
but our crew went off and generated the perfect newsletter.
So as you can see, we can see it here in the terminal,
we can review the result of everything it just said,
but we can also see that inside of our code,
we can go ahead and see that it made a new file for us
called our final newsletter
and we can actually view it here in a easier to read format.
So now I'm gonna go ahead
and show you just how easy it is
to begin chatting with your crew.
So I went ahead and put together some feedback
that I'm going to go ahead and paste in there
so you guys can see it in action.
So we'll come back down here to the bottom
and we'll go ahead and paste in our feedback,
which basically just gonna say,
hey, please regenerate the newsletter
with the following feedback,
make sure each luck section like up here
where it says like, you know, luck from uniqueness,
go ahead and put a number in there.
I wanna go ahead and drop this section
and then when it comes to the action steps inside
at the very end, just tweak them.
So as you can see, I'm gonna go ahead and click run
and this will go ahead and kick off
another iteration of the crew.
So basically at this point,
you can see we're like chatting with the crew
and it's gonna go off and take in our feedback
and actually regenerate entire newsletter
using this feedback in the next iteration
so that we get the perfect result every time.
So we're gonna do a quick pause
as it's kicking off the crew and regenerating everything
and I'll show you the final result in just a second.
All right guys, so it just finished up
the second iteration of our AI developer newsletter
and it is actually perfect.
It did exactly what we said to do.
So let me hop back over to a markdown view
so you can see exactly what I see.
So first off, subject line, absolutely beautiful.
It follows everything that we mentioned for best practices
inside of our agents.yaml file.
Then we added a few pieces of feedback.
So I wanna show you that it did it perfectly.
So we said, hey, going forward,
don't just give me the name of the luck, number it.
This just makes skimming through the newsletter
easy as possible.
So it went ahead and incorporated that feedback,
which is awesome.
Next, we said, I want you to drop that curated list.
So that used to be right here.
It dropped it like we asked.
And then finally, when it comes to actionable steps,
we said, hey, make sure you talk about these.
And that's exactly what it did.
So all around, you can see we now have the ability
to not just kick off a crew and fingers crossed,
hopefully it got the perfect result
and then manually tweak the results.
Now you can go ahead and do multiple iterations of the crew
to continually get a better and better result
until it's absolutely perfect, just like this.
So all around, this is awesome.
I hope you guys see the power of this.
And what you could easily do next is go ahead
and literally copy and paste this over to Substack.
That's exactly what I did earlier.
And I wanna go ahead and just show you what that looks like.
So real quick, if you head over to Substack,
what you can do or whatever newsletter site you use,
you can go ahead and paste it over here.
This is a previous iteration of the exact same input.
So you can see, I went ahead and posted it.
You can go ahead and view the post
and they just look awesome.
You can see like this just looks
like a really nice looking newsletter.
It's easy to read, it's skimmable, it has action points,
it has bullet points, so you can easily take away like,
oh, here's exactly what I need to do.
And it has that nice, you know,
call to action PS at the bottom,
which is exactly what we would want
in a professional looking newsletter.
And as you can see, all we did is it took like,
literally less than like three minutes.
We pasted it in an input.
Half of the input was AI generated.
And then from there, we just said,
hey, that looks good, tweak this.
And then it gave us the perfect result in no time.
So I hope you guys are seeing the power
of this new conversational crew feature.
And I cannot wait for you to go off and use it on your own.
You'll have to let me know how you're gonna be using this
in your own workloads.
But enough of seeing this in action,
what I wanna do next is actually go ahead and dive in
and show you how this conversational crew feature
works behind the scenes,
so you can understand exactly what's going on
and how it's going to impact your crews
when you're working with this new feature.
So let's go ahead and hop over to Crew AI
and do a quick deep dive.
All right, guys, so here's the quick Crew AI deep dive,
so you can understand exactly how this feature
is working programmatically,
so you have a better context and understanding
of how everything is working together and connecting
as you're using the new Crew AI chat feature.
So what I wanna do is cover the old way,
and then we'll dive into the new way
so you can understand what has changed.
So let's go old way first.
So this is what happens right now
when you kick off a regular crew.
So the current process is you're able to pass in inputs
such as like, hey, here's my newsletter brainstorm.
And then that input could be accessed anywhere
in your agents or your task.
And what's gonna happen is task one is gonna work,
the result from task one is gonna get passed in
as context of the next one,
and then task two is gonna go off and do some work,
get passed into the next and so on and so on
until it's done generating your newsletter.
But as you can see, this process,
like the only lever you can move is the input.
You're pretty much stuck outside of that.
So now let me show you what has changed
inside of the new conversational crew method
and actually what's actually going on.
So it's important to note, as you saw earlier,
we defined a chat LLM.
And the best way to think of this chat LLM
is that it is a layer that sits on top of your crew.
So basically this chat LLM is going to wrap
all around your crew
and it's going to treat your crew as a tool call.
What I mean by that is as you're typing in a message
to, you know, with this chat LLM,
at every point it's going to be asking,
can I call the crew AI tool?
Its whole goal is to call that tool.
And it's just trying to get just enough information
to call the crew inside of it.
If you've worked with open AI tool calls,
it's exactly what's going on there.
It just so happens that our tool is an entire crew,
which is a pretty cool concept.
So what is happening in the new approach
is once it has enough information,
it's going to kick off your crew
by passing in the normal inputs that you'd see right here.
So it's going to pass in the normal inputs.
So it's going to take your raw conversation,
which is, hey, I'd like to make an AI newsletter
about the four types of lock.
And I want to talk about this.
It's going to pass all that in as the normal input
to your crew, just like we would have done in the old way.
So it does the mapping for you,
mapping your raw text to an input,
all for you, which is pretty cool.
But then here's the cool kicker
that I think you guys will like.
And this is how the actual feedback iteration part works.
So what we're doing in this new approach
is all of your messages that you're typing with the crew.
So like, hey, please do this.
And hey, please add in this feedback
and the result of the first iteration of the crew.
All of these messages are going to get passed in
as context to your task.
And what this is going to allow the crew to do is go,
okay, I can see in the previous execution of this crew,
here is the result and here's your feedback.
And I can see that you wanted the subject line
to be different and you wanted it to be in this new format.
Well, since task one is all about generating
better subject lines, it's going to go,
oh, I now understand what you don't like.
And I understand what you do like in this specific case.
So I'm going to take in all that feedback
and I'm going to generate a better subject line
and potentially not line.
Then when it gets to the write a newsletter task,
it's going to go, oh, I see in your previous iteration
when I generated the deep dive section
and talked about the four types of luck,
you didn't like my numbering schema.
So I'm now going to update the way I, you know,
number everything inside the newsletter.
I'm also going to take out the curated section
and I'm going to add in, I'm going to improve my action items.
So as you can see,
that's how this crew understands
what changes it needs to make.
And it really comes down to,
we are adding inside our task,
just a previous message history.
So it understands what went wrong,
what actually was taped
and what improvements we need to make going forward.
And in this cycle just happens over and over and over again.
So as you type in more messages,
basically this is just going to get copied over
and over and over again so that the crew can see,
oh, I see we've done three iterations at this point.
You don't like any of them
because I'm doing this wrong.
I now know what to do in the next one.
So hopefully you kind of see exactly what is happening.
And now that you've kind of have like a high level
visualization of what's going on,
I just want to quickly just show you
a few of the code snippets
that I think you might find interesting
that actually makes all of this possible.
Let's go ahead and actually hop over to cursor
to see all this in action.
All right, guys.
So welcome to the crew AI behind the scenes look
of how this feature actually works.
And this is totally not necessary.
You don't need to know how it works,
but as a, if you're a fellow AI nerd like me,
it's sometimes cool to understand exactly
how new features like this get built and actually work.
So let me walk you through exactly what's going on.
So you can kind of see like, oh, that is pretty cool
how we go off and actually built this crew AI chat feature.
And before we dive into the code,
I just wanna like quick recap what our ultimate goal was.
So this makes sense.
So at the end of the day, we have a crew.
Our whole goal is to kick off that crew.
Specifically, as I mentioned earlier,
we're treating the crew AI kickoff as a tool call.
So we're ultimately trying to do is like,
we wanna have a conversation
like a normal chat to BT style conversation
where we're just asking questions and talking.
And then whenever we have enough information,
we wanna go cool AI,
I want you to go off and kick off this tool.
Just so happens this tool is an entire crew.
So that's what we're trying to do.
Now, there's a little bit more
that has to happen behind the scenes,
such as like, okay, well, we have a crew,
but what the heck does this crew do?
What's the purpose of it?
How, you know, what inputs does it mean?
All of that information we actually have to extract
and we have to actually do some fanciness
to get all this working.
So that at the end of the day,
all we have to do is, you know,
just basically we wanna do all the work.
So on our half, like we want crew AI to do all the work
so that it's very easy for the LLM
to understand exactly what's going on.
So here's exactly how it works under the hood.
So first things first, what do we wanna do?
Well, in our case, we want to go off
and grab all the inputs of the crew.
How do we find the inputs?
And what are the inputs?
Well, if you go back and look at your task and agent file,
you will probably have added in inputs just like this.
So an input is anything that's a parameter or variable
that you pass into your task or agents.yaml file.
So anything you see in curly brackets is an input.
So we go, okay, cool.
I now understand what are the inputs for this crew.
Now, what I need to do is also understand
what do those inputs do?
So like, I need to understand like,
okay, I know the name is brain dump,
but like, what is the brain dump?
Like, because at the end of the day,
like when you're creating tool calls,
you need to know the variable name,
you need to know the variable description,
and you need to know what you need to pass into it.
So we actually have, you know,
definitely check out my crew AI new verse pro video
for a deeper understanding of how tools work.
But we're basically, you know,
we're converting crew AI into a tool.
So we have to follow those same lessons learned
in that video.
So we go, okay, cool.
I now have the inputs.
And what we're also gonna do is go ahead
and analyze the entire crew itself in the next one.
So we're gonna go, okay, you are a newsletter crew.
I understand your purpose.
I understand your whole goal
is to go off and generate a newsletter.
So I understand the tool.
I understand its purpose.
And now what we're gonna do
is work backwards to build a schema.
And the schema is basically just gonna be like
a long object that says, okay, random LLM.
Here's everything you need to know
about generating and using and kicking off this crew.
It generates a newsletter.
It takes in this brain dump input.
It's a string.
Here's everything you need to know
in order to properly kick off this tool.
So then we go, okay, cool.
We have context for the entire crew now.
And now it's time to start actually chatting
with this crew.
So this is where we're gonna start working
with what I'm calling the build system messages.
So this is where we kind of map in like,
okay, here's all the required fields
needed to run this crew.
And now let's just do some prompt engineering
to accomplish a few things.
First, set context.
So you are a helpful AI assistant for crew AI.
Your whole goal is to basically assist users
with a specific crew.
You can talk in a general fashion,
like you can answer random questions,
but your whole goal is to always steer people
towards kicking off this crew.
Then we're gonna go ahead and just,
here's all the required fields you need to run the crew.
And then we just do some other general prompt engineering
to help it.
It's actually asking questions
that are appropriate to the conversation
to steer you to using the crew.
And we just give it some general additional context.
It's like, here's the name of the crew
and here's the description of the crew.
So all around pretty cool.
And you can actually see this in action
because like I said, we were just trying to,
that was the prompt.
That was the initial system message.
And then you can see, okay, cool.
And now we're gonna go ahead
and generate the assistant message from that.
So it's gonna take in everything we just said here.
It's like, hey, here's how you should start a conversation.
Hey, I'm here to help you with accomplishing this.
And you can see it followed that exactly here.
Hey, I'm here to help you transform your raw ideas
into a gauging newsletter.
So you can see it's actually using the prompt
we set up earlier.
And now it's working in a way that's specific
to the crew that we've built together.
And it's all just working magically,
which is the cool part.
I love that we tried to make everything magical at Cray.
All right, outside of that,
is there anything else I wanted to mention?
Yeah, outside of this,
the only other thing that's pretty important is,
yeah, this is that introductory message
from the assistant.
That's how this got generated.
And pretty much from that point going forward,
all we're doing is having messages,
which are messages between us and the AI.
And then we have our available functions,
which in our case is the crew,
like we wanna call the crew.
And then we just enter a chat loop.
And the whole point of this chat loop
is to go over and over and over again
to where we ask the user a question,
work towards kicking off the crew.
Then we can actually go ahead and kick off the crew.
Sometimes add that message back to our conversation
and then just keep the loop going
over and over and over again.
So definitely recommend checking out this file,
Cray chat, if you want to dig a little bit deeper,
but I just thought you guys might find it pretty cool
to see like, oh, how do you take a crew
and start chatting with it?
So I thought this might be a cool deep dive
for you fellow developer and AI nerds out there.
But yeah, that's a wrap for everything inside this video.
If you have any questions on anything I've just talked about,
please go ahead and drop a comment down below
and I'll be happy to help out.
Or I'd love to see you over in the free school community
to get some additional help over there too.
And that's a wrap for this video, guys.
I hope you love seeing
this new conversational Cray feature in action.
And just as a quick reminder,
you can download all the source code
in this video complete for free.
Just check the link down description below
and you definitely don't wanna miss out on this crew
because it's my all time favorite.
And second, if you want to join a group
of like-minded AI developers completely for free
and get help on your own projects,
you'll definitely wanna check out
the AI Developer Accelerator School Community
I created for you guys completely for free.
But that's a wrap for this video, guys.
And I cannot wait for you guys
to see a bunch of other AI content
that I have on this channel.
Everything from Cray, LangChain, and a bunch more.
Just check out whichever video
is popping up on the screen now.
But thanks, and I cannot wait to see you in the next video.
Bye.