CrewAI Tutorial: Complete Crash Course for Beginners
HTML-код
- Опубликовано: 13 май 2024
- 🤖 CrewAI Crash Course Source Code:
brandonhancock.io/crewai-cras...
Don't forget to Like and Subscribe if you're a fan of free source code 😉
📆 Need help with CrewAI, join our free Skool Community:
skool.com/ai-developer-accele...
Ready to lead an AI revolution? Watch and learn how to build your own CrewAI from the ground up, and get set to deploy an army of AI agents at your command. This video is your ultimate guide to creating a powerful digital workforce, enhancing your projects with intelligent automation and streamlined workflows. Discover the secrets to customizing AI agents, setting them on tasks, and managing a smooth operation with CrewAI. It’s time to amplify your tech capabilities, and after this tutorial, you'll be equipped to engineer an AI crew that transforms any complex challenge into a simple task. Start your journey to AI mastery with CrewAI today!
📰 Stay updated with my latest projects and insights:
LinkedIn: / brandon-hancock-ai
Twitter: / bhancock_ai
Resources:
- github.com/joaomdmoura/crewAI...
- github.com/joaomdmoura/crewAI...
- www.crewai.io/
- python-poetry.org/docs/
- pipx.pypa.io/stable/installat...
Timestamps:
00:00:00 Introduction
00:00:55 What is CrewAI
00:01:28 CrewAI Example 1: Stock Analysis
00:02:29 CrewAI Example 2: Trip Planner
00:03:37 CrewAI Example 3: Stock Analysis
00:04:56 How CrewAI Works
00:05:16 Agent Overview
00:06:27 Tool Overview
00:07:57 Task Overview
00:09:36 Process Overview
00:10:14 Tying It All Together
00:11:32 Code Overview
00:12:45 Creating New Project
00:20:33 Creating Agents
00:31:32 Creating Tools
00:39:24 Creating Tasks
00:50:48 Creating Crew Run
01:05:08 Outro - Наука
This is one of the best tutorials I have found. The documentation matches the video and that is rare.
Thanks Brandon! I just subscribed to your channel not necessarily because of the content but for your generosity to share the SC of the project and invitation to schedule a 1 to 1 call for guidance! That's something i didn't yet seen in the space, so thank you for that!
You've gained a new sub! I've watched over 15 videos on CrewAI, this is by far the best! Please keep these long insightful videos on AI tools coming. One quick note: The video quality is pretty low especially when expanding the window, please make sure you upload in a higher quality.
Excellent tutorial! Love how you left the errors in and debugged it on the fly!
Man, I love your videos. thank you very much for your time and effort
Just an awesome tutorial. The way you filtered out the noise and confusion to present just the essentials. Brilliant. The CrewAI team would do well to bring you onboard. If you have time, it would be worthwhile to see a video with CrewAI using local LLMs via Ollama. Ollama now supports the OpenAI API so this should be doable. If you don't have time, not to worry, you have already done a great service for the community. Thank you.
Hello,
Indeed, thanks for the video - really great work! With OpenAI and chatgpt3.5 it worked fine.
However, I couldn't get langchain to use Ollama (openhermes model) in my Python code (today).
Anyone having the same trouble? Anyone being successful?
Thanks a lot. Marc (I'm going for a walk to empty my head, hopefully it all will magically work when I'm back ;-))
------------------------------------- BELOW IS MY EXPERIENCE ----------------------------------------------------------------------------------------------------
I have tried to use the code "from langchain_ollama import ChatOllama", but when I tried the (inevitable) pip install langchain_ollama, I got the following errors:
ERROR: Could not find a version that satisfies the requirement langchain_ollama (from versions: none)
ERROR: No matching distribution found for langchain_ollama
After some reseach it seemed that my version of pypdf was too recent, so I downgraded it, but to no avail.
I have tried all kinds of things, like pip upgrade, clearing the cache (rm -rf ~/.cache/pip which didn't work).
Nor did "pip install --upgrade --force-reinstall langchain_ollama" work.
Now I read the adviceto install the core langchain package instead of the Ollama subpackage: "pip install langchain"
And then initialize the Ollama client directly without using LangChain:
from ollama import Ollama
ollama = Ollama(url="localhost:11434/v1")
But is this a good idea?
This is the part about IT/programming which I ***HATE***.
I like programming, but not all those dependencies on which you have no control, ending up in a guessing game which costs hours of valuable time with ROI=0.
Thanks for tutorial
I like the fast pace, yet detailed approach. I zone out with slow presentations. Fantastic!
This is by far is the best crewai tutorial. Please consider adding to it. Maybe another build or expand on custom tools. Thanks. Subscribed.
Thanks man! I actually have a new CrewAI video coming out this Friday. The updated video is going to cover some of the new features in the major CrewAI update that just happened a few days ago.
I think you'll really like it!
If you only pee twice a day you'd be able to make more videos. @@bhancock_ai
Very good tutorial. Very precise and detailed at the right level. congrats!
Great video Brandon. Thank you so much for taking the time to record it and share it with us. Very happy to subscribe to your channel and join your skool group :-). PS. I live in Thailand so it was great to see you chose it as one of your locations. Brilliant! 🎉🎉🙏🙏
Thanks Colleen! My wife and I do plan to go to Thailand at some point this year so I need to pick your brain on cool places to go at somepoint!
@@bhancock_ai Or just use the AI.
I'm from Thailand, and we would be happy to have you visit :)
I really like this video which really helped me a lot, thank you for that!
Very well explained. A proper Hands-on tutorial in YT.
Brandon, im from brazil, thanks alot for yours videos
Excellent tutorial, thanks a lot Brandon!
Amazing. I am a complete noob having installed pycharm and started learning python three days ago. It took me a lot longer than an hour to watch this video this afternoon, but I have a working project and a working template to accelerate future projects!
That’s awesome knees Jennifer! Glad you got it working!
I have a Skool community with other people getting started on their AI & development journey. Feel free to check it out!
www.skool.com/ai-developer-accelerator/about
Best tutorial to understand AI coding.Thanks!
Dude, thank you so much for this! I know almost nothing of Python so I had some hiccups along the way, but nothing that good ole Stackoverflow and ChatGPT could not solve.
The lesson was amazing, and now I feel able to try my own stuff here.
I just downloaded the crew-ai-crash-course code. I love the comments in the code. Without watching the video, I can tell a lot of thought was put into this video and I look forward to watching it. Thanks for the code and the videos.
Thanks Edward! I'm glad you're really enjoying these CrewAI videos!
When this was made, 'expected output' was an optional Task attribute. I believe it's now a mandatory attribute so include between 'def' and 'return' for each task, i.e. expected_output = (" "). Also include it below agent=agent for each task - expected_output=expecred_output
thx man it's really great video... pls make more videos on CrewAI...
An awesome and complete tutorial. Thank you!
i have so many ideas popped up while watching this, guess i need to write it down somewhere before i forget about it!
That's what I love to hear! Can't wait to see what you make!
amazing. very helpful!!
Thanks @codewithbrandon. Some questions for you:
1 - How can we provide an input variable for a task that has to be figured out first by the previous agent? For example, let's say the first agent will have to search for the URL of the Twitter profile of the CEO of a company named by the user. Then the second agent must use the URL as an input to use a scraper tool, analyze the last 20 tweets and summarize them.
2 - What tools or APIs do you recommend to scrape tweets besides the Twitter API
3 - If I want to get insights on the Instagram feed of a given user, which approach would you suggest? Should I use GPT Vision?
Great Video .Thank you.
Thanks Saran!
amazing video !!!!!! Great job
Great video! Thank You!
plz can you make a video a bout AI Crew for Landing Pages
?
This was an excellent tutorial. Sometimes tutorials end up being overrated, but this one is the first one in a while that I have watched and is relevant and totally necessary. I could not even find a breakdown like this in the crewai docs. The docs is where you get all the info, but when I looked at the docs all I saw were examples. It's good for copy/paste, but it doesn't help when you aren't a software engineer and just want to get an idea of how you can use their framework.
Thank you
Thank you Cire! I really appreciate you saying that! 😀
@@bhancock_ai not a problem!
@@bhancock_aiyou kno what, I did notice one thing and maybe it’s just because I totally forgot to create my __init__.py files, I did have to use package-mode = false in the project.toml file. This was my first time ever using poetry, so I was focused on trying to get to know how it worked then I noticed that none of my packages were recognized and instead of creating the __ini__ files I checked for the setting and sure enough, it was there.
Thank you again!
Damn...sir... you are truly rocking it! Thank you so much for creating this and sharing this.
Highly appreciated!
Thanks man! I really appreciate it!
Loving your video (and other videos as a sub) and coding along with this one. This is the best CrewAI video I have found so keep it up. Have to add, I currently live in Italy and previously lived in Thailand. Haha. Both are amazing countries!!
Thanks Adam! I really appreciate you saying that!
I'm super jealous that you've got to travel to all these awesome places. I do think my wife and I are going to try to go to Thialand at some point this year to view all these awesome places that the CrewAI found for us!
@@bhancock_ai Keep up the good work!! I have been watching coding videos for years and you are really good at teaching. I can tell you put a lot into this video, the production value is mint and the workflow in concise. You're killing it!
You should def go! It is a life changing experience. If you can make it up north to Chiang Mai and then Pai you should do it. It is worth the trip. Take a scotter if you can and have one of the tourist vans take your luggage (Chiang Mai to Pai), that is what I did. Try to avoid burning season though as it can be quite overwhelming. Bangkok is awesome too. Go to The Lying Buddah Temple if you have time. That is my fave temple in BKK.
For the islands try to make it to Koh Lipe. It is far but well worth it. Also Koh phayam (NOT koh phangan the full moon party island) is an amazing island off the beaten path. I could go on and on but these are some of the more DL places to visit!
Coincidentally reading this on my way through and as you are obviously having some funny synchronicity going on hereI decided to recommend to both of either one of you to stay in Contact. For example via Email. I guess Brandon has a RUclips contact Mail-Adress on his Channel Page as most U2bers have for other people to reach out to them. There is more than just the comment section to communicate, which can be overlooked easily, these days. At least that is what they say and they might be right. 😊
Stay blessed`✌️
Great video, keep up the content like this!
Thanks Tony! I have a lot more content just like this coming out soon!
Out of curiosity, what would like to see? Would you like to see more crash courses on these technologies or would you like to see more in depth tutorials with CrewAI?
This is great thank you. I really think it is great you include troubleshooting and corrections as well as the solution. I am a bit confused on one of the parameters. In the first two tasks, the parameter is cities, but in the last task it is passed in as city. Not sure why this did not cause an error
Hmmm. You are right. I'm not sure why it didn't. In the source code I pushed to GitHub, I think I incorporated the fix to the error you called out.
Brilliant thanks
Thank you for this amazing tutorials that can open unlimited options and ideas .Truly ,we are living in a historical time .
Great tutorial, just a couple of things.
It would be great to talk about how the output from an agent would feed the subsequent input to the next chained agent. For example travel_manager -> city_selection_expert -> local_tour_guide.
For your gather_city_info task, you list city as an input variable, however, all you do is feed the 'cities' variable into it. This is supposed to be our chosen city from the previous agent if I'm not mistaken? In your example, you're making the city_selection_agent redundant.
Great tutorial, Brandon. 👍 FYI pipe instal poetry didn't work for me. Used brew install poetry instead.
WOW! Best tutorial ever!!
Thanks Joel! I really appreciate that!
Hey Brandon, Thank you for the course. Could you develop on the Pydantic operation part? I am not as expert as I thought on python and wish you could fill in what's between the brackets with a concrete example?
Thanks for the info.. I’m always curious, if ai and agents are relatively new, how did you learn all of this?
Great tutorial Brandon. I noticed that sometimes the model isn't running the task of creating the 7 day itinerary, and when it does (as in I can see that the task was executed) the final output isn't spitting the 7 day plan that it executed.
I would really like to have tutorials to set up and run open source ai projects like this
Thanks! I had to adjust the GPT model name. other than that it worked!
Really nice video, thanks! I have an suggestion for future video maybe talking about custom tools. I know crewai figure out how to pass parameters to the tool, but I sill struggling in understand when I really need to pass a specific parameter like an id or even an object.
You're in luck! The new video I just released shows you how to build custom tools for you Crew from scratch! Here's a link:
ruclips.net/video/OumQe3zotGU/видео.html
@@bhancock_ai Great! Thanks!!
@codewithbrandon - a very, very solid tutorial. After getting things sorted and working, I am now running into two items:
1> Invalid Format: Missing 'Action:' after 'Thought: This occurs during each phase.
2>
[Local Tour Guide] Task output: Agent stopped due to iteration limit or time limit. This occurs are the end.
I can't find a definition of Action: or Thought:, so I assume those are part of CrewAI. Is the Agent stopped event caused by my using the SERPER free option?
I would update to the latest version of CrewAI and try to use ChatGPT 4 Turbo. I think that will get rid of the issues you are running into
thanks for the video!, ehat is your openIA subscription? The 20 USD month is enought?
Brandon, great tutorial. How can I launch this or something similar on Render for others to try. Is that possible?
Absolutly nice tutorial Thanks :3
But can you provide an alternate way of websearching ? for peeps like me wich cant`t pay for an api ?
Great tutorial :)
love the video, its extremely helpful. but where can i find the links to the cheat sheets?
Hi great tutorials I wanna ask can I create smart contracts using CREW it should be secure and compliant for real world use case and can you do a video suggesting how to create agents.
I downloaded the repo! Works great. Can the Crew be used with local models or LM Studio? That would be a great video.
Great question Michael! You can definitely use a local LLM instead of OpenAI. I'll have to add this to the video queue!
Is there an agent that can automatically create agents as needed? Something like Devin where I can submit a prompt and then let the software create whatever it needs.
I am getting pydantic validation errors when the langchain_core/tools try to parse the tool_input. I wrote some other custom functions and they are not getting picked up by the agents. Should I create a pydantic model?
thanks Brandon, I don't quite see these "templates" you use above in your Git repository - where can I get them please?
Great tutorial!! I was able to follow your instructions and recreate the programs. The program gives me expected results, but I keep getting the following error in the console Field required [type=missing, input_value={'tool_name': 'search the internet'}, input_type=dict]
Great video Brandon. Question to everybody: Anybody run on this error "Poetry could not find a pyproject.toml" when the project is not in the root folder on Mac?
Solved
Thank you for a great tutorial. I tried the code, but the end result is always cut short. I think there is some issue with the code or crewai or my setup? I pulled the original code and ran it, but the same result. For example, it does not display the itinerary in the result.
The one thing I struggle with is asking crewai and do something productive in parallel. Now I’m just actively looking at my terminal and waiting for the results))
😂😂😂 Same!! I'm glad I'm not the only one lol
Thank you sooo much for this!! Would this work with knowledge retrieval files and agents that write product reviews? each agent uses a certain file to generate sections of the product review post. Basically content generation agent for 1 task but referencing different files to generate the output.
No RAG as of now, but you can add the info into agents prompt or a task. Works for me.
It looks like you can use Chroma + CrewAI if you want to start using knowledge retrieval. I'm going to try to make a video on this soon!
Yay more low value scam content
Is there some community website where people share their crew AI projects? I'd love something more advanced as an example to get me started.
pretty cool. i dont believe your crew thought youd preffer the north of thailand vs the islands. id fire them immediately. anyway great vid
What do you think about build solutions based on CrewAi and Autonomous AI´s, and than sell it like a startup? It is consistent?
How do I make the Agents save the final results of task to a specific folder with a specific filename?
can you create an video using the inbuild tools in crew ai . for example CSVSearchTool, RagTool etc
Great video. I'd love it if you could make a modified version where you use LMStudio or ollama instead of the OpenAI API. Granted, the use case would likely be different than your travel example.
Great idea! I've been racking up a huge bill recently with OpenAI recently so I think I'm going to have to start using Ollama soon to cut down on costs.
@@bhancock_aiI've gotten things running with ollama and the gemma set by using the
self.Ollama = Ollama(model="gemma")
Line only in the TravelAgents init. Seems to be working well (make sure that you have pulled gemma ...)
OK. I'm writing a book. Totally new to ai. Haven't listened to the video yet. I will do that this afternoon after work. I have a Busy Schedule. And maybe we can talk.
Thank you for the tutorial! I'm using a Llama3 model, and I'm having a problem at the end of each task; it responds with a . Do you know what the issue might be?
I got it to run. Did the first test planning a trip to Vegas? I put in some details about my interests. The output was very basic, with no specific information. Any suggestions on improving the output? I.E., hotels, shows.
Hey Rick! That's awesome that you got the code up and running.
If it's not giving you the output you want, I'd recommend trying the following:
- Use GPT 4
- Update the instructions to specifically request the information that is missing.
Please let me know if that helps!
in the upcoming events outoput it says the 2022 shareholders meeting is upcoming??
Hi,
I'm using Windows to follow along. I finally managed to get it running.
My problem was with dependencies that couldn't be resolved, if I stayed with the virtual environment created with poetry.
I did so many efforts to get poetry running, I was so happy it did, to have to abandon it at the end, in order to get my code running (I was stuck in some loop of dependencies between crewai-langchain-langsmith).
Also the code "config" to read the OPENAI_API_KEY wouldn't be recognized.
In the end I simply pasted my API key and assigned it directly to the os.environ["OPENAI_API_KEY"].
UGLY, but it works.
I'm afraid that I thought because in my life I programmed in 15 (or so) programming languages, python would be a breeze. And the language itself is fun (it has a lot from ruby and some from elxir and other languages), but those dependencies kill the fun.
Kind regards, Marc
Light theme 😮
Am I supposed to create the first group of agents to create the other group for more specific duties
Great video! Thank You!
Can you help me ? I want to install it into docker, i have an project
Thanks! And, if you need help, feel free to schedule a call with me here: calendly.com/bhancock-ai/software-support-or-freelancing-strategy-call
Brandon Hancock
This Calendly URL is not valid.
@@bhancock_ai
Hi in this video you said going to be Game Builder Crew. Did I missed it? Is it separate video?
Plz make a nextjs app with crewAI
You read my mind! That's exactly what I'm working on building now!
I'll be posting updates over the next few days about the app. I'm hoping to publish the video sometime mid next week!
@@bhancock_ai Will you make it full stack SaaS project with payment? If yes please add usage counting system for each pricing plan and using Lemon Squeezy for payment, because Stripe does not support many countries including mine, thank you alot
How to get the crewai acess? Is it only enterprise subscription? Thanks
Thank you for sharing, have a great day :-)
Thanks man! I also just released another CrewAI tutorial that I'm sure you'll love too:
ruclips.net/video/OumQe3zotGU/видео.html
I plan on watching all of the videos that you created because your presentation is easy to flow with lots of hints to avoid pitfalls thank you :-) @@bhancock_ai
Hello discover the Crew there today. One question, can I only access Dashboard to create my agents with chatgpt 4? Because I can’t and don’t even know where to access and start creating my agents
On a PC, first time using poetry, after several attempts to finally getting "$ poetry install --no-root" to work without complaints, "$ poetry env list" shows nothing.
I just comment the line # pyown = '3.3.0' and it works it seems that something is happen with this dependency. this dependency is need it? can be replace it for another one o avoid this error?
This video is undoubtedly great. I have a question Sir. I want to know what category of AI, This CrewAI belongs to ? Thank so much sir.
This comes under Generative AI or GenAI in short.
Does CrewAI require a GPT4 Plus subscription ($20/mo)? Or does it use the pay-per-use Assistant API pricing? Is it the same with other AI tools (CodiumAi, GPT-Pilot, gptengineer )?
I have many pdfs with handwritten data that I'd like ChatGPT4 (+Vision and/or Ai PDF Plugin) to OCR the data from a table.. then perform calculations and finally edit or append the pdf with the results. Ultimately, I'd like this to be a standalone browser or desktop application that anyone (even non Plus users) can drag and drop a file into.
Can CrewAI help with this? Or do I need Custom GPT / Assistant API?
Hi, when I do poetry install --no-root i get an encoding error. Do you know how to fix this? Thanks.
Can someone pls tell all the dependencies that I would hv to install for this
13:17 ‘git’ is not recognized as an internal or external command operable program or batch file
can u please tell me the vs code addone which suggest the next line of code automatically u already used in video?
I’m using Microsoft’s Copilot! It’s a game changer!
Are we going to get to the point where we can bypass all this code and just share our screen with an agent and tell it what do it.
E.g I’d show it me uploading products to my website and pricing them, then I’d give the agent a new list of products from our supplier and the agent will get to work and upload the products and price them by itself. ?
Hello and best regards from Austria,
I'm sorry if I'm jumping all over you like this, but I have one or two questions and hope you can help me.
I am working on a project for my government agency and unfortunately I have never implemented anything with LLMs and agents. So far I have only worked in "normal" software development and forensics.
It's about connecting several LLMs with different tasks via agents (including a programmer agent, an OSINT agent, a PST file agent, ....). Unfortunately, as already mentioned, I have never worked with CrewAI and I don't know which open source models are best suited for this. Can you please give me a tip on how and with what I can best start? I don't want to take up too much of your precious time, but if you like I can send you more information about the project.
Many thanks and best regards
Hey! The best place to get support for a project like this would be to head over to the Skool community and post a more detailed description of what you're trying to build.
Here's a link to the group
www.skool.com/ai-developer-accelerator/about
How to open terminal? Do i need a server?
@16:35 i got pipx installed, but i get an error whenever i try to use poetry on basically anything
- Installing ffmpy (0.3.2): Failed
Try to manually install ffmpy and it says there is a problem with pip, but running pipx alone, no issues. only with poetry :(
Anyone running into problem with the starter example .py files not picking up the api codes in the .env file?
Would it be efficient for creating marketing crew? I wish to create PPC specialist
I think that would be a great use case for a Crew! If you end up making it, please let me know how it goes!
Outshines other CrewAI Tuts out there!
Please do another long-form with the more advance template:
landing_page_generator
Thank you! in advance!
🤩👏👏
Please add video also with open source llms
need some help setting up the environment - I created a folder - trip_planner_from_scratch - as per your video. Then I installed poetry as follows and checked the version
apple@Apples-MacBook-Air trip_planner_from_scratch % poetry --version
Poetry (version 1.8.2).
Does this. mean that I am doing fine and I can proceed?
yep
Can a Crew Ai agent be trained to perform a task in Excel or look at an Excel file and return information?
That crewAI examples directory is no longer there on his Github.
Virei fã.