AUTOGEN STUDIO : The Complete GUIDE (Build AI AGENTS in minutes)

1717289095_maxresdefault.jpg

AUTOGEN Studio: The Complete Guide to Building AI Agents in Minutes

In the rapidly evolving landscape of artificial intelligence, the need for smart and efficient tools to build AI agents has become paramount. With the latest developments in AI, companies and developers are keenly seeking robust platforms to craft their intelligent systems seamlessly. AUTOGEN Studio emerges as a standout solution, providing an intuitive environment to create and manage AI agents with unprecedented ease. This article will delve deep into AUTOGENT Studio, examining its fundamentals, installation process, and a practical use case to highlight its capabilities.

What is AUTOGEN Studio?

AUTOGEN Studio is a powerful AI development tool introduced by Microsoft, renowned for its ability to facilitate the quick creation of AI agents. It integrates various AI models, including popular ones like GPT-4, into a streamlined workflow allowing developers to automate tasks, process data, and enhance decision-making processes within minutes. Its user-friendly interface and comprehensive feature set make it an ideal choice for both beginners and experienced developers.

Understanding the Building Blocks of AUTOGLUE

Before diving into the technicalities of AUTOGEN Studio, it’s crucial to grasp the core components that constitute an AI agent in this environment:

Skills and Models

At the heart of AUTOGEN are ‘Skills’ and ‘Models’. Skills refer to specific functions designed to execute particular tasks. For example, a skill might take an image creation prompt and save the generated image. On the other hand, models are the AI algorithms pre-trained to handle complex queries, like the aforementioned GPT-4, facilitating a broad range of cognitive functions from text generation to data analysis.

Agents and Workflows

Agents are where skills and models synergize. They can intake an input, process it using the defined skills and models, and produce an output. These agents are then orchestrated through ‘Workflows’, which define how agents interact, communicate, and yield results. This setup is pivotal in creating sophisticated AI behaviors that can simulate real-world interactions and automate complex sequences of tasks.

How to Install and Get Started with AUTOGEN Studio

Setting up AUTOGEN Studio is straightforward. Begin by creating a new project environment:

  1. Environment Setup: Use Python to create a virtual environment ensuring all dependencies are managed without conflict.

  2. Installation: Install AUTOGEN Studio via pip and configure it by integrating your API keys from AI models, ensuring secure and personalized access.

3pNext, launch the AUTOGEN Studio UI. This graphical interface is where you’ll spend most of your time designing and managing AI agents.

Real-World Use Case: Streamlining Business Processes

To illustrate AUTOGEN Studio’s practical applications, consider a business process automation scenario involving customer invoice processing and response.

Step-by-Step Process:

  1. Read the Invoice: Develop a skill to read invoice data from a file, extracting necessary details using optical character recognition (OCR) technology.

  2. Generate Custom Responses: Use a GPT-4 model to craft personalized emails based on the invoice data, enhancing customer engagement by referencing specific purchase details.

  3. Define the Workflow: Set up a workflow where the ‘Read Invoice’ agent feeds data to the ‘Generate Custom Responses’ agent, streamlining interactions and data flow between tasks.

Benefits for Businesses

Deploying such a system can drastically reduce the manual effort required in customer service tasks, ensure accuracy in data handling, and personalize communication, thereby enhancing customer satisfaction and retention.

Conclusion

AUTOGEN Studio stands out as a revolutionary tool in AI development, significantly simplifying the process of creating and managing AI agents. From setting up basic operations to integrating complex models and designing intricate workflows, AUTOGEN Studio equips users with all the necessary tools to build sophisticated AI solutions efficiently. Whether you’re a seasoned developer or just starting, AUTOGEN Studio promises to elevate your AI projects to new heights.

By harnessing the power of AUTOGEN Studio, businesses and developers can unlock immense potential in AI applications, driving innovation and efficiency across various operations. Start exploring AUTOGEN Studio today and transform your ideas into reality with just a few clicks.

[h3]Watch this video for the full details:[/h3]


The full guide to get started with Autogen Studio, Create Powerful AI Agents in a couple of minutes with real life projects.

________ ???? Links ???? ________

https://lmstudio.ai/

