
To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/DevelopersDigest . You’ll also get 20% off an annual premium subscription. In this video, I introduce Micro Agent, an innovative open source project from Builder.io that allows you to create functions using natural language right in your terminal. I'll walk you through the entire process, from installation to generating a function along with its unit tests and code. 0:00 Introduction 00:59 Getting Started with Micro agents 03:10 Sponsor Message: Brilliant 05:20 Continued Demonstration 07:40 Conclusion and Final Thoughts This video was sponsored by Brilliant
--- type: transcript date: 2024-07-12 youtube_id: 29wuenCwWa0 --- # Transcript: Micro Agent: Create Functions with Natural Language in Your Terminal in this video I'm going to be showing you microagent which is a new open- source project from the team over at builder. they will allow you within your terminal to create functions with natural language and the way that it works is it will go through this flow of as soon as you type in what you want to have as a particular function it will generate a unit test for it from there it's going to generate the code and then it's going to see did it pass all of the tests within our unit test if it doesn't it's going to go and generate the code with the particular errors and then this step is just going to keep happening until it passes or it gets stuck if it gets stuck with the same errors repeatedly it will just exit out otherwise it's going to complete and by the end of it you'll have your test file as well as your working file for your code and if you're starting to wonder okay how will this work for certain test Runners and all of that you'll see how you can swap these out and how it interacts with your shell and all of that in just a moment here to get started you can head on over to the open source repository you can just scroll down to the instructions here this is going to be based on node.js you will have to have at least node 14 installed for this to work the first time that you run this you can just copy this command and then you can paste it within your terminal just like this so now that we have it installed what I'm going to do is I'm just going to bun andit dasy a new project here and what that gives us is just a boiler plate for a new project and then you can do is you can just go ahead and run micro AG if it's the first time that you're running it you will have to plug in your API key but you won't have to plug it in each time that you're going to be running this you'll also be able to access this anywhere on your computer since this is installed globally in this case I'm just going to go over and grab a simple leak code question here and we're going to see if it can generate a function and all of the predict test cases for this I'm going to paste that in here right off the bat it asks you okay is this a file that you want to create or you want to edit it in this case we are going to be creating it it is nice that it allows you to tie into pre-existing files if there's something that you don't like about it you can give feedback otherwise you can just say good it will generate that test file for us then it's going to ask you what do you want to use to run the test of your code so in this case let's say I don't want to use MPX I want to use bun I can copy that lad half and then I'll just put the lad half at the end of my bun command here the first time that it runs it does fail because because it doesn't find the file so we see that the test files did fail here and then at this point it's going to generate the code for us we see the plan we see the analysis we see the implementation there and then we see a little bit of the description then it's going to update that code file for us right off the bat we see that it did pass our test file it did pass all 10 tests and it passed in 200 milliseconds so if I just list these out here we will see that we do have our two different calculate Target indices if we want to look into the particular test we can do that as well you can just go down to your test open that we have all our different tests the thing I really like about this is it's very narrowly focused it's not one of these agent tools that's trying to solve a bunch of stuff where it's too General and it starts to run off the rails just a pretty brilliant implementation of almost an introduction into agents it's not trying to do too much but it is also able to do relative well what it's designed to do and speaking brilliant I want to thank today's sponsor which is brilliant.org brilliant is where you learn by doing with thousands of interactive lessons in math data analysis programming and AI it's a platform that's designed to be uniquely effective to learn often complex tasks each lesson is filled with Hands-On problems that helps you solve the particular Concepts within that course it's proven to be six times more effective than watching lecture videos if you want to solve problems from first principles brilliant helps you think through all of the different complex pieces of how different topics Works brilliant helps you build your critical thinking skills through problem solving and not just memorizing things like you might have done in college or university the other nice thing with brilliant is it develops that daily learning habit and have Real World Knowledge in just minutes a day in these fun interactive lessons for at the grocery store you can pull up do some exercises instead of just scrolling endlessly through Twitter they have a ton of great content one of the ones that I'm doing right now is how llms work which is an immersive AI Workshop that lets you experience and harness the the mechanics of today's most advanced tools you can start to understand how an llm works from how it builds vocabulary how it chooses their next word and more you'll begin to understand training data comparing different models that are trained on different sorts of data to try brilliant they have an offer today for 30 days for free a complete free trial you can visit brilliant.org developers digest just like the link shows and I'll put this within the description of the video as well you'll also get 20% off your annual subscription if you choose to become a member let's go back to the problem list and let's go to a hard Elite code problem here so let's copy this over here we're going to run this again we're going to say microagent and we're going to paste in our instructions we're going to say that this is going to be a new file we see the initial test we'll do a quick scan we'll just say this looks good and then again instead of using npm I'm going to type in bun here it fails because it actually has to generate the code for us and it's going to start to create the solution for us so again it runs and passes all of these tests let's just try one for ourselves here let's say micro agent and I'll say I want a function that removes back ticks from a string and to say okay remove back ticks it's generating the test for us we'll say good once again we'll use bun we see the steps it's running through all right so now we see that it did fail the second time here it's invalid JS syntax we'll scroll down here your test command is failing with the same error several times so if it starts to run several times with the same error will error out so you're not recursively just burning all those tokens as a feature where some of these other Frameworks for these Auto agents that came out over the past year is a lot of them they would just run and some of the feedback that I would hear is they'd be really expensive really quickly if you weren't monitoring them this is nice where it just has a little fail safe where if it detects that there is something that might be going wrong that involves some human intervention you can go ahead check out the different files or you can edit it from there but otherwise that's pretty much it play around with it there's a ton of really good documentation within the readme here on how to get started there's also a visual matching feature within the repo which could be interesting to check out here where the micro agent will help say if you want to pass in an image and begin to implement that Design Within code you'll be able to do that within micro agent it does say that this is an experimental feature if you are going to be using it they encourage you to use the anthropic API key because it is particularly good for the visual matching feature you can try that out if you're interested really great project from the team over at Builder iio that's it for this video if you found this video useful please like comment share and subscribe otherwise until the next one
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.