Skip to content
Transcript

Transcript · extra07 · You Can Build Your Own AI Agent Without Programming—but You Still Have to Design the Task — ToTheMoon

English machine translation of the Russian-language episode. Timecodes open the source video.

Episode overview
00:00:00–00:00:50What is an AI agent?
Ilnar Shafigullin00:00:00

Hello, everybody! Today, we will talk about the technical implementation of the AI agents. Well, let's just figure out that the AI agent we're gonna call LLM, which has some extra tools. So, besides the text generation, our, uh, AI agent can work with files, like your computer or use various additional tools, call them either on your computer or somewhere on your computer. server. In addition to the direct generation of the text, which is usually done by chat-bots, he will still have some additional action. Most importantly, he will decide when a tool needs to be called. M, this may be different, but we'll talk about MCP protocol from Anthropic. I showed a demonstration in the previous video, and what can be done with that?

00:00:50–00:04:25How does I work?
Ilnar Shafigullin00:00:50

Today, we're actually going to be more into technical details, and it's important that we agree on this on the bank. Oh, we're like ordinary users, most of the time we don't use LLM directly. LLM is that the text is generoding, and you and I are talking to it via either the web interface when you go on the website, uh, your chat-bot you use, no matter what, it might be DeepSeek, it might be ChatGPT, It could be Claude from Anthropic, it could be Gemini from, uh, Google company. There are a lot of different systems, but you don't communicate directly to API, but you're probably talking through some interface. Also, there are apps, respectively, that can be put on your computer. Like the same Claude Desktop I had shown earlier, and he's gonna work with LLM instead of you. And when you write a message in your chat room, LLM-ca answers you, and you see in the tip of the answer only the part LLM-ca noted as a user response. In addition, it can further generode the text, and there's gonna be some, uh, crews, some instructions for this software envelope, right? It might be an app or a web interface. But, uh, we're just gonna be behind the brackets, yeah, that we have the text we see, and there's a text we've got sending, uh, our LLM is here, a software envelope, yes, which we don't show. It works both ways. When you write a message, the message doesn't go in chat bot. This annex, it provides additional technical information that will help LLM to move forward, and, therefore, to carry out its work. We'll talk about it a little more detail. But the most important thing we've got is that we have a software envelope that shows us something, and something doesn't show us. So when we say there's some LLM that support MCP protocol, it means that, first, they're trained, LLM-ki, to use these tools. That's the first. And the other is they're building an extra block that, uh, we're not gonna be alive, are we? We'll only see the answer from the system we need to see. But the software envelopes we're working on, or the website or, there, the dextop apps, they can handle this information further, therefore, to generate some LLM model tools. I asked them to show them now. And here, and, uh, let's just, uh, get this straight, and how we're doing, how LLM finds out, what tools we have to do. She will know, in fact, the following: the software envelope you work with again, I will always say either the website version or, accordingly, the dextop app, it will have to know, and What tools are available, to interview all the available information on these tools and to further with your message, and, uh, an additional information block that says to LLM that if you need to. I'll use it there, such a tool, do it. You have a list of tools. They do things like that, respectively. But to be honest, not only about hearing this, let me show you, but how I connected my MCP servers to Claude and I'll show you, and as LLM, it's not a software shell, but as LLM sees, These tools.

00:04:25–00:04:47How does LLM know about available tools?
Ilnar Shafigullin00:04:25

We have Claude Desktop, an Anthropic app, the same Claude, but in this case we work through a dextop app. He's just making it easier. First, I'll show you I have a few MCP servers. We've been looking at them in detail in the previous video, but today we'll be touching all of this.

00:04:47–00:10:00How do we connect the extra tools in Claude?
Ilnar Shafigullin00:04:47

