CrewAI is Better than AutoGEN ?? Use with Ollama Openhermes !

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys in this video we are going to look at crew AI which is very comparable to autogen but there are some features which makes it Superior to autogen and in this video we are going to run uh the setup run crew Ai and test it for ourselves so this is a Cutting Edge framework for orchestration of role playing autonomous AI agents that can communicate with each other get the job done request the other agent to do some work for them and get the inputs and continue working on the task that they were originally assigned to so why do we want to use the crew AI the power of AI collaboration has too much to offer the crew AI is designed to enable the AI agents to assume roles and know share goals and cooperate in a cohesive manner now to get started it's pretty simple if you look at the code for example we did the installation here then we are setting up the crew crew in terms of uh different agents so uh for setting up a crew what do you need you need some agents you need some processes uh that will guide the crew so if I open this in a new tab so we have these agents here and these agents follow some process to perform some tasks and we can from form the crew with the help of these agents so for example we have an agent known as researcher here we have another agent known as writer here and these are the tasks that the researcher and writer needs to do and this is the crew so the crew consist of Agents we're going to look at the code uh let's jump back to the code so what we did was first do the installation and then we have the screw formation code here so we import from OS and uh we need the open a API key but as we know I'm not going to use this we are going to use a local model from AMA uh which you will see in just a minute but this is your first agent his name is its name is researcher and we start up an instance of agent the role is the researcher goal is to discover new insights backstory you are a worldclass researcher working on a major data science company verbos which means you want to Output to be seen that is true and allow delegation is false so it is not allowed for delegation uh the default is cap is false now this is another agent which is the writer these are the tasks two task that the researcher and writer needs to do so this task is description is investigate the latest AI Trends an agent is equal to researcher next agent is equal to the writer here so you can see the code uh formation the authors have done a pretty good job to code the sequence in a in a more in in a very natural way so we have the agents here two agents here we created the task here and then we are going to create our crew so our crew we start an instance of crew here the agents are two agents task is two task verbos is true which means that we let uh you know which task I've been worked on so you can see the outputs then process is equal to process do sequential so right now only sequential process are being uh coded and if you want to contribute feel free to join and contribute for more other complex task for example uh parallel task then uh you can get your crew to work by just saying crew. kickoff so that's pretty good so we are going to use AMA we are going to use uh open hermas for this now if you have been following my channel you know how how to start up AMA on your local server I am on my Mac so I would go to ol. a and then we are going to click download for OS we download the installation file install that and then we will see that olama is running and you can see that icon on the top it says running now we're just going to open up a terminal sorry going to open up a terminal and uh let me open up a new terminal with profile maybe home R so uh we say oh Lama run open hermas so for the first time you're running this uh the model will be downloaded about 5gb of file and once the model is completed downloading it will start up the instance and you can do whatever the hell you want tell me a joke why don't sign this to us Adams because they make everything okay so this is working open heras is working now we can close this we don't need this uh this was an older one I'm going to close this but we need to make sure that we have W running here now after that we should be getting started uh to do this so what we do is we go to my visual studio code and I select a folder somewhere to work and I Nam the folder as crew AI I'm going to open up a new file known as Main main one. piy so this main file I've been working on earlier but I want to show you fresh in Main one. piy and I want a new Conta environment so let me see the list of environments that I have so what is the code for that uh cond info D- envs so this will give me all the environments cond environments that are existing on my system I want to create a new environment so how do you create we say cond create dasn and the name of the environment now I'm going to call it crew Ai and I'm going to use Python 3.11 this is going to start up the environment name crew Ai and once it is started we are going to activate that so cond activate true AI right I'm just going to clear this okay so I have this fresh um environment crew Ai and here we are going to go back and install this so pip install crew AI so it just going to tell uh in the terminal pip install crew AI in the meantime while this is downloading and installing I'm going to copy the whole code from here and put it here okay so this is installed and I'm going to clear this so we have installed everything now let us look at the code okay so the first line is importing the operating system okay then from crew AI we import agent task crew and process okay so as you have seen this is the first agent the name is researcher its job is to research the next is a writer its job is to write these are the task for my agent so the first task one one is investigate the latest AI Trends and the agent is my researcher up here the next task is the writer block post on AI advancement and the agent is a writer here this is my crew so the crew consists of two agents two task and process so the process is the sequential process for now it's just a sequential process now what we can do is is we want the local language model to be used so for that we need to put in this command so I'm going to copy this from the old code we can remove this open AI key because we don't need that so this is from Len chain we are going to uh import AMA so as a matter of fact we need to install Lang chain as well so P install Lang chain this already satisfied it's done so open AMA open hermas and we're going to start an instance of AMA the model is open Hermos so this will call the model uh open Hermos and we can get started but another code that you need is this we need to pass the the llm model that we going to use so in the researcher uh we're going to use let's say here we're going to pass this llm on the writer as well uh we can pass this and on the crew here here we can uh maybe pass it here so we say llm is equal to AMA open Hermos now this should do it this is going to use the AMA open Hermos from the AMA installation that I have and hopefully this is uh going to work so I'm going to save this and I'm going to start off the sequence so python main one. Pi just start the sequence let's wait for the result okay so the working agent the first is a researcher its task is to investigate the latest AI Trends that's pretty great it is entering U new agent executor chain and uh it has its thought so thought is do I need to use a tool yes action is conduct research on the latest AI Trends then Action Impact that's wait for it now we are going to have uh a thorough uh reading of the outputs but what we can do now is uh I want to introduce you to one of the projects that I'm going to start if you head over to the YouTube channel and go to this first link which is the patreon link once you go to the patreon link uh you would see uh that I have started up uh the patreon just today and what I am planning if you go to the about section here what I am planning um to do in this new year is to build a telegram chatbot and monetize it so building a telegram chatbot and monetize it so I will bring up a video a detailed video on explaining the process of how I am planning to build that chatbot the chatboard will have the capabilities of text you know audio videos images you know rags and whatever the latest developments in the AI that you have come across I'm going to try to build uh an interesting chatbot and if you want to follow on my journey of building a chatbot I'll share the code and everything so there will be a separate uh section or dedicated videos that I will create uh just for patreon and uh if you like this process if you want to follow along and code the entire process the entire telegram board with me I urge you to join the membership of patreon if not you want to make sure you are subscribed to my channel so that you are notified with the latest advancements in the AI space let's move back to the code so this is done so first is entering the new uh agent executor chain do I need to need to use the tool yes which tool conduct research on the latest AI Trends this is the action the action input is this the Finish chain is this part then the other writer the writer starts do I need to use the tool no and this is the finished chain all of these has been possible with just the open source tool and crew AI now I think this should do it if you like this video please hit that thumbs up and uh subscribe to my channel I will see you in the next video where I would explain the telegram bot a bit as you join the membership of patreon have a nice day thank you so much for tuning in I'm back with more interesting videos
Info
Channel: Prompt Engineer
Views: 16,393
Rating: undefined out of 5
Keywords: prompt, ai, llm, localllms, openai, promptengineer, promptengineering
Id: GKr5URJvNDQ
Channel Id: undefined
Length: 12min 34sec (754 seconds)
Published: Sat Dec 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.