📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Así conecté VoltAgent + RAG y nació mi propio copiloto de inteligencia real 🤯

Leifer Mendez18:19

Transcription

Today I come to talk to you about W agent, a new framework in Typecreen to create agents. A marvel. Why? Because when you install it and start it with a command, which you will see later, you have this panel, look, connected to localhost 3141, which serves as an observability panel. You can even test things here, enable memory, see all the agents, see basically all the logs. Here we can test, we can write, we can send, and everything is connected here, fast, simple. The best thing about all this is that we will have a server to test it on. We are going to test it here on Cloudws. Why are we going to test it there? Because on Clockwes we have a $15 promo with my coupon below. So simply use the coupon using the $15 to test everything you are going to learn today. So there are no excuses. Down in the timeline you will find all the material at each second. How to execute the command, how to connect with the Kudram database, how to connect with the observability system. This and much more throughout this video. Let's look at the resources we need. So to the browser, first of all, we need to understand the framework that we are going to use, the framework of the agents. We are going to be using Ball Agen. It is a recent framework, in quotes, it is about 10 months old. I saw it six months ago, but the truth is I hadn't put it into action and it's crazy. It's very easy to do. You'll see how with three commands you have everything set up, even with fewer. But well, to explain a bit more, Bol Agent can connect with multiple nodes, with multiple agents. What's interesting about it is that it has both the orchestration part of the deployment, the framework itself, and on the other hand, it has the observability system, so it's spectacular. Once we understand the framework we are going to be using, well, if you are more of a developer, you can go to the GitHot section. Here you can see that this agent doesn't stop working. 15 hours ago they were making updates, so you can stay on top of it here. Remember that if you like this content, the best thing is to leave me a comment to know if you like it, because it's the only way I have to truly understand, to be able to read you. So let's continue. Well, the other thing we need is cuun, okay? So, CDRAN, what isran? It's a vector database, also open source. Surely many of you know it. It can be installed on a server via Docker or we can use its cloud infrastructure, which in this case we will do because it's so simple, it's a click, literally it's a click. So, enter, log in or register through Gmail. The first thing that will appear is how to name it, it says cluster name, give the cluster a name. I named it my wrap. And when you give it that name, it literally takes you to this screen where you have to get two pieces of data. The first piece of data is the endpoint. This data that we have here you will copy and take to a txt, a notepad. And the second piece of data you will need is an API key. I have already generated several, so I will be deleting them because I am doing tests and we will generate one from scratch now. Well, so look, we generate an API Key, we click create and there we have this API key. Remember to save it, don't reveal it. I reveal it because this is a tutorial. And with these two resources, Bol Agent and Cudran, we are going to go to the code part, what we like. For this, we go to the terminal, as things are done. Well, so here in the terminal we are going to go to a project. Look, I even had a project open here, I'm even going to delete it and we'll start from scratch. So over here we give it, and the command you need is this command: npm create agentad@letes-cio example with cudran. The command will be here below in the description so you don't waste time. You press enter to this command and what it does is literally download a Ball Agent template that is prepared to connect with Cudron in one command. And look how long this took. It's really absurd how quickly it can be done. Then we simply enter the folder, then we install the dependencies. I execute it with PNPM install or you can do it with npm install. It doesn't matter. That package manager. Depending on your internet connection, this might take minutes, very rarely it will take hours or it will take seconds, as in my case, 11 seconds. Once we have this, we will open the code in cursor or in Visual Studio Code. I use Cursor. Once Cursor opens, we will see the code. What do we have? Look, without thinking, step number one, locate the environment files. We observe that there is a file called punnv.pun.example. That means it's an example. These types of files, very simple, command C, command V, we duplicate them and to the new one we change the name and leave it as .NV. So, what did we do? We copied, pasted, the file was duplicated and we changed the name so that it ends with .nv .environment. Now, within this file, what interests us are three things that we have already mentioned all of them, right? What three things do we need? Well, look at this here. One. Number one, we need the Open AI API, which we will look for. We need the URL or the Endpoint of CUDRAN and the API Key of Cudran. We already have those two, so we are going to copy them. So, where are we going to go? To the browser where we have them. We have the CDRAN API Key here. We paste it here and then we will copy what the endpoint is. What is the endpoint? This one we have here, look. Right-click on the button and we copy it. Where are we going to paste it? Here. We delete this, we paste this. Cudran configured. Done. Now let's go for Open AI. What are we going to do in Open AI? We are going to look for platform. Openai. And within platform. Openai we are going to go to the dashboard section and in the dashboard section we will go to the API keys section. Here you will find all your API keys. I have a test one. I am going to delete it. I will create a new one. I will write delete so I don't forget. We click create and this key, save it, don't reveal it. I reveal it because this is a tutorial and I will delete it. And once we have this, we replace it here. Perfect. These are the three pieces of data you need. Done? How do we start this? Look, new terminal and we are going to execute a command called npm ROM dep. When this command is executed, observe what happens. It tells us exactly Ball aging with Kudran is running. Done, it's already working. And you even have two types of agents. It has created two agents for us. An assistant with the data retrieval system, basically that talks to our data. And the other is an assistant with tools. The LLM decides when to search or when to implement or execute those other tools. Well, so we already have two agents. What's interesting here, look down here, right? We have the main endpoint of the HTTP Server, of the server that will offer us all these routes or all these functionalities. And on the other hand, we have the Swagger UI. What the heck is the Swagger UI? Well, look, if we copy this, we go to the browser and copy exactly this, it will show us documentation of the B agent API. All of this has been created with one command. We have endpoints for workflows, for login down here to see the logs and everything related to the system or generation with the agents. Another thing we also have here is an endpoint to test. And look, we can test and we observe that two agents have been created for us. The agent IDs, what are they? This is very important. The agent IDs, let's remove some Z here. The agent IDs are this is the name ID Assistant with Retriever. This is one of the assistant IDs. Even if you take this like this, copy it and go to the other endpoint we have down here, like for example this agent one, because we have string for these types of chats that send data in chunks to generate a text response or simply to chat. So, in the chat one, we put test, we paste the agent ID which is the name, and down here we could even, look at everything that can be done, right? Pass things. I'm going to tell it, let's test it, let's tell it, let's tell it what is bent and we'll execute it. It's executing the request and it gives us the response here. Bard is a framework of the script type designed to build artificial intelligence agents, blah blah blah blah, right? So it has generated the entire stream in chat mode, which is the mode that can contain history. Done? Now, another interesting thing is that if we go to the terminal, we will find this other URL. And this is incredible because if we copy it, we go to the browser, we paste it again, it opens this. And what is this? This is the observability system. Here we see the two agents that have been generated, which is the same as what we saw through the endpoint. And we also see all the different functions, memory traces, MSP, agent servers, so many things to test here. You can even come here and say you want to test this one, a whole workflow appears here. You can say test agent. Here you can ask the same question that we have asked through the endpoint. We can say what is ball agent. And once we click send and observe here how it is giving us a response. This response comes from your server, from what we have running on your machine. Well, once you have understood or comprehended this framework a bit, which is very agile and gives you a whole ecosystem to work very comfortably, let's go to the third resource we need, which of course is Clowways. Clowways is our sponsor for this video and most importantly, it provides us with its infrastructure to test, to do things, to bring all this content. Well, so let's talk a bit about clowways. Let's see, interesting and important for deploying this project. I have a video that I have below in the description and it will appear up here that explains how to install Node, how to deploy and configure the Clowways server so that it works perfectly. Today, what we are going to do is reuse that same server to deploy this rock system. And look, we're going to do it in minutes. You've already seen how long it took us. We execute a command, we take the environment variables, we copy the environment variables, we execute locally and everything worked perfectly. Now we are going to do that on the server. If you have any situation, any doubt, just enter the chat. I have several chats here and they attend you in minutes. The truth is, I liked that a lot. On the other hand, we have servers and applications, right? So application already creates the whole ecosystem with a server so you can manage users, databases, file access, etc., right? We are going to go to the my servers section because I already have a server here. Perfect. If you want to create one, it's as simple as coming here, selecting, for example, the language or technology and here you can use, put the names here and use the machine provider, the infrastructure provider that you want to orchestrate, right? Digital Ocean, Amazon Web Service, Google Cloud Platform and select all the data, the resources themselves. I already did this step in the previous video, so it's down in the description, but I have my server running. Double click, we enter. Where am I going to go? Well, look, I'm going to go to the master credentials section because we need three things: username, IP, and password. And we have the IP here, the username, and of course the password which is down here. So, what are we going to do? We are going to look for the command to connect to this wonderful server. The command is SSH master, which is all our username, then comes the @, then comes the IP, we execute enter and it asks for the password. What is the password? The one we have here. Click, we copy, we come here, command V, we paste, enter, we enter the server. Once we are inside the server, well, look, we have already ensured that we have Node installed, because I taught you that in the video that is below. And we also have Git, which is also installed, so this makes our path much easier. I have uploaded the Ball Agent repository to my GitHub. Which one is it? Well, look, very simple. We are going to go to access the application within the Clowways panel, we are going to go to where, to my my application, to my applications. We will find this application and we will go to the access details section and we have a URL here. If we click on it, this page opens that says e B agent API running. That means your project is running correctly. Now, if you want to go a bit further, well, look what we are going to do. We are going to say, "Hey, I want to see the UI." There we are seeing the UI, but directly from the deployed project which is here within clowwaysapps.com. Now, how can we interact? Well, look, let's do this test. Remember to generate that .environment file. How are you going to do it? Well, look, we're going to do it with nano.nv. When you press enter, this appears. What are you going to copy there? Well, guess what you're going to copy. You're going to copy what you have in your in what you have in your environment. Select, right-click, we copy and command V, we paste. Then, once we copy this, we are going to say control o, control x to save and then to close. We are going to execute npm round dep. And what should we see? We should see exactly the same behavior as what we have on our local machine, but now we are executing it on Crowways servers. Remember that thanks to Clockways this video is reaching you because they provide us with all this type of infrastructure. Okay, once we are sure that this works correctly, now we are going to do something. We are going to stop the execution. Once we stop the execution, we will proceed to compile the project. We do that with the command npm run build, compile so that all that type screen code is now transformed into JavaScript code that will exist in a folder called dist for distribution. At this precise moment we can do npm run start and we will get the same result, but the only difference is that now it is executing from index.javascript. Once this is quite clear, then, what should we do? What we are going to do, execute is npm PM2 start disinde index.javascript. This will start your project, but in a background execution, which is how Node projects stay alive in production. And once you execute enter, your project will be running and in online status. If I want to see the logs of this project, we will type PM2 locks and there we see that our project is already running using the compiled code and through PM2. Look, we even write condan C and the application is still alive. How do we access said application? Because it's already deployed. To access the application within the Clowways panel, we are going to go to where? To my my application, to my applications. We will find this application and we will go to the access details section and we have a URL here. If we click on it, this page opens that says, "Hey, bent running." That means your project is running correctly. Now, if you want to go a bit further, well, look what we are going to do. We are going to say, "Hey, I want to see the UI." There we are seeing the UI, but directly from the deployed project which is here within clowwaysapps.com. Now, how can we interact? Well, look, let's do this test. To test, we go to Postman or a similar tool, we put the URL, we click execute and we observe that we have exactly the same results. We already have our application running and I will show you something else. How can this be seen within an SDK? And how can this implementation of a board agent service be seen within a landing page? I took a template and created an interface with artificial intelligence in which it is a typical chat bubble and I will ask it what is World agent and we see there that it is writing to me and board agent is a framework of the Type script designed to build artificial intelligence agents and well, to be able to concatenate them with many more services. In this way, we have implemented a whole agent on a Clowways server, on a server that you control, that you have deployed, that you have configured through your App Keys, all in just a few minutes. Remember that if you like this type of content, let me know in the comments below, write, give it a like because it's the only way I have to know. See you in a next tutorial. See you next time. Co?