To connect additional instruments or remove these from the visibility area, we need to move to Claude and in the constructions to choose Edit config. We'll have a special file in the next place. Inside this file, we need to describe, on a specially designed basis, a protocol, a specific template, and what tools for this software envelope will be available. Let me get it open. Now, please don't be afraid, there's gonna be a little code, but I'll try to explain this carefully to you. As you can see, I have a few MCP servers here. There's a File system, there's a LaTeX Beamer, which we've generated presentations from LaTeX. Object detector is the one who can recognize what, and objects are on a picture, right? It's done in YOLO. And there's a Clarificator, which we're talking about a little more today. It's a simple, almost empty MCP server, and it's just gonna make it easier to explain. Let me start by purifying the experiment by removing all these MCP servers. You don't really worry, I've got it all stored, we'll be back in a hurry. But if you open your Claude Desktop and you haven't connected any MCP servers yet, that's how your profile will be. That's right, aaaa. Let us re-launch Claude so that our changes can come into effect. We need to complete Claude Desktop and, indeed, launch it again. Oh, after reset, our software casing is watching, and what MCP servers are available to her. And as you can see, she sees nothing extra. Web search and extended thinking is, uh, those tools that are injected, we can turn them off-- we can turn them off. But all the extra MCP servers I wrote before, they're not available just because we didn't show them in the configuration file. Now let's do the following. We'll ask LLM through our, uh, interface we have, ask LLM to tell us what tools it has now. Let us start this story and depending on what she's giving, we can actually understand, and as LLM sees it all. Again, we see the result that LLM sent and further processed our software envelope. But look, LLM-- she told us she had some tools. There's an artifact tool, there's a repl tool, there's a web search tool, and there's a web fetch tool. You can read what they're doing, but if you're short, maybe the most interesting web search and web fetch are the ones that were connected right here. What are they doing? The Web search allows, a LLM-ke to launch the search for information on the Internet, and the web fetch allows, and, on the basis of a web page, to gather information, add it in context and in this context to provide some sort of detailed information I'm sorry, I'm sorry. I mean, look, you can take some kind of instruction, and, uh, instruction, I don't know, let's take, like, programming. There's a library you work with as a programmer. There's a manual, there's documentation on this library. You want LLM-ca to write you the code on the basis of this library. Maybe there's a specific version of this documentation or something. So, LLM, how will this task be addressed? She'll find that page. Either you give her a direct link or you tell her you need to find the documentation. It will further collate the contents of the page, add it to the context of the communication and, accordingly, provide a response. It's all going to happen again, with the help, and here's the software, uh, software envelope you're communicating with LLM. So the software envelope will launch this tool, this tool will copy the text, return his software envelope, and then you'll write, "Let me, there, I don't know, write me a code that I have to write. "is doing something, it's on the basis of this library." Oh, your prom will be added additional information from the site that was found, and the model will return your answer with all that information. But look, and when we talk like a chat, it might seem like a set of tools, a set of additional information that's up to, uh, a software envelope, it's always the same, it's the same. - I'm not sure. Not really. Each new message will re-engineer the recruitment and re-entry the LLM-ku. Let's show you, I'll get back, and those MCP servers I had on my way here. I'll explain in more detail how these instructions are designed, where they are taken and where what they mean. But, let's just get back to it, keep the change, go back to Claude, and, indeed, with the new tools, we'll ask the same question. Here we have Claude launching.

00:10:00–00:12:37How do we connect the extra tools in Claude?
Ilnar Shafigullin00:10:00

So, here we are, we've got a system over,

Ilnar Shafigullin00:10:00

We've got a system reset. We have a few, uh, tools. Some of them are off, some of them are connected. Well, let's just leave it to ourselves. It doesn't matter. But what are we gonna do with you? We'll go back to this chat and in this chat, we'll send the same message to Lod. You can be in a separate way, but I just want to show that, and the set of tools isn't nailed to a specific chat. Yeah, so you know that this is what you see here, you might intuitionally seem like one of the sessions you work in. Actually, uh, this-- this software envelope Dan Suchy Cloud Desktop, she's always making a new message to LLM. See, we've got new tools, and you see how LLM sees them. She has a Read File tool and a description, and what does that instrument do? There's a Write File tool and there's a description. And for every instrument, come on, there's got to be the one that I wrote on my own. We'll find him now. Oh, well, Detect Objects. Yeah? We have a description: get a list of objects on every picture. There are arguments to put it in the entrance. It's a list of ways to picture, right? So we just need to point out some pictures, and what picture we want to work with. And LLM knows that if she does, she's promised the following result: that every file will be listed and that this picture is on. If you remember, in the previous video, we were just sorting, uh, cat pictures in one folder, and other pictures in another folder. That's what happened. When LLM read my assignment, "dissort, uh, dad pictures," she looked through the file system tools that she had. Next, she used the Detect Objects tool, because she knows she can get a list of objects on the picture. She's back in some kind of "the specific file," like the cat's in there." Therm, yes, we did. And accordingly, on the basis of this, the following decisions were made. So, as you can see, and, in fact, LLM still keeps working with the texts. To be able to use tools, we need these tools to understand the LLM read, and, uh, to describe. Let me show you now, and, uh, the tools I've collected, and how these instruments can be connected, how they start, how they are actually being developed.

