The RIGHT WAY To Build AI Agents with CrewAI (BONUS: 100% Local)
HTML-код
- Опубликовано: 14 апр 2024
- This is the "golden path" for building AI Agents using CrewAI. If you follow this template, you'll be set up to use all upcoming features with CrewAI, such as an automatically created API for your agents.
Enjoy :)
CrewAI Lightning Studio: lightning.ai/mberman84/studio...
Cloud IDE, Fine-tuning, Inference, Data Management and more!
Try Lightning AI Studio FREE Today: bit.ly/3uBiWO9
Join My Newsletter for Regular AI Updates 👇🏼
www.matthewberman.com/
Need AI Consulting? ✅
forwardfuture.ai/
My Links 🔗
👉🏻 Subscribe: / @matthew_berman
👉🏻 Twitter: / matthewberman
👉🏻 Discord: / discord
👉🏻 Patreon: / matthewberman
Media/Sponsorship Inquiries 📈
bit.ly/44TC45V
Disclosures
I'm an investor in CrewAI - Наука
For some reason some people are saying this is an undisclosed sponsorship video. I clear say at 0:36 that it's sponsored, plus I marked the video as sponsored. I will NEVER make an undisclosed sponsored video.
I mean why some folks would talk about your pointing finger itself while you are pointing to something in the sky?!?!
Why it bothers people that much?!
You like the video, good! You don't like it then just move on!!!
Do they want some margin of the profit or what's the problem here!!! Sound so immature and childish to me!!!
Guys, stop acting like jealous girls and do your work and spent time and effort to earn money!!! STOP envying others!
People❗❗❗ People say the Darnedest things ❗
Lol.. I could care less if it’s sponsored or not as long as it is informative, which it is, and doesn’t have 50 commercials.
Mathew, have you had any luck getting a local model to use tools? If so, what is the setup? If not, why not?
Been pulling my hair out for weeks, and even attempted my own wrapper api. I’ve had some success with the wrapper but it’s not very consistent.
Don't worry about the heaters, just keep bringing the good stuff
Just in 3 minutes and already posts :) greate work as always
I just had a play with lightning AI from this videos recommendation, I do like the lack of dependency problems, I spent an entire evening messing about with python dependencies for a similar project to crew ai on my local pc, I didn't get anywhere lol.
This was straight forward, I also appreciate the pacing and calm approach to these videos.
I would love to see more informative content on lightning AI and crew ai, maybe using a larger crew, using a variety of tools, and a different subject for some variety, writing a code perhaps.
Keep up the great work!
Please make a video about building llm applications from architecture perspective. What are the most popular designs/ architecture. What are the most used tools like langchain, Llamaindex, crew ai, groq, llms
This video matched exactly what I was looking for. But I am blown away at how much boilerplate there is to get all this set up! It seems like CrewAI left a bunch of work for the end user to do even though they built in configs etc.
You can chat with crew ai chat bot powered by gpt to have everything generated 😅
Love the crew ai tutorial, i first saw crew ai on ypur channel and now we are using it at work!
do you use it with tools ? what is the consistency of Agent able to using tool ? to me with ALL local llm it's like to random to be used as a production tool.
Awesome content Matthew. Appreciate the tips on good practices, not a lot of RUclipsrs articulate on best practices and standards. Thank you!
Thanks , its quite useful and structured.❤
Great tutorial! I have been watching your AutoGen series too and now I'm super confused what to pick for my upcoming project. What's your personal favourite? :)
I see a lot of complaints on this thread for a variety of reasons, I dont know why people complained. But I really liked this video.
I've not seen CrewAI before and it was intresting to see how it worked.
I was pleantly surprised to see how quickly a demo app could be built using more than one agent / AI.
I plan to try some of the demos on this site.
Paid or not, I enjoyed this video and found it intresting to look further into. Thankyou for posting it!
👍
Thanks. Please make a vid doing this 100% local without Lightning, as this means that you don't need anything additional and can be altered in the future without Lightning if needed (most likely will do). I don't think ppl want to be tied to Lightning or other similar platforms, despite the "ease of use".
Just an observation, but if your mind isn't automatically translating what he is doing into how you'd do it fully on your own computer with what you already have on it then it won't help and what you'd actually want is to ask him to make you a specific video for every project you want to do; I'm a real estate broker--not a developer--and just watching for the first time I have the same thought as every video--how I would do this on my own GPUs at home without being tied into to any vendor lock -in, but so far there's nothing he's relying on in the Lightning platform that you likely don't already have set up on your home setup that I can see--is there?
Are you interested in developing with A.I. tools or are you just interested in having the leading edge of finished products and don't want to concern yourself with any part of the development process, because there's a much bigger ask of you if you plan to take it later to production, not to mention your particular CI/CD needs that he doesn't even get into but will demand much more critical thinking on your part to make it work in any commercially-viable way.
That said, my own complaint to contribute while we're weeping and gnashing our teeth, would be that I wish they didn't use the mark "Lightning," with such an important role btcln has in increasing BTC adoption, diluting the association in another cutting edge field
the code is all the same. lightning is just a fancy notepad essentially just like vs code is. Run your backend whatever it is you choose to use then set the api points. That's really all you have to do. Some backends are more of a pain than others but so far they all work. koboldcpp is the only one you would end up having issues with.
If you go to his link, you can copy/paste most of his code. The only major difference is the ollama url 11434 which needs to be set to your local machine instead of lighting's version.
@@chrisBruner Thanks, that was so simple!
Except he's shilling for langchain-groq. You'd still have to pay for that.
Fantastic information in here. Thank you for the work you're putting into these videos!
I'm trying to adapt your code to use the default TXTSearchTool, but I don't see how tools are passed to the agent/task. Does it automatically have access to anything in the tools folder?
I ma looking for the same answer.
A great video as always Matt, I did try Lightning AI but it drove me nuts. I'm not keen on cloud IDEs because I travel a lot and they suck on planes and trains that go through lots of tunnels. I did give it a go though but found the UI rather awkward. In the end I just created a new project in PyCharm and it all worked just fine. Give me a GitHub repo any day.
I run on a 96GB M2 Max Mac so rarely need external GPUs, your demo was a great update on CrewAI. I hope they're not going to get too embedded with poetry but I'm very comfortable with the rest of the structure.
Yes I could not get Lightning AI to work at all. It got caught in some login loop where it would not allow me to access the account. Also there were several instances where the UI buttons would not work. I tried both edge and chrome on PC and could not get either to work. Does not seem ready for prime time.
@johntdavies You seem like you are experienced in Python, I don't see where the SECTools were passed to the agents in this structure. Am I missing something?
@@UncleDougy Hi, actually my programming background is C/C++ and Java but I'm getting the hang of Python. Basically I got rid of the src directory, I use that in other languages but it doesn't seem to fit in with most of my Python code. From my base or root directory I have financial_analyst_crew and in there I have the two directories config and tools. It's exactly the same as in the video, I didn't change anything except removing src and moving everything up a level.
Let me know how you get on.
Great video, and very valuable for a beginner as I am. I am not a coder, invested a lot of time in terminal, conda etc. to get crewAI templates run for use cases I have in mind. for me it would be beneficial to understand how to set a run time environment that will scale but help stay organized without the need to master terminal and python environments but to focus on crewaAI and Langchain's offerings. So anything you could share being involved a while either by yourself or by one of your network firends driving towards a 'product' would be intersteding to see. Wish you anyway all the best, I'll keep following your sharings.
What part is 100% Local ?????? It's all in the cloud!
Ollama can work locally so if you are familiar with Python it is not an issue to do the whole thing on your machine.
@@tgzsolt
Is there an ollama tutorial ?
@@tgzsolt i work from home and you don't call me "office worker" just because i can work from office
If you remove lightning, everything works the same.
@@tgzsoltyou should be clear to explain performance is very dependent on your machine specs
Matt what do you think is these opensource stuffs are just for fun playing, or it is feasible to make a product ready app based on? I am wondering how can we test such an LLM based module correctly...
Sponsored or not, I appreciate your content and how it is geared towards devs in the AI space! Thank you
Great video at right time, since the AI agent is a new, we need a simple and smooth start before we go advance and commercial use
Even it paid video I really need something like this thank you so much you read my mind.
Awesome, thanks! I've playing with it to see what it can do. Is there a way to change the language of the output?
Great video! Thanks
Thanks for the video. Where is the financial information coming from? Is it from the mixtral model? The dates seems to be from 2023.
Hello, Thank you for your great explainaitions. I cannot understand how is the sec tools defined ? Does crew ai automatically grabs it from tools folder ? It has not benn specified is angents has it ?
The sec_tools is not working in this code ;)
as you mention, it has not been specified in agent.
Also, the sec_tools require the sec api key (queryApi = QueryApi(api_key=os.environ['SEC_API_API_KEY'])) which is not provided in the environment.
This is alot of overhead that I seemingly can achieve by using the right prompt. Task and agent definitions also seem redundant if it's always 1 for 1.
I'd appreciate some examples that clearly show the advantage of agent crews. Can be more abstract to be quicker.
Please start revealing your prompt than can have your llm turn into multiple agents talking to each other and completing a project. Must have a expensive pc or you dont mind waiting hours for a response. His vids show a easy example not what you can really do with agent frameworks.
I think this is always the case, with proper engineering (prompt and code) you can reach the same results and even be much much more cost effective.
IMHO agents will be really the Thing when it will be part of the LLM architecture internally, same as we start to have LLM's with online browsing,
so you don't need to use that as a tool and do all the parsing / searching etc, as this is already implemented internally.
This is how you automate LLM queries within an application. All the Python work will be undertaken on a remote or web server which returns the results of a parameterised request back to the web page, to be parsed by JS, XSLT etc. This is the basis of Agentic Reasoning or Processing.
how about you actually go read some fundamental papers on neural networks and how they work, and then go google what you're looking for. Because it's pretty obvious to everybody who has tried to understand this and actually taken the time to look up the performance differences that they are much superior to standalone
@@syberkitten1 Like the Three Magi, the Ai system in neon genesis
great video and really like the 'golden path' way, but I am not sure from the code or the video how how tool is connected to the agent. Am I missing something? Trying to rebuild a Crew using lightning and this framework. Any help would be greatly appreciated. I tried to figure it out, but I am missing something and their I can't find documentation on crew AI for this
He didn't implement the tool in the code
Thanks. Was unable to get your earlier VScode tutorial working, but now on Lighning this is working. Good to be on the golden path. How might one output the result to a .txt or .doc (or any other such) file?
Cool, thank you!
00:02 Setting up CrewAI team using Lightning AI
02:03 Setting up AI agents in CrewAI for efficient task management.
03:58 Preparing information for stock performance analysis and financial analysis
06:01 Setting up AI agents for specific tasks
07:59 Creating AI agents with CrewAI and Grock
10:05 Defining agents, tasks, and crew for building AI agents with CrewAI
12:17 Setting up necessary tools for financial analysis with CrewAI
14:09 Setting up a financial analyst crew with CrewAI using Poetry.
16:17 Building AI agents with CrewAI using fine-tuning
18:03 Setting up environment and authentication for AI agents
19:46 Focusing on building AI agents with CrewAI while keeping it 100% local
very interesting video. It went by a little fast but once I finished I realized I could just open the model you created in the description... I did everything in the video and tried changing parameters in yours. I can not seem to get it to work. just getting errors in the terminal. saying Ollamaa call failed with status code 502. Any ideas?
I think it would be best for every cloud-based service; you include a self-hosted option as well.
#facts people want local
Great video and very informative! However once i successfully ran the program on lightningAI i noticed the stock information for TESLA was wrong (outdated), the agent told me the source of info (Yahoo). I changed the company from Tesla to Netflix to see if this data would be inaccurate as well, and sadly it was. However the data pulled on netflix did notify me that the data was from 2021. Is this an issue with GROQ? or is it to do with what tools we’ve included? Thanks once again for the awesome informative video! Thumbs up and a new subscriber here!
Like the how you are building agents in the yaml files, but all the crew AI examples and documentation do not show this. Do you have any documentation somewhere showing the use of yaml files?
Thanks Matt, How you set temperature for each agent in CrewAI?
I am looking at the documentation on github and website and I cannot find any information on how to run this - all I see is the previous version where all the definition is in python. I love the YML definition and the decorators taking care of a lot of the work. Is this not out yet? Any idea when it might be coming, am I missing something?
this is helpful! do you happen to know how to use output_json with this method? i keep getting errors like "Input should be a subclass of BaseModel" no matter how i try to pass it to the task.yaml or inside the @task definitions
how does the data search part work, Im assuming is not part of the model training, yet being pulled from the web?
is there a way to get the code without using LIghtning?
@matthew_berman Thanks for the sick video dude! I finally understand how all the poetry mumbo jumbo works. ran the script successfully, but I'm only grabbing data from circa 2022, is there a way to obtain more current information?
Thanks!
How did the Crew know to use the tool? I don't see anywhere where we set that up, is it just based on the directory structure and nomenclature? Or is it all in Poetry ?
So, we use conda to set up an environment, and poetry to lock the environment? Another layer of abstraction brings code closer to incomprehensible. It's hard to figure out what directory levels various files are in. (getting frustrated with python's environment)
Dude that’s awesome about Lightening. I’m always mobile using the 12.9 iPad Pro with keyboard and pencil. Working on my ERP is a b…. cause I can’t use vscode on this.
Leave some time in the video AFTER you say, “like and subscribe” so we can do it, lol. Right now, you say, ‘like’, then immediately the video ends and another one starts. It’s a ton of trouble to get back to your vid. Great video, btw!
Is there any chance you could show us how to get crewai interrogating local documents. I write a lot of reports and have to find a local solution to compile private local data with data which is available online. I have crewai working with local llm’s but can’t for the life of me get their tools working for me. I can’t find any examples online and find your videos extremely easy to follow. Thanks.
did you give the sec tool to any of the agents?
love thiss!!!
Do you not use venv? it's pretty straight forward so what kind of issues have you been having with your environments?
crewai are going with the poetry and docker model for installs I think, hence Matt using poetry. yes I'm sure you can simply install crewai in a python venv and work from there, but that won't help later on when they start including other dependencies. Which I agree raises a whole nother can of worms
Can you do a comparison to AutoGen?
Also is there any framework like this but in JavaScript?
Javascript will receive the results passed to it from the web server which will have executed the Python code. Think of the agent call as being equivalent to a database query being made by the web server. Instead of calling out to a SQL source, you execute some Python.
@@japethstevens8473 that’s a great way of putting it. It’s an engine you can just call out to. Blockchain’s are kind of the same with polling a block and doing client side tx signing etc
🚀🚀 Matt
Always interesting.
Hi Matthew, can i use llama 3 70b with crewai on lightning as well. Would the costs be high?
I haven’t read the docs on this yet, but it feels like this is taking away from the charm of crew ai, it’s simplicity. What do you think, do you prefer it this way ?
Is this method more cost-effective than simply using an OpenAI API key? Thanks
Hi, do you give any personal pointers on how I can incorporate ai agents to my business, would be great to have some one like you to help people incorporate them
what is the difference between an agent in this case and something like an openai assistant?
I just hope that this type of stuff grows out of just being implemented in python. I don’t hate python especially after they introduced data classes but boy are virtual environments messy. I remember in 2017 in college making a terrific django app only to get caught in one of those big version updates. I was a novice & migration docs weren’t that great then. I migrated anyway. Nothing worked anymore. After that i was like no more python for me 😂. Imagine building something like in the video in code & updating the framework you used to the latest version. Oh and have it running live in your business & poof broken! Really hope i can code up this stuff in like javascript or C#. In rust with a framework would be ideal.
Hey Matthew, what is the reason you use CREW AI and not Autogen Studio?
feels very different from their examples, have they rewrote API-s? Also, I would love to get example with hirercial agents because I had a lot of problems with infinite loops as well as manager agent not getting output from delegated one
Awesome ❤
Great stuff
I'm not quite clear, what unique thing does Lightning Studio do that can't be done in regular python or any free ide?
absolutely valuable video, can't thank you enough Matt
Is crewai stable now? I tried some examples from a month ago but there had been code changes so I have to re-check every time
How the agents know about the tools if you are not passing to them?
Matthew, How can I load my own code into this type of environment?
Sorry which of this your AI can work on back end very will?. Like request,fetch and cache data...I have not found any doing that
most of these frameworks do actually work really well with anything that has an API for requesting/fetching and storing data. they really are "low" code bot frameworks...not really "agents".
I can not tell if I like this more as a yaml or I still prefer importing the classes from other py files hmmm
Great Video.
Unfortunatelly I get an error:
from crewai.project import CrewBase, agent, crew, task
ModuleNotFoundError: No module named 'crewai.project'
Any idea why?
Thanks
I take it crew AI is your favourite agent builder
He said he's an investor.
There's a disclaimer on his profile.
Thanks, ya'll I truly wasn't aware
Just to clarify, I meant the raw crewAI Builder not the LightningAI Studio
Could you do something a bit more complicated? Like write a Snake game, but you have a back and forth as you want to add features or fix bugs?
is it possible to see the code in github or other site?
Nice job! Next, please do an example of a CrewAI that builds new Crews. Then make that Crew builder available to everyone.
Ive worked with crew AI and ive found the tools to be the hardest part do you have any more content on how that works and how to make better tools
Can you please create some agents that will control our PC/laptop using voice commands only in langchain and groq.
I can't believe people are whining that this is a sponsored video. It's great content. No one is forcing you to sign up for anything. Feel free to do the hours or research on how to use the product yourself if you want 😂
you meant to say feel free to google the very easy to find, very public very visible github for near 75% of his videos and follow the instructions he is following to do the tuts himself, and some tweaks and maybe a chk with someone sometime on something broke, but its following, I can link the links for near all of them, and most the other guys, and I love matt, but uh, research is a stretch for this tut and most, #facts most people didn't go do whatever because his title referred to doing it all local, something that is not so easily found, and not so easily have good instructions, and not so easily to tackle if they are new. #facts #notlocaltutorial
@matt can I contact you about an idea I have for government contracting? Thanks.
Share it
this and the beginner video is still way over my non techie head. also, i want to be able to automate my work at my corporate office job with these. i don't create content or work for myself. how would i run a department with agents?😏
This would be awesome if I could actually follow along, but when I signed up for Lighting AI it says I need to wait 2-3 days for verification. Verification of what?
This video is FANTASTIC! I was on the fence about Autogen or CrewAI, I've spent time with both but I have a feeling that Crew is just behind Autogen and it's a waist of time. Now I know, 100% for sure, for me crewAI is a complete waist of time. Stick with Autogen. Thank you for making this 20 minute video and saving HOURS of my life waisted on CrewAI. thank you , thank you.
Did you try agent swarm already?I think it is pretty undervalued agent solution.
@@EngineerAAJI know agent swarm specifies in their documentation exactly where CrewAI falls short, but I haven’t deployed anything beyond the demo for agent swarm. How much have you worked with it?
@@eIicit for my application for now it is early to tell which one will perform better, but I am experimenting with the three solutions to see which one performs better for my specific task, and once I get some more solid information I will let you know
Good stuff! Do you happen to have these code files on Github?
No, but you could download them from the lightning studio, which I published.
I signed up for a Lightning Ai account and it told me to wait 2-3 business days for account verification :(
I assumed this was the issue due to me looking at this vid and signing up for Lightning AI on 5-5-24. That, I don't get. Why include a tool in the process that a new person can't use. Sorry if I'm missing something, wouldn't be my first miss....
You can have replit AI write all the code for you inside the same UI
If you look at the output (though you scrolled quickly through it) the models didn't use the tool provided. The analysis is around Q3 and Q4 of 2022. I followed along letter for letter and while it did work I did not get the expected outcome because of outdated data. I am thinking that the tools need to be added to the task maybe, but that's not clear how I would do that in the .yaml file config. Possibly by just adding the name of the tool in a tool section of the task... Just wanted to point that out.
I wish you did it locally and published the py files so that we don't have to start from scratch. I totally agree installing stuff locally is a pain, I spent 2 days trying to convince arch (well, Manjaro) to install llama-cpp, in the end, I copied the installation from conda, which was successful but langflow wouldn't find it. So cloud is nice, but also, you sacrifice your privacy and some money. So I like local much more.
Did anyone get this to work with the sec tools?
When will CrewAI be open for new acounts?😊
can you give an agent access to a RAG?
Github repo for the code?
Can anyone tell me how to set the token limit?
Hmm...Open in Studio button does nothing. Then when I try to view the .toml file it says unsupported file type. Is Lightning really baked?
Hey guys! I'm immersed in the study of AI agents and I'm curious: would it be viable to build an agent that prospects customers for freelance professionals? I envision a system capable of exploring Instagram in an automated way, identifying potential customers and even starting conversations to schedule sales meetings. Is it possible to develop such AI agents? If so, do you know of any videos on RUclips or any mentors that explain how to create AI agents to automatically prospect customers through Instagram? Is there something like this in development or is this an idea for the future of AI?"
heres a video for you to make dude, i just put this video in gemini and asked it for the code and it did it, im on the free version of gemini, fk paying for ai :D
Impressive!
People are underestimating the degree to which this kind of synergy is going to change things.
Outstanding
Where is it LOCAL? Seems to happen on the cloud all the time no?
🏆 Well done!
I saw a video (Don't know if URLs are allowed so you'll have to look it up) by VRSEN who developed his own framework and mentioned limitations of AutoGen & CrewAI in in terms of agents being unable to collaborate. He explained it had to due with a linear and hierarchical communication structure, restricting interactions between agents. Have you noticed this and do you consider it a limitation?
I tried to set up a crew using this method; it runs and gives all the outputs but seems to completely ignore the tools and hallucinate all the data. I built my own tool and tested it outside of the crew with no issues. Do you have any advice on this, or is it just a limitation of CrewAI at the moment?
If it hallucinates, is there a point to learn this
Because if I wanted crazy I'll just stick with character ai
I have a 3090 and I can run Mixtral fine locally. However, I've had very bad results with CrewAI and tools like SerperDev and BraveSearch to name only those. It's like the model does not understand how to properly call the tools. It's like a roll of a dice. Sometimes it works, but most of the times it just times out without doing anything useful. I wish you would make a full demo of CrewAI with OS models + tool usage.
It's a bit of a crapshoot when running locally. sometimes it just works and other times the model hates you and wants to punish you for some unknown deed. Try rewording your agents and tasks and see if it helps.
He wishes he could too...and so do I... ;) #facts #morefacts
Can this be done in Colab? Lightening looks fine tho.
Can you do a video where instead of one agent working on one task to multiple agents working on one task
nice tut but not sure about lighting studio, don't even work for me, lots of console errors, but anyway thanks for the great tut
This seems like 80% local! I'm between jobs and want to play around with AI locally at this time I'm not interested in using any cloud service or anything that might cost money. I do have several a few gaming PC and an old R730 server w Nvidia P40 to play around with and don't mind waiting if it takes some time.