???? Discord: https://discord.gg/jUe948xsv4
???? ????????????????????????????????: https://www.linkedin.com/in/reda-marzouk-rpa/
???? ????????????????????????????????????: https://www.instagram.com/redamarzouk.rpa/
???? ????????????????????????????: https://www.youtube.com/@redamarzouk/videos

https://www.automation-campus.com/

________ ???? Content???? ________

00:00 Introduction to Agentic Workflows
00:30 Understanding the Core Components of AI Agents
02:01 Exploring Conversational Patterns in Workflows
03:58 Setting Up Autogen Studio for a Real-World Use Case
04:20 Installing Autogen Studio and Setting API Key
05:07 Launching Autogen Studio and Outlining the Use Case
06:04 Developing the Use Case: Reading an Invoice
08:06 Defining Skills and Models in Autogen Studio
10:02 Creating Agents and Workflow in Autogen Studio
12:16 Error occurred while processing message: api_key is not present in llm_config or OPENAI_API_KEY
15:55 Final Demonstration of the Workflow in Action
18:19 Conclusion

[h3]Transcript[/h3]
all right guys so everyone seems to be bullish about agents and for a good reason here we can see Dr Andrew a who is one of the most recognizable faces in AI showing how even GPT 3.5 can outperform GPT 4 once used inside of an agentic workflow and one of the best implementations of these agents has been through autogen Studio which is a tool that has been introduced by Microsoft but today is widely viewed as one of the best tools out there to create agents so today we are going to see three things the first one is the building blocks of agents and please do not skip this part because it’s going to be very important now only for this video but for future videos where we’re going to use other tools to create agents the second part is going to see how we can install and start working with autogen and the third part is going to be a real word use case where we are going to see how to create these agents and bring them to life so with that being said let’s start with the first part so in autog Jan Studio there are four main components that we have to understand the first one is skills and skills are basically functions in our example it’s going to be python functions that you basically give an input to and then you expect a certain output for example you can give it a certain prompt to create an image and then you can expect that image to be saved on your machine as an output the second component are models and they are the basically the models that we are already familiar with either GPT 4 or clae son or mol 7B etc etc the third and most important components are agents and agent agents basically contains skills and models inside of them plus other things that we’re going to talk about later on but mainly skills and models and they can take an input and then use a combination of the skills and the models in order to give you an output and these agents basically make the unit that we will use inside of the fourth component which is our workflows and here there is something that is very important that we should understand which is how are these workflows are going to be structured in other words how are these agents are going to talk to each other in order to give us an answer and this is what we call conversational behaviors the most fundamental conversation pattern is the two agent chat which is basically when we have two agents talking to each other this has been Illustrated in the documentation literally by showing two agent telling jokes to each other the second conversation pattern is the sequential chat which is basically when we have multiple sequence of two agents talking to each other and then every discussion that we had with two agents is going to carry over the information into the next two agent chat and this is great for tasks that can be broken into clear subtasks that we can solve with every conversation between two agents the third and probably the most important conversation pattern is the group chat which is a more complex than just two agents or sequential chats it involves multiple agents contributing to a single conversation thread think of it much like a werewolf game where you have a group moderator or an orchestrator basically is the one that’s going to tell the people when to wake up and went to sleep and is going to steer the conversations using different strategies that we are going to see later on but this group chat manager is going to be the one to choose who’s going to speak next so going back to autogen this group chat manager is going to choose which agent is going to be the next to speak and how to carry over this information into the next agent in order for that next agent to perform the actions that it needs to perform and the last type of conversational patterns which is not really a different type is a nested chat is where we have a combination between all of these conversation patterns so I understand this is getting a bit theoretical but understanding there are conversation patterns is going to help us tremendously in order to know what example we are going to use later on so enough Theory and let’s jump to my screen and start using autogen Studio all right finally we can open vs studio and start working on our use case so the first thing we are going to do is that we are going to create a new folder we we want to keep everything clean so let’s create a new folder and let’s call it autogen demo and then we are going to open that folder from here let’s select the folder and then the first thing that we are going to do is to create a new file let’s call it app.py we are going to see why later on we are going to open the terminal from here and then we are going to create a new virtual environment we’re going to do that by typing python DM virtual environment do virtual environment now that our virtual environments have been created we are going to navigate to it we’re going to do that by typing VNV SL scripts SL activate and now we are going to install origin Studio p install autogen studio and then it’s going to start installing and it has finished very good let’s clear this now before launching aogen Studio there’s something very important that we should do we should basically use this command with our API key of course that we are going to get from open.com API and then inside of API Keys you can just generate a new API key and then you can copy that API key and paste it inside of here and we need to basically set that API key inside of our environment because that will be very important later on so let’s do this and now we have this API key that has been set inside of our environment okay so now let’s launch uh origin studio and to do this we need the command aogen Studio UI and of course we have autogen Studio that has been launched successfully so the use case that we are going to work on it’s not going to be the generic use case where we plot charts of Apple stock or two agents selling jokes to each other it’s going to be a real life use case that we can actually use it for businesses and that hopefully can inspire you of seeing the potential of the projects that we can create with autogen studio so let’s go back to my screen so our use case will involve reading an invoice through a scill and then from there we want our agents to basically know the relevant information in order to send a customized email to the customer not only saying thank you for your purchase but also making comments about the purchase itself for example here the customer have bought a PS5 plus other accessories so we want our email to be about gaming and wishing the customer a good gaming experience with the setup that he has just bought so this way the business that will use this agent will have a better chance of keeping the brand in the minds of the customer because the customer is not only going to receive a generative email that has nothing to do with the topic it will receive a customized email according to their own purchase so this is basically the use case read the invoice keep the relevant data and create an email customized to that person after they purchase the items now let’s go back and start working so the first thing that we we are going to Define are the skills so the skill that we want to Define is going to be reading the invoice so read invoice and inside of here we are going to put this function and this function basically what it does is that it reads the invoice so we are going to give it a path I know we have a hardcoded path but you can change this according to your own needs after that we are going to use the Fitz library in order to read the PDF and then we are going to concatenate that PDF into a text that we will then print so that is basically the read invoice scale that we have just created now we’re going to go to models and inside of models we are going to go to GPT 4 1106 to define the API key so the API key we already have it here we basically going to get this API key of course I’m going to revoke it later and then we are going to paste it in here and then we can click on test model just to make sure that the model is working correctly let’s save this now we’re going to go to agents and here we are going to create our agents so we want to have two agents one to read the invoice and the second one to write the email so we’re going to start by creating a new agent and we are going to name it read invoice and inside of here of the agent description we will just say read PDF invoice and print its content and inside the system we don’t have to Define anything because this is a straightforward agent and of course for the skill we are going to add the skill that we have just created which is read invoice let’s click on okay and now we are going to create a new agent which is write email and here I’ve already defined so for the description we’ll write customized email and then for the system I have defined a specific uh system message so you’re helpful assistant that will write customized email Your Role is to generate customized email content based on the purchase data that you will receive so that’s basically the system message that we are going to pass after that we’re not going to add any scale we are going to keep the model as G pt4 and then we’re going to click on okay now we have both our agents and we’re going to go to workflow where we are going to create the workflow which is the thank you for your purchase workflow so here we’re going to click on the three dots and we are going to select group chat inside of group chat we will Define the workflow name which is customer email and the workflow description will be thank you for for your purchase so we’re going to keep the summary method as last to get always the last message from every agent and inside of the receiver we will select this and then we will of course delete the primary and add the agents that we have so the first agent that we are going to use is write em uh sorry the first agent that we are going to add is going to be read invoice the second one is going to be WR email and the third one is going to be user proxy user proxy is very important because it’s going to be the agent responsible for executing the code later on we are going to keep the group chat name as group chat assistant we’re going to keep this at8 and then we are going to keep the human input at never and then uh we don’t need to uh touch the other configurations let’s click on okay that is basically it now we will be able to click on okay and we have our workflow that we have just created and we can go now to playground in order to start our first session so here let’s create a new session and let’s click on let’s choose customer email and then let’s click on Create and here I can ask it let’s say read the invoice using read invoice agent and then write a customized email for the customer using WR email agent so as you can can see here I’m defining the agent that it should use because there is no other mechanism that will force it to use a specific agent so we don’t have a drop- down menu or anything this is why I’m telling it exactly what agents it should use in order to achieve each goal okay so now let’s click on send message and here we have the error error occurred processing message Api key is not present or API key environments variable is not set basically so as you can see even I have used the command set open AI key to this value which is our open key even though I have done that it still haven’t been able to add openi key to its llm config in order to uh use it later on so this is a big problem and a lot of people think that because you added the uh API key to the model you should be just fine that is not the case you actually have to add it manually sometimes and it took me some time to actually figure it out so here what we will do is that we will add a new file sorry not here we will add a new file here do EnV let’s go back here and let’s stop autogen let’s clear the terminal and here what we will do first is that we are going to put open API key inside of the EnV and then the second thing we are going to do is PIP install python. EnV inside of here and then from there we are going to run this little code inside of app.py and this is why we have created it so let’s run let’s run it now and let’s see if we go back here to play ground if it’s going to work or not okay of course I have stopped the server so let’s run autogen Studio UI it’s going to recreate it relaunch it and now we can go back here and copy this and then paste it and we still have the same problem okay so if this problem persists we actually have to do a kind of advanced manipulation which is going to be which is going to be what I’m going to show you right now okay in this case what we are going to do if this does not work for you we have another way that we can solve this problem which is control shift p if you are on Linux or Windows or command shift p if you are on uh on Mac and what we are going to do is that we will look for preferences open workspace settings so look for preferences open open workspace settings click here and then from there look for terminal do integrated. environment if you are on Linux choose this one and if you are on Windows choose this one and then click on edit Json and then we should add our API key in here so what we are going to do is that you are going to go up and then we are going to add our API key in here and of course this should be inside quotes and this is the right sentence good okay now let’s basically close this terminal let’s scale this terminal and let’s open a new one and now let’s navigate to. VNV to our virtual environments and now let’s run autogen again okay so this is our autogen studio and let’s run the query again and see what’s going to happen and finally it is working so before seeing the answer I just wanted to quickly show you what is the output of the skill in order to have an idea what will be passed into the next agent from which it can create the email so here I have my scill and as you can see here I have a problem with fits because it’s not installed so here I can just pip install fits so now if we run our script we can see that in the output we will get basically the data that we have inside of our invoice and that is basically what’s going to be passed to WR email so let’s go back and let’s clear this all right right so let’s run autogen studio now okay and let’s create a new chat and let’s copy what we have just asked here let’s see what’s going to do right now of course he has started let’s go back and see what’s going on in the back end so here I we have user proxy that have basically sent to group assistant the demand that we have asked here it will say that I will start by reading invoice and then I will go ahead and basically use the right email so it knew how to organize and with which agent it should start okay so here we can see that it has basically sent back the code that we have here to user proxy in order for it to be able to execute the code user proxy have successfully executed the code and here we can see the output and then this output will be passed to WR email and then it will basically write our email that we have here and if we go back here we can see that the agents only took five messages and 28 seconds to basically write the PDF and give us our answer that we have here so let’s see how good the answer is so thank you for your PlayStation 5 purchase I hope this me message finds you well we are thrilled chosen that you have chosen our brand 5 person selection of the PS5 along with dual wir list etc etc etc is a testament to your commitment to Quality and immersive gaming experience so this is the type of customization that we can have because if you let’s say if someone has a big shop and a lot of people are buying so many stuff online you can basically customize this according to the items that the person have purchased we understand that the word of gaming is not just about play but about creating un figurable moments experiences with your new setup we’re confident that you not only enhance your photography business at extra frame it have understood that it has actually a a photography business and it has made the link uh but also enjoy countless hours of entertainment your business is greatly appreciated and we want to ensure that your experience da d as a token ourr to complimentary oneyear membership okay so okay I think it went so far so our exclusive Gaming Community where you can connect with fellow Enthusiast and say up to date with okay so so it did not promise any type of coupon or some kind of discount I thought it did so but it stayed in line and it did not hallucinate so that’s very good and as you can see the email will be 100% customizable and unique to every customer and to every invoice so yeah we have been able to create a real life use case where we have streamlined the thank you for your purchase process so thank you guys for watching if you like this video drop a like And subscribe it’s really appreciate it and let me know if you want me to do other use cases or to work on other tools like crew AI or other agentic workflow tools thank you for watching all the way through and I will catch you guys next time peace