00:12:37–00:15:35How to challenge AI to the agent.
Ilnar Shafigullin00:12:37

We'll move back to the VS Code. There's gonna be a little Python. Please don't be afraid, it's not gonna be a big deal. I'll try to explain this in a clear language. Well, let's take Object Detection, since we're talking about him. It might be a little weird to look out, but it's really very simple. I wrote here on the fact that this function is Detect Objects, gave her the description you just saw. I mean, look, when I have a server, MCP server, and I've got this MCP server on this software envelope, the software casing at the launch, and I've been interviewing it, and what kind of functions you have, What tasks can you do? And this text that is written here, it's called docstring in Python, and this is the docstring to this function that was transferred to LLM. And then LLM already knows how this function can be done. And, in fact, the most important part, uh, descriptions of this function are exactly it. LLM doesn't know how it's been implemented. She doesn't read the code inside, she reads exactly this description. And the way you describe it, it will, uh, influence the way LLM will use this tool further. In fact, it's the same prompot inženiring. You need to write a good prompt to understand the model, and what does this function and what it needs to be called. Besides that, you need to point out what this function should do. After that, you need to decorate this function, and all the rest of you make the Framings FastMCP. So for MCP servers, there's a special frimevore, in which you create an object, decorate your functions and, in fact, everything. What's done here? I'm just gonna go to the technical details, and then I'll be right back. Please don't be afraid and, as you say, don't turn around. M, the MCP server default is working on, and, as a standard entry protocol, STDO is called. If we're talking about YOLO, YOLO is a special fraimvortex who recognizes, uh, can detect objects on pictures. He loves to text in a console. Accordingly, this block is needed to silence YOLO so that it would stop texting the information withdrawal consensor because it would be read directly by LLM. LLM does not need to know additional information. We need LLM to get what's needed, right? Otherwise, she'll fight and not know what's going on. So, all, uh, things that STDO write, we need to be silenced so we can control what information comes, what information goes.

00:15:35–00:17:40Demonstration of the AI of the agent
Ilnar Shafigullin00:15:35

Let me show you the virtually empty MCP server. Oh, those who keep watching our episodes, perhaps you remember, we had this discussion, which is very unfortunate that LLM is not able to clarify the information. You're giving them a request. And perhaps this request is mixed. Perhaps it would be good if LLM first asked for some further clarification and only then went to do this, this task. Yeah, I was actually wondering, could MCP servers put LLM in the hands of that tool? Let's see what this is all about. Aah, we have some kind of job, like, request clarification. A, the model will ask for information when, in fact, the request is too general, leaving some possible interpretations, does not contain critical details. And there's some extra information, some extra information. There's a big prompot here just to make the model, so, uh, push for this function. Let me show you what she finally learned to do. Where to? We'll get a model where we go tonight and, accordingly, we'll make sure we have a clarification. Let's get started. Yeah, you see, actually, the model, instead of giving a quick answer, she's asking us for some additional information. Let's see how she asks for it. And then I'll show you how this thing works. Here. And now instead of answering my question, the model asks, "What city are you in?" Because obviously, if the model doesn't know it, it would be good for her to specify. Now, what do you really care about? One of you plans to spend the evening or the company, and so on. Some requests could be tried, yes, and the model would further clarify that information.

00:17:40–00:19:00Engineering prom
Ilnar Shafigullin00:17:40

I have to understand that this is, of course, we've been doing MCP now, but it's actually a simple prompot engineering. We, uh, tell the model that if you need some more information, call this function. The function is as simple as possible. The model will have to give some context to this function, and the model will just get back: I need to be clear about it. The same context that the model itself wrote. And the question is, can you please tell me what to do? The model, after receiving this information, writes some prompt and clarifies the information. As you can see, the MCP servers themselves can be as diverse as possible. There may be those that launch big processes: reading from the database, communication, for example, with your account in Notion. It could be a request for some information on API, it could be the deployment of a large computer Vision Yolo system that recognizes some pictures, and maybe just returning them. question-and-response systems. There's a question. Let's get back to the point, to connect our MCP servers.

00:19:00–00:20:00How to connect MCP-server
Ilnar Shafigullin00:19:00

As you can see, we have the ones I wrote myself: Latex Beamer, Object Detector, and there is a File System, which I use is already ready. And the question is, what is this? Look, I only use those MCP servers who work directly on my computer. Accordingly, these programmes are to be launched and ready to process communications. So, the processing of incoming and outgoing messages, it's going through, in, now I'll show you through FastMCP. So this is all the way to get the FastMCP. We need to show you how these programmes can be launched. And here I use Docker just because I'm more likely to work with him. Most of the programs I'm creating, I'm turning everything into Docker as separate services. And I'm using it here too. Let me not tell you what Docker is like in this video, but if you want to repeat what I did and don't know how--

00:20:00–00:26:04How to connect MCP-server
Ilnar Shafigullin00:20:00

And what I did, and you don't know what it is, you're just gonna have to put it on your computer. It can be done there with youTube Tutorials or chat-bot, respectively. And then, the task is, where do you find this team? Actually, it's just a Docker container launch team with some extra parameters. Where can I get it? There's a repository like that. A, I'll leave a reference to it in the description of this video, and accordingly there is a list of different MCP servers. M, those who are not archived are those that are apriluted, approved by Anthropic. They are very likely to be safe, you can use them. I've been using the Filesystem. If we move on the reference, there's documentation detailing the details, and what does this MCP server do? There's a API with all the tools that are here. It's detailed, every one of them does. And there's more to use, in particular, for Claude Desktop. And there are teams for Docker, and there are NPX teams. Who's more comfortable than the other, can use the other one. Well, I used Docker. As you can see, it's exactly what I've written. The only thing to understand is that, uh, MCP File-Filesystem server works with some daddy on your computer. And here in the mount block, we need to point out what kind of folder we want this MCP server to have an opportunity to interact. If you'll notice, I have some kind of folder of the Users, Ilnar Shafigullin, Desktop, ilnar, anthropic, demo. And that's all I put in this file, that's gonna be available to this MCP server. Through Docker, I think it's very convenient to work in terms of limitation, uh, right for the MCP server so he doesn't turn things around, right? You only gave access to this file, it only works with her. But again, it's a little over the scope of our topic today. Oh, I repeat, there's a certain number of MCP servers that are aprimed by Anthropic. There's an interesting thing Memory. So you can, uh, give your chat-bot the opportunity to keep useful information in the form of a knowledge stream from communicating with you to a special file and using it further. There's a Sequential Thinking, that's a consistent thought. There's some extra interesting stuff. You can see what you like, connect. Almost every one of them probably has a way to connect through Docker. You can use it in a calm manner. There is also, and, a, the Awesome MCP Servers repositories. Ah, they're used to their fear and risk, but this is the comunity that creates the MCP servers. There's a lot of them. For example, you can connect, uh, your software envelope to your account in Notion and thus allow LLM-ke to interact directly with the notes, with pages in Notion and with any other systems, right? Right there, working directly with databases, working directly with the version control, GitHub. There are many different MCP servers, all with descriptions. You can come in and see how they work. If you have instructions on connection, you can connect to your system and, accordingly, to deal with some tasks. Here. I really hope it's a little more understandable, right? Here, let's re-enact before we go to the last technical part. Let's see that first, we have a software envelope that builds interaction between us, LLM and additional tools. So what you write will be processed with this software envelope, added some additional information, sent to LLM. What LLM will answer is that W-- there will be a block for you and a block for this software envelope. She can start some of the tools you'll give her. You're giving her tools through the editing of a special file, respectively. Well, for Claude Desktop, it's claude_desktop.config.json. You're telling me everything you need. If you use another software casing, there'll be some kind of construction, but with chat-bot instructions or some tutorials, you'll be able to find under a specific model with which You're working together. And, accordingly, the MCP servers themselves are a very simple story. The code I publish on GitHub, you can take it and do it by analogy. If it's a little harder for you to read, write the code, you can use the Wypcody end of the OpenAI or DeepSeek, I'm sure you'll be able to write your own MCP server under the tasks you need. But actually, the purpose of this video is not to teach you to set up MCP servers, but to explain the logic of their interaction. I'm sure 99% of the audience, not even just our channel, but youTube, who have, never gonna write their MCP server. But it's very useful, in my view, to know how the tools you use almost every day work. So you can understand, and how do they even manage to have restrictions on what they can do? Because it's not for me to show up at the beginning without my own connections. Claude already has a set of tools he works with, in fact, like MCP servers.

