YouTube Video L4Q-Momd6ZQ

## Metadata
- Author: [[YouTube]]
- Full Title: YouTube Video L4Q-Momd6ZQ
- Category: #articles
- Document Tags: [[architecture]] [[customization]] [[implementation]]
- Summary: YouTube Video l4Q-momd6ZQ
- URL: https://www.youtube.com/watch?v=l4Q-momd6ZQ
Okay. Yeah. Okay. It was on mute. All right. All right. Hello everyone. Uh my name is Alex. Welcome to my talk about AI coin agents and how to code them. Um now throughout the talk I will be interchangeably using AI co agents and AI agents um from time to time and they
are pretty much for the sake of this presentation they are interchangeable just because all the all the techniques all the code which I will show uh later throughout the presentation is applicable to essentially both uh AI coordination specifically and AI agents in general. Now a few uh words uh first about myself. Uh so the QR code on the right left uh is uh for my uh contact details if you want to uh reach out after the talk. Uh but yeah, I've been
working in IT mostly in machine learning and ops for more than 10 years now. Um I've been working as part of the company called encoder which is developing uh coding agents coding assistants agentic coding assistants uh from essentially the first day um and then for the last year I've been mostly doing deil uh which resulted in quite a lot of uh flights uh over the like just this past past year and I also have four main
which I sometimes get the chance to visit between my uh between my events and yeah This this conference for me is event number 32 essentially. Now um this conference and like like many others is full of talks about AI and I hope you don't feel like this coming in to the last talk of of the day again about AI and yeah uh hopefully know you won't be overwhelmed by you know talks about AI and charge and whatnot and at the same
time you also can find a lot of headlines uh in the news similar to this that AI will soon replace developers you know like this one is from for Mark Zuckerberg, I think he uh said that AI will replace mid-level engineers by 2030, I believe. And those headlines are well, they are popping up pretty much since Copilot uh got um went public, right? Uh but lately they started to pop up more more often and there are two two
main reasons for this. Uh well, apart from you know hype and whatnot. Uh first of all, of course, the models are sorry first of all the models are getting better, right? So this is a comparison of a few of the most recent models like GT5, Gemini, Gemini 2.5 and a few um Antropics models and I highlighted here two coding benchmarks uh which are probably the most important for us for today's talk. And while you know of course on benchmarks models tend to
become better and better uh it doesn't necessarily translates one to one uh to real life world and the reason for that is well LLMs are trained essentially to predict the most probable the most common the most probable next symbol or token and sometimes this can lead to mistakes just because uh something that is most common most probable doesn't necessarily mean that it is what you wanted right so and LM are good at finding patterns but unfortunately LMS are not really bound to you know u to
real understanding of the world uh some sometimes it causes this kind of uh weird suggestions but I guess it makes sense given the the art AI has been producing for us now uh jokes aside so agenda for today uh yeah and the second sort of u part of these uh headlines is AI agents right so we will talk first about what agents are in general so in theory. Then we will switch to sort of the main part of this talk about how to um how to create your
own uh coding agents, how to create your agents in general and I will go through several steps sort of of increased uh complexity or abstraction if you will and then we will briefly talk about the future of software development and how it it is being shaped by AI uh nowadays. Now first of all let's define what is an AI agent. Now you probably I think there are there were already a couple talks today about AI agents. So but just to to be sure that we are all on the same
page. So we can define AI agent as a software that that perform tasks on behalf of a user. Now on its own uh this definition essentially uh sounds like any software software right? So any software like any for example coding assistant perform tasks on your behalf. So it can generate code it can I know potentially fix errors uh generate accommodation so on. So you can you know tap tap tap and get a bunch of a bunch of code which you will need to then try to understand what what what the hell is going on. Now the main difference of
agents from the sort of classical software is that agents follow a few agentic patterns or principles if you will and first one is tool use. So agents essentially well LLMs can use tools uh which you give it give access uh to. So that can be uh any tool starting from access to file system. It can be running bash commands. It can be some uh execution of the code. It can be web search. So essentially any tool uh at which you give access uh to LLM it
can use to get more context uh to give you much better answer or to validate its own uh code for example right. So let's say LLM generates the code then given the access to bash or Python Python or C compiler or whatever it can compile the code check if there are any errors and then fix them uh to make sure that the code actually works. Uh then LLMs or agents can also do planning. So they don't just blindly output um the
the next tokens, right? They can do some sort of pre-planning steps. And if you've used uh recently charg 5 or coll you might have seen those sort of thinking um thinking steps, right? So where LLM is trying to sort of think on about the task, what steps it needs to to take or what steps it requires to to do in order to give you the answer. And this is sort of like planning step and ideally agents uh can follow this plan this out outlined plan and then can they
can also reflect right. So this is the third pattern they can also reflect on their work or they can reflect on the work of of other of other people or other agents and this is where we go to multi collaboration where basically multiple agents can work either together or against each other in order to achieve um the goal basically. And you can think about AI agents as sort of Roomba or robot vacuum cleaner, right? So uh software itself on the robot vacuum cleaner is an AI agent and its
task, its goal is to clean the room, right? But it the software itself can't do that. It needs tools, right? So for example, there is of course the brushes, the wheels, right? Um a bit the brushes, the wheels and uh the vacuum cleaners that do some planning. Now, Judge GPT thinks that uh robots work move around in this weird shaped shape pattern. But yeah, I guess uh know in reality they try to move in more optimized manner and
unfortunately or fortunately there is still no multi- aent collaboration for vacuum cleaners and count this as sort of multi- aent collaboration. Uh but maybe in the future they will be able to you know somehow talk with each other with other appliances and whatnot. Now if we um translate this to sort of real world and uh how it affects the the LLMs and the accuracy of their of their predictions we can see that for example here from the recent GT5 release we can compare the the result on one of the
benchmarks human last exam with GPT5 without tools and without thinking so it is 6.3% whereas also with uh thinking and python and web search it is it to 35%. Right? So, it's pretty pretty high um boost only from two essentially two things, right? Tool use and thinking or playing. So, no, you you can already see how those just two tools uh can
significantly increase uh the accuracy um the quality of results and and so on by compares from vanilla LLM. And if we sort of move this to uh like coding example, we can essentially get the following pattern. So let's say the task is for agent for LLM to get the designs from Figma and update our website based on the updates and the designs. All right. So for this uh the
agent can first of course decide to use tools. So it would use Figma tool to get the designs. It then do some planning step to see you know which files it needs to update which changes it needs to do and so on. It will generate the code. Uh then uh it might decide to run the browser right. So for that it can use other tool right. So it will run the browser run the website uh maybe get a screenshot of the page uh compare it against uh the designs. So there's a
reflection right and then based on this it might decide to maybe update something or maybe maybe create a test and again uh repeat this step over and over until it is satisfied hopefully satisfied with the result and hopefully as as user also satisfied with the result. So uh this is sort of like a theory of what agents uh are and how they differ from sort of classical um LLMs uh vanilla lamps and uh software right and
now let's uh you know finally uh do some coding so all of the code is which I'll be showing today is available on this u repository over here this cure code. So if you want to you know play around with it after the talk or if you want to you know use it as a sort of uh starter for your own project feel free to um fork it and play around. Now um the code itself is structured in sort of several as I mentioned in several sort of levels right so we will start with some baseline which will be a one LLM and
then we will gradually implement uh different aentic aentic patterns aentic features all the way to multi aentic system. So uh let's let me uh switch to uh my code over here. All right. So as I mentioned we will start with the baseline and let me also zoom in a bit that everyone can see. So yeah we will start with the baseline and in the in in this case the baseline will be
essentially just a simple vanilla lm. I will be using drip 5 for this example and you probably uh you know had similar experience if you uh used um drift for whatever right u through API so on its own the model doesn't have access to any any tools any web source any browser whatever so if we try to ask um or any LLM for that matter to um let me execute all of these yeah so if you ask lm to um about something that
requires access either to to physical world right or to my local machine it essentially fails right so if we ask it about the response time for Google obviously we as developers we could do just ping command right but LLM obviously doesn't have access to um to its you know to environment to bash or whatever so in our case yeah it did provide some helpful examples right some helpful commands and some you know typical uh typical numbers but this not
really what we wanted to get, right? We wanted to get actual value, not a not sort of average or you know typical results. Uh the same goes with the Python packages. So obviously LLM on its own doesn't have access to my local machine. So it won't be able to give me any um any actual answers. It did it did provide some uh some commands, some helpful commands. And interestingly uh
GPT5 is more uh focused in that regard. So previously for similar task I use GPT4 and you can also you know plug plug here 4 and GT4.1 for example and it would uh be more convoluted answers. Now Gt5 is a bit more sort of focused and then yeah so what's in Python 314? So um as you might know LLMs have some um knowledge cutoff. So basically that's the date until when they um had the data
right so they usually trained on large corps of data which um sort of cuts off at some date. So I think yeah it mentions here that it its cut off date is October 2024 right so it doesn't know anything beyond that date and uh Python 314 was well I think it's still not released so obviously it doesn't know much about um about this release uh it did see probably some release candidates
so from that it could get us some answers right over here but obviously this is again not something that we wanted to get right so if we let's say wanted to use some new version of the framework u with our coding assistant uh it needs to to have update knowledge and we obviously can't retrain the model every time like every day uh the new data comes in right so while it is still kind of helpful it provided some uh comments for us it provided some um possible answers it wasn't very uh
wasn't very helpful in in real life applications now let's see how we can um enhance this uh by just by giving it uh the LLM a few tools. So let me close this one and let me open our second second sort of level of uh agents. Now here I will be again using drip t5 uh but on top of that I will be using what is known as react framework. Now react
stands for reason plus act and let me execute this uh cell. So uh reason plus act framework means that we are essentially instructing LLM to go through a loop of several actions. So first is the thought. So LLM needs to think about if it needs to perform some action to get to gather more context or if it knows answer right away. Then if the action is needed the second step is the actual action. Right? So um then
there is a pose where the action is supposed to be actually executed to gather some context. Then we go to observation step where LLM essentially observes uh the the response from the tool. um know it could be again the ping it could be some web search and so on and then hopefully that would be enough for LM to give us the answer or if not this loop continues uh on and on until the LM gets answer or we you know sort of hit the loop counter limit
and we can quite easily implement this through this sort of system prompt which essentially uh defines what I just described right so um you are running in the loop of thought action uh observ observation and post and observation. Um, and we also define a few tools right in the prompt, right? So we here we provide a few tools and namely pink. So we define pink as and we also provide an example on how to actually uh for learn how to sort of call this uh this tool
right so it's pink semicolon and then the website we also provide access to bash tool which is in this case will execute any bash command right and there is also description for each for each tool and we have the web search which will do the web search uh we also provide an example session right so an example would we as a user pass on the question. So you know how many islands make up Madera then LLM might decide that it doesn't
doesn't know the answer right away. So it might decide to um use a web search it will call uh the action web search get the result and then based on this observation it will give us hopefully the right answer. So let me execute this and then we also define our tools on our on our own. Right. So here uh the tools themselves are pretty pretty simple pretty simple implementation pretty straightforward right so there is ping as I mentioned uh there is bash and
there's web search they all are you know the most straightforward things uh here there's no there is no frameworks it's just gets the context and that's it no filtering whatnot uh and we will see the better ways to uh implement tools in a second uh but for now let's actually verify that they all work so ping seems to be working by bash execution works as well and then web search should give us okay web search
uh web search is not working okay well let's see I'm not sure what's uh up but it should be able to use the other actions right so then we over here we are essentially just implementing the react loop right so we start with the system prompt which as shown and we add to it the user query the user prompt over here and then we go uh into the loop of react framework where we first
query the model right uh then the model decides if it needs to perform some action we detect this action based on the regx uh if there is action we actually execute that action right they we pass on the observation to llm and then based on this based on this observation hopefully LLM will be able to give us the answer or it might go to another loop. Right? So let's uh execute this and let's see what's the response time for Google. So in this case, LLM
hopefully should Yeah. So as you can see, decided that it needs to run the action ping, right? So it decided to uh ping Google com it got observation which is essentially the result of running this tool locally in my machine. Um and then it got the u answer uh for us right based on this observation. Same goes with the Python packages. So it should hopefully decide to run some bash command uh one of those which
previously it suggests for us. So yeah indeed it decided to use uh this python-p list yada yada which gave it quite a long list of python packages which I have installed locally and it will take some time for lm to sort of proceed to process this um this long input uh but in the end it will give us essentially the answer and yeah we'll probably won't be running web search because there was
some issue with the web search previously but yeah it would pretty much be the same. It would do the web search and then you know summarize essentially for us what what it found right let's see if it will give us finally the summary of this it sometimes take a bit longer because either internet connection a bit slow but also the processing can be quite long for long uh inputs like this one coffee and laptop what could go on.
All right. Well, it looks like it doesn't want to summarize anything for us. Hope the internet connection is still working. Well, yeah, I hope you will believe me that it will, you know, basically summarize it at some point, but I'm not sure what's I hope that the GT5 doesn't have any uh issues on the server as well because it would be uh quite a bummer.
All right, but yeah, as you can as you've seen here previously with a bash tool with a pink, you know, probably the simpler one because it's not a lot of uh input tokens, right? So, it got decided decided on the action uh use this action. we uh well we as a client not as a user uh ran this this action and then LLM was able to essentially uh respond based on the observation and yeah I'm not sure why it's uh taking that long it's usually not that long.
All right. Well, now tools as as you've seen, we defined our tools essentially just like uh just like this, just like functions, right? So, uh obviously, you know, in my case with this implementation is rather simple, right? So, I mean, as you've seen, web search actually didn't work. It worked like an hour ago, but I'm not sure what's happening now, but you know, as always, uh so as you would imagine, uh there are better ways to do a web search. uh there are probably better
ways to do ping or you know execute bash commands like here I'm not doing any sanitation any security checks what not so obviously it's not very uh production ready uh solution right so uh let's say someone else decided to implement another tool for web search which would do some summarization which would do some uh some linking and so on and we would want to change our tool our web search tool to this other new web search tool right so in this scenario we would need first to update the prompt, right?
So, we might also would need to update some way the way we process the inputs and outputs because the tool might change the input schema, the output schema. So, it's not very um it's not like drag and drop uh kind of thing, right? It might be a bit uh tricky to update uh the tools which we define ourselves. Now luckily of course there are a few ways to sort of stand standardize this and the most common being let's see if it uh did actually
the thing okay so after a lot of thinking it actually uh got to the answer we and in this case it just well uh output the same list all right yeah and yeah suggested to filter something but yeah okay it took a long time to I guess output the same list all right so um as As I mentioned, there are a few ways to sort of standardize uh the way we can use tools and by the way we can pass on tools to LLMs. The most common one is MCP. It is introduced model
context protocol. It is introduced by entropic I think in the end of last year right and it is essentially let me uh start the slideshow. So MCP or model context protocol it is essentially a standardized protocol for providing context to LLM or essentially to do a tool calling if you will. So it is based on JSON RPC. So it is essentially a standardized inputs and outputs. And this allows first of all for RLM to um get the structured um
information about how to use the tool, which tool does what and so on. And then the same goes for the output. It is in the structured format. So LM knows um what to expect and it is formatted in a way that is easy for LM to process and MCP contains of essentially few uh main components. First one being MCP client or MCP host which could be the ID um basically anything which runs the agent
the LLM right so that's MCP host MCP client and uh MCP client is essentially just quering the MCP server uh for uh for the tools and for the context from those tools then the second part uh the MCP server uh essentially is responsible first of all for defining uh the list of tools and uh its structures and for inputs and outputs, how to call them, how to use them and so on and for advert advertising those uh tools to the client. And then the second part of uh
responsibilities of MCP server is to essentially do those tool calls right and as I mentioned before those tool calls can be pretty much anything you know whatever you can program you can transform into MCP tool into MCP server uh and you know it can be access to local resources like file system bash tool and so on and it also can be access to remote resources like for example Jira I know web search um confluence whatever right so whatever you can program assign again whatever where you can query through and for example rest
for API or gRPC what not you can uh convert into MCP server and allow LLM or agent to get more context from those tools through uh the MCP server uh yeah so if we essentially look at how it works uh between us the user the LLM the client the server uh it follows the following schema so first the client and the server they um sort of talk um do a handshake Right. So, uh the server the client
initialize connection and then the server advertises its capabilities. So, it's essentially sends a list of tools uh which it is able to do to use to to execute uh and how to call them what they do and so on. Then whenever the user um asks something from LLM and LLM decides that it needs to gather more context right so but then it needs some external data it can uh using MCP client request the call of specific tool uh
which then as I mentioned it's basically standardized inputs and outputs it will send the request to the server the server will execute that tool uh return the output and then LLM essentially gathers extra context to give you uh proper answer well hopefully proper answer uh to give you better code code generation what not. So basically uh it is a way for model to gather more context which is not otherwise available for LLM
and there are quite oh yeah yeah so before we go into the example so yeah this is an example for actual tool right so this tool is for creating branches indeed and as you can see it takes four inputs three of them are required so it needs owner uh repo and the branch right and there's optionally from branch which by the defaults to default branch and Yeah, essentially this is attached to the to the prompt which is sent to LLM and then LLM can decide depending on its task if it needs to call this tool or
other cool other tool or it doesn't need to call anything at all and there are a lot of different uh tools already available a lot of MCP servers so on the uh left you got you have a lot of um URLs for different registries right so there is the main the first run uh MCP registries from the entropic itself. The model context protocol/s servers we as encoder also have a marketplace which is available right inside the ID and
there's there are also a lot of third party MCP registries like for example MCP. So and as you can see uh the MCP servers can be for pretty much anything right. So it could be some uh IT related tools like for example Graphana or know exa web search. Um so essentially you know there are probably now already thousands of MCP servers which can um give LLM access to a lot of different contexts. Probably the the most uh unusual one which I which I've seen is
for Dutch railway system. So essentially it would allow LLM to query API for Dutch railways and then it would it could get you know the latest trains shadow and what not. So you know I couldn't make it work unfortunately but you know it is something that you know you can basically uh do through the agents. All right, I think uh we can go back to the code now and let's see how we can first of all define the tools, right? Define the
def find the MPC servers for our for ourselves and then how we can use them. So uh first thing first so in order if we want to define our own FCP servers, we can uh use MCPS SDK it is available in multiple languages. So in this case I'm using Python but it is available in I think you know like JavaScript Java I think they recently released Rust. So you know we can find a lot of different uh available SDKs for MCP and again as I said it is essentially structured inputs
and outputs based on JSON RPC. So it's not very hard to implement it on on your own as well. So in this case uh again I have the same bash bash tool which you've seen before right. So it basically just executes the command over here. And what I need to do to convert this this code to MCP server is essentially three two lines or three lines right. So import import um this um this library, right? So and then create essentially this in the server and then
uh decorate my function with the um this decorator and that's pretty much it. Um this is uh what is needed to convert my code to uh MCP server and then um any agent can essentially use this uh MCP server uh through MCP protocol. Now if we now want to to use this with our LLMs uh we can do this in the following format. So here I'm switching to sonet 4
uh just because I mean uh MCP comes from so I guess it kind of makes sense to switch to their model here but OpenAI recently also adopted MCP so it should work with um GPT as well and most of the latest models also are adopting MCP so it's becoming sort of standard um across the industry so I'm also using andropics web search which is essentially also kind MCP tool but it is remote so it is working on their servers. Uh so
uh here I'm defining our MCP client uh which is essentially as you've seen from the diagram it first queries the MCP servers available MCP servers for the list of tools and then it executes all the uh requests from the user and um queries the MCP server for any tool call asked for by LLM. So the uh it is quite long but the main uh the main parts here are well as I mentioned first we connect to servers. So we collect all
the u tools available from the servers. So here we get a list of tools and we will see in a second this u thing this debug print of course connected to server with a bunch with a bunch of tools and then the second part of this client is processing the query right. So there is user query over here which is then get passed to LLM along with the description of the tools. So we pass on the name, the description and the input
schema similar to what you've seen for create branch uh just a few seconds ago. And as you would imagine if we have a lot of MCP tools, it would u populate a it would take a lot of the input prompt, a lot of tokens. So be careful with when you know when uh using MCPS in that sense. And then of course we essentially query the model over here we just send the message along with the description of the MCP servers uh to the model and then um until we hit the iteration uh
threshold we essentially check if the model decided to use uh the tool or not. Now uh entropic I guess it makes sense since the creator of MCP they also made sure that that we can easily parse the output from LLM itself. So as you can see uh LLM the client by default defines if the response from LLM is just simple text or if it's a tool use. So we can differentiate based on this and then if
it's tool use or if it's a server tool use which is the case for web search um it we can then execute that tool and there are a bunch of you know these sort of color colorful uh things which we will see in a second uh so you can ignore these prints the main part again is we get execute the tool which was uh requested by LLM right so here we get the tool executed and then we pass this uh the result of the call of the tool to
LLM and then this loop goes uh goes again. So as you can see we attach this again we send this again to the LLM and yeah if sorry if the LLM decides that you know it collected enough context if it decided that it got the answer and it gave us answer we detect a stop sequence right and then this means that LLM is done or if not we go into the loop again and then let's see so the way we define
which um sort of how to run how to run the servers. MP servers we use uh these uh JSON files. So let me open it for a second. Uh I will run the full JSON right away. So here I'm defining three MCP tools. U first of all is file system which essentially gives access to the file system. It allows to create files uh write files, modify files, delete files and do the same with directories. uh there is a fetch tool which allows LLM
to fetch web pages and then there is our bash tool which you just seen a couple seconds ago. Now as you can see they are defined in this case in either JavaScript or in Python but again as I mentioned there are SDKs for different languages and you can also run those tools as docker file for example as docker image sorry as docker container for example. So essentially it is pretty flexible. So any executable uh you can uh put here um and you know
use as MCP server. Now let's uh connect to our uh MCPS over here. Yeah. So as you can see it got connected to three servers as I mentioned uh the file system right the fetch and the bash. And then we can uh do again a few queries over here. I'm also using the fact that latest cloud models can run tools in parallel. So in this case I'm asking to essentially create five new files and it should be
able to create them um in parallel not calling tools one by one uh but in all in the one iteration. So as you can see the loop one and it decided to call tool to call write file tool five times. So we executed this tool five times in parallel and we should get five files in our local system. Let's see let me yeah there we go. So essentially LM was able to uh create those files and of course you know it could also modify them. It
could also edit and um input some code and so on into those files in parallel. um see how many time we have uh we have okay so one other example over here is a bit more sort of u realistic right so we can ask the llm to run the docker file which I have in the in this um this directory and uh fix it if it doesn't work now there are a few errors in the in the docker file and the code which is being run in docker file so let's see if
the l will be able to u fix those for us Uh looks like it's it's not looks like there is some issue with the client. Let me restart uh the kernel and run the client one more time.
Hopefully this will All right. Well, again, looks like Yeah, it worked again 1 hour ago. So, yeah. Well, all right. Well, it'll yeah, let's
I will uh see what's the issue after the call and sorry after the after the presentation and I will update the repository uh with the fixes. All right, but yeah, so essentially um ideally it would be able to run the Docker file first, try to build it and then see detect errors and um fix them. Now let's uh see um of the next u evolution of this. Right. So uh here we only had one LLM which was able to execute uh tools
uh and the tools were essentially deterministic functions right so it was like file system it was bash commands and so on but we could of course imagine the scenario where those tools are um not deterministic tools but agents on on their own right so uh you can imagine one agent um calling another agent or you know multiple agents working in parallel as I mentioned before and there are different sort of multi- agent architectures where you can um define
how the agents interact with each other. Uh again it could be sort of supervisor uh schema where there is one uh sort of high level um model like sort of like product manager which is um working with the subordinate agents. It could be uh multiple agents working in parallel and interacting with each other without any specific supervision like network case and so on. So essentially it um you know instead of LLM calling tools it can now call other LLMs or other agents and u
the tricky part here is that um as we know LLMs are non nondeterministic right so uh when we are talking about multi- aent architecture we need to take this into account that every every note in this uh graph right so every note in this graph and in this graph and so on they are essentially undeterministic right so we can't um rely on uh each node uh every time and if you experienced um identic coding in your ID
and whatn not you might have experienced the cases where LLM would get stuck it would go into the loop over and over trying to I know uh drop the database start over and so on and obviously in such cases it's a bit hard to uh rely on on the uh different agents and um in general will put in all the sort of multi- aent systems production is quite a engineering challenge. Now um I will show a sort of simple example right so
which you can use uh as a starting point uh but again because of the undeterministic nature of of each node it it can be quite hard to put uh those systems in production sort of in the wild right again because uh you can't you need to have a lot of guard rails you need to have a lot of fallbacks in case one of the agents goes uh goes into the loop or introduces cancer and so on and then it sort of poisons the whole system uh the whole the all the
subordinates after that and there are quite a few ways to uh define uh multient systems right so there are a few frameworks uh I put here a few the most popular ones probably so there is lang graph from lang chain which is an open source framework uh there is crew AI which is framework under premium model so they have a open source part but they also have a paid subscription and also uh Google it's technically not a framework but uh rather protocol. So Google
recently introduced this agent to agent protocol which essentially u makes uh looks similar to MCP in the sense that uh unlike like an MCP the all the agents are servers which advertise its capabilities its skills and then uh the client agent can call those uh server agents uh with those skills and then you know act based on those skills. So essentially like MCB but without but instead of uh tools you now get the
servers which have undeterministic response right uh what could go wrong right uh so let's uh see how we can implement this um you know using l graph and hopefully this one will work without issues. All right. So, um we are again going one level uh one level more in terms of abstractions, right? So, on top of the
uh simple simple LLM colon, we now use lang chain and on graph to to do that. We will be using entropic again. So, we are using entropic as LLM. We have the same tools which we used before. So file management we also get the player browser which will allow LLM to run the browser and do different different stuff in the browser like clicking around filling the forms and so on. Uh we have the shell tool, we have the web search. Um yeah so essentially um this is the
tools and then we also will be using the swarm schema the sort of langraph swarm framework which um is another layer of abstraction which allows us to um abstract away all the different handoffs between the agents and passing all the state on the information between them and so on with a nice um layer of abstraction. All right. So um again as I mentioned we are using entropic sonet 4. We are
defining the tools and in addition to the tools I mentioned we also are using this uh human tool over here which will allow uh the LLM to ask questions back to us to the user if it decides to get more clarifications. Uh we then define our handoff tools. Essentially it's a way or direction for our edges in the graph. Right. So as I mentioned I actually didn't mention this but we will be building the supervisor
schema right so we will be using supervisor schema where we'll have one supervisor agent which will talk with all the other subordinate subordinate agents but those agents subordinate agents they can can only talk to supervisor they can talk with each other so hence we have a few handoffs right so we have a handoff to all the subordinate agents right so to back end uh to front end uh to devops to QA agents and we also have a transfer back to supervisor to product manager u over here right so
basically uh the product manager supervisor uh can transfer to all different uh supporting agency which in this case will be back end front end devops and QA and they can in turn um transfer back to product manager and yeah as you as I've already mentioned we have sort of a agile team uh agile virtual agile team of backend engineer front end engineer, DevOps engineer and Q engineer. Uh they all have uh tools, access to tools like
bash, search, uh file system, uh playright and human. And we also have the product manager which is essentially a supervisor of those. Uh the prompts are pretty straightforward, right? So product manager we are instructing to uh first create a plan a step-by-step plan and then decide which of the agents needs to execute the next step of the plan and then pass pass on to that agent the task of this of this step and then all the specific uh agents
specific uh you know virtual engineers are defined in the pretty similar way. So you are a senior back end or front end engineer. uh you are tasked to with a specific task create a sub plan for this task follow it execute it and then pass on back to the product manager right so you know sort of approximating the you know typical typical development cycle and yeah we have front end we have devops we have QA engineer so
uh pro wise they are not uh really that different in in this scenario but of course in reality in production you might want to focus your agents on more specific tasks or you might want to give them more specific tools, right? So for example, playright brow playright tool might not be useful for the back end engineer but is useful for the front engineer just because you know for front end engineer it might virtual uh engineer it might make sense to run the website click around check that it works
and so on. Uh so yeah over here we are defining our agents again we are using the same react pattern which we you've seen before right we are passing the available tools uh the prompt and then to each of the agent we are passing the tool of transferring to product manager and product manager itself uh gets the same tools plus all the transfers to the different virtual subordinate agents and then in the end we are creating this forum of agents uh our agents being five
of those, right? And the main sort of default active agent is our product manager or supervisor. And yeah, that's essentially all you need to to do to sort of create a basic multi- aent system using this L graph approach, right? So not much of the code. Most of the code is essentially prompt or prompts to the agents. And then let's give it a task. So over here this function is just for uh more pretty uh formatting of so you know you can
ignore this one and the prompt which will be given to the system is uh the following. So we want to build a website uh for the conference. It should have several pages and it should use uh react for the front end uh fast API for the back end uh docker posgress and all the typical stuff. And let's uh execute it and see how it will behave.
Hope the internet is still working. It's uh taking a usually long time. Let me actually see if everything is working. Okay, so it works. Oh, let's wait for a second because it
seems like Come on. I think I might need to start a Jupyter notebook for a second. Just a second. Let me uh close this because it might be some issues from my previous test. Sorry about this. me restart notebooks.
All right. Yeah, probably the most stressful part of the talk is the live demo because always something goes wrong.
Even then when it worked like an hour ago. Come on. It looks like there is something actually with entropic.
Of course, something goes up with the provider when it's uh you know when it is mostly Yeah. So, of course, so let's see if we go to Come on. Yeah. Of course. Yeah, perfect timing. Uh yeah, so yeah,
unfortunately we we won't be able to see the multi- aent system in action. And that's uh luckily for me, it's not my fault. Uh yeah, but uh as I mentioned, you can find all the code in the repository. So you can play around with it on your you know, on your spare time. And usually they uh do take some time though like multiple agents they take maybe 10 20 minutes to create a website. Uh but it looks usually pretty nice. So you know when is back uh you can play around with it. Now
let's switch to non stressful non-demo part of the talk. Let's let me talk about us about encoder. So as I mentioned we are and you know how how we fit in this multi- aent or aentic uh world in general. Right. So as I mentioned we are a gentic coin assistant and we allow you to develop your own uh agents right inside ID. So let me quickly uh showcase that. Uh let me open the VS code over here uh
which is on my wrong screen. Move it here. Right. So uh basically of course we have a few agents already predefined. Right. So specialized coding agent you test agent ask agent if is when you want to talk about something and to end test and so on. Uh but the nice thing is you can also create your own custom agents. So here I have a few agents created by my colleagues and they were shared by organization right so as you can see they were created by a few of my other
de colleagues and I think a few are from me as well. So this one I didn't share this is one my this is my private agent. Uh so you can essentially basically create your specialized agents uh task with specific task with specific tools. So you can give them a list of tools you want you want them to use. So you know for example you can give them them access to slack to g or whatever you add as MCP tools and then you can use them either inside the ID to do a specific task or you can also use them in a sort
of u kind of multi- agent fashion if you uh put them inside your CI pipeline. So for that uh we essentially have a few um few things. So first of all you can see all the list of the agents which I have here which you can use right inside the CI pipeline and then uh we expose them as web hooks which you can then pass to any of your um IT systems right so in in my case for example I have Jira of course uh and I
have an automation which essentially triggers the agent solve the the task when I label uh the ticket with this Zen agents label Once I did once I do this, it should trigger um the action uh which yeah so it triggers the action. So essentially now the agent is uh for solving the ticket for me and you know we won't be uh waiting. I have the sort
of old pull request from the same ticket. So it solved uh the the issue for us. It creates the commit, did the file changes over here and then another agent, another custom agent I had which you've seen the review agent came in and it actually reviewed the code, right? So did find some uh serious issue apparently. Uh then you can of course also use yet another agent to address those comments. So essentially you know uh use uh
make different AI fights about the go. All right. So with all that, so let's briefly talk about the future because we have few minutes left. So let me put this here. Now what's next for developers and you know you probably seen a lot of different opinions about this. You've probably seen a lot of different u funny and not also funny pictures or phrases. So you know people are saying that uh you won't be replaced by AI but
you will be replaced by a developer who is who is using AI you know so uh there is of course some truth to that um but still at the same time you know even if you are web coding if and this pretty common term nowadays even if even even if if you are web coding you still need to understand what's going on because otherwise uh you know you get a lot of potential security issues uh from LMS you get things like that right so it's kind and uh uh
doesn't uh really uh potentially need you to be replaced right now. So uh but seriously we as encoder at least believe that u AI is not going to replace it's not will be replacement it will be more of a um multiplier right if you will uh it will augment augment uh the teams the teams the programmers uh in a sense that now with the help of AI a single person a single developer developer can uh
do much more uh beyond its his or her own scope Right? So if uh you know me as the ops engineer I can do for example front end with AI because well I can uh I can understand JavaScript I don't can't write JavaScript so I can basically review the code produced by AI and see if it's you know going off if there are any security issues uh but still me as single person I can fulfill um task of multiple uh multiple typical
cross functional team members right so I can do QA I can well My agents can do QA, they can do back end, they can do front end, uh they can do something else and so on. And essentially as a single person, you are becoming much more powerful and much more crossunctional. uh but still this of course requires um some understanding at least of what's going on to avoid you know the cases from the previous slide right and you know even if you are web coding still you need to be able to understand uh
what's going on right so um and because of that um at least for now for the next you know few years AI is will be more of a force multiplier rather than rather than replacement but if you know if uh that's if that you know turns out to be wrong. Of course the AI still needs a lot of data. So there is still one drop left you can you know create data for AI to you know to be able to train on. And with that uh that's all uh from me a few
quotes for you again uh so the one for kind of for my socials and the one for zen coder if you want to try us out uh feel free to um try for free and that's all for me. We will be happy to answer any of your questions. [Applause] >> Okay, I guess. Yeah.
>> Yeah. Yeah. Yeah. Uh it's available on GitHub. I can put a QR code for the repository back on second. Uh it's somewhere over here. Yeah, solo code is there. Uh you can when entropic is up, you can uh try the multi- aent system and yeah, I probably should have a backup with a GPT or something, but yeah, of course, entropic is down at the most appropriate moment
as always. Yeah. >> Yeah. So I mean uh it really in general depends on the on the task on the context right so uh and the tools available for the LLM. uh but again as
I've shown in the one of the slides here so you can see for example on this uh this benchmark which is considered the one of the most difficult ones uh as the name suggest it's humanist humanist last exam right so it's considered to be one of the most difficult one for LLMs for AI nowadays and as you can see the boost from just vanilla LLM to LLM with tools is what 30% right so it is quite significant given And that
just vanilla lamb can barely solve anything. And you know when we are talking about more um kind of like you know simpler simpler in a sense uh examples simpler queries of course this also gives much much more significant boost uh because um the reality is all the the quality answers is about the context you give to LLM right and if you want to uh get better answers you need to get to give better context and through MCP through tools LMS can
discover that that context on their own so So they can you know decide which is needed and this of course then allows them to give you better results. Yeah. Yeah. Uh so if you're talking about the one in VS code so we have uh I think the one which we have here uh I think
this one is for it's pretty straightforward. is just for you know uh specification for the project right uh so um can you know create diagrams specifications what not but again it's a custom agent so you can define it to uh generate anything you want uh and you know can generate form yeah uh that's a good question uh so um
of course the results might might vary in depending on the code quality and whatnot. Uh we actually recently uh had one of the uh clients and actually I think I have one an agent here which converts Java 1.6 17 uh which was a fun uh fun project. Uh but yeah, of course it the quality of the results all depends on you know garbage in garbage out right so uh the better the the better uh your quality the the better the quality of your code
the better results but at the same time through the tools uh the LLMs can potentially uh understand what's going on without you know without actually having a nonopuscated code right so they can for example execute execute the binary they can uh run the tests whatever they can see what actually is happening Right. And then based on that they can provide you with better documentation and maybe hopefully refactor also the code
for examp uh AI and LMS and MCP is a quite a big topic nowadays and actually have a different talk about this uh you know and I didn't put security in this talk because uh there is not much time unfortunately uh and yeah there are you
can probably probably heard about recent hacks from for GitHub GitHub MCP all right so where it exposed private repositories and you know those there are still a lot to be done on in general on the um AI security side. Uh speaking of our product specifically, uh we do have on premise installation. If you if your company would be interested, we can discuss after the talk. Right? So um but that would of course requires for you to
host the models for example. So that you know none of the code um all right well I mean >> yeah I mean as said we can discuss after after the after the talk right any other questions I guess not all right uh thank you
everyone and hopefully Entropic will be back [Applause] Thank you for >> Oh, thank you. >> I have a question. >> Yeah, this is more uh if you know, do you have direct integration with Spring AI or are you planning to integrate with Spring AI? >> Uh I'm actually not familiar with Spring AI to be honest. So that's >> So there's like a new module released in
Java with Spring. Yeah, I I I thought I thought it was related to drum. Okay. >> Uh and they are sort of doing, YouTube Video L4Q-Momd6ZQ, YouTube, 01kac45cyem8tshy3xm7xa8jwm.