00:26:04–00:30:00How the AI agent works from inside is part 1/2.
Ilnar Shafigullin00:26:04

M, if it turns out that a MCP server is important to a large number of users, I'm sure that major technology companies will just put it inside these software envelopes, just like they did. With a web-based, fatch, a fetch of pages, a code launch in internal editors, and so on. Here. And the last thing I've been trying to show you is that technical part. Let's go to the terminal. I'll show you I'm running a few containers now, but I'm not running these containers on my own. If I turn off the Claude software, and, uh, show me what containers I've got. As you can see, I don't have a container now. If I'm gonna start a Claude software shell now, I'm all set up. Look at the containers. The containers are on. Is that what we're doing? That this software casing on my computer is launching the tools I gave him, the teams he's got here. Accordingly, that is how further work is going on. We have a toolbox. The software shell can work with these tools, get a half-t-track, and get back to it, respectively. Here. And, uh, add them to the reports that go to Claude. If you're interested, I might be able to show you how to do it. Uh, let's start a message with you on the MCP server. Let me see what's on my way. I've got them here. ID Container for LaTeX, I think I did it for clarification. I'll copy the ID container. I have a ready, uh, ready message. Look, as we talked, the interaction between tools and software is going through a standard input. So what's going on here? I'll pass some text through the echo team to the tool that's launched. The text will be further processed through FastMCP and a response will be received. Accordingly, let us change the current name of the container and see what happens. In response to this message we sent, yes, we have an answer from our tool. You can see what's going on here in detail, but let me probably explain it so briefly. I've got two ID-one messages here, and ID two should be here somewhere. Yeah, here's the ID two. So we're, uh, numbering, sending messages. Each of them will be answered by the MCP server accordingly. In the first message, we initiate our communication and receive an answer to this initialization. See, here's the ID alone. And in the second case, we're asking for a set of tools that are available. And on the ID two, on the second message, we actually have a model that says I have these tools. There's a request for clarification with their descriptions, there are others with their descriptions. And that's exactly what the LLM will be giving in the future, right? So when the software shell starts, it starts the tools that are, in my case, the docker-containers, asks all the tools, and what they can do. This result is added to the supplementary message, perhaps in a system message for our dialogue, for our read, and this is the schmuck, together with my message, that will be sent to LLM. LLM is generating the answer. There's gonna be a response that I'll see, there's gonna be a response that will work on our, uh, software envelope. And, accordingly, if there are, uh, requests for some tools, these tools will be covered in the software envelope, this way, and then they will work.

00:30:00–00:31:26How the AI agent works from inside is part 2/2.
Ilnar Shafigullin00:30:00

Yes, she will send some of her messages and answers will go back to Claude.

Ilnar Shafigullin00:30:01

And send back to Claude. Here. Ah, our previous video has not been very much looked into, but it has received very many comments. Uh, I hope the technical part of you isn't very confused. Uh, the subject is very voluminous, but I tried to untie it as I could. Oh, I hope you liked it and you were clear. Write comments, support our channel. You're not the only one who liked it or didn't like it, but what you didn't understand. Because for me, it's a separate shuttle, too, to put a big subject in that little video. Mm, and we all have a very different level of training, and I really cared about getting it all figured out, right? So if you're completely confused at some point, please write this in the commentaries. Write what MCP servers you've tried, a-a-a-a-a-a-a-a-a-a-a-ha, you've been trying and you've been pointless. Uh, I really like reading your comments. Most of them I try to answer., there were great, very informative comments under the previous video, I see that the current syentist designers are. It's a shame that you're watching our videos, too. Here. Aah, stay with us, we'll come back with the new videos. Sign on the channel. Bye-bye.

Discussion participant00:31:26