How to build Ai Agent with o3 mini (DeepSeek killer?)

Rory Ridgers builds an AI coding assistant with O3 Mini, a cheaper alternative to O1. Three tools (Code Generator, Code Fixer, Code Translator) connect via Make.com to Gmail, automatically routing requests to the right tool and replying to emails. O3 Mini costs 0.5 credits per 1k tokens versus O1's 22.5.
Chapters
What's up guys, as a lot of you may know, O3 Mini just dropped and I've been playing around with it and it's really, really powerful. It beats O1 on pretty much every single benchmark and it's also way cheaper than O1, so O1 is pretty much obsolete now. I'm going to be using O3 for all of my AI agents. They actually released two different models, O3 Mini and O3 Mini High, and O3 Mini High is meant to specialize in coding and maths and science, and that's what we're going to be using in this video just to showcase it. If you haven't seen me before, my name is Rory Ridgers and I help business owners to integrate AI agent systems into their businesses, so that's something you might be interested in, then I've left a link to my website in the description. You go ahead and book in a call or just fill out the contact form and I'll get back to you. Also, I want to say now at the start of the video, everything that I make in this video will be available as a template for completely free. So if you want to get started with O3 straight away, then you can just grab the free templates in the description. Let's not waste any more time. Let's get into the video. Okay, so in this video we're mainly going to be using Relevance AI and then also Make.com for a small simple automation. What I thought we'd make in this video to show off some of the coding capabilities of O3, because that's what it's meant to really, really excel in, is sort of a coding/software engineer assistant for you that you can talk to via email. So as you can see here, we have 3 different tools. We have the O3 Code Translator tool, the O3 Code Fixing tool, and the O3 Code Generator tool. So all kind of pretty self-explanatory. The Generator tool is going to be able to generate your code. The Code Fixing tool is going to help you fix code and debug it. And then the Code Translator tool is going to help you translate your code between different languages. And these 3 tools are going to be combined into one agent that we can talk to through our Gmail account. If you come over to my Gmail account, you can see I have this Code Assistant label here. All we do is we hit compose. I can just send an email to myself, do the subject as whatever I like, and then if I come down to these 3 dots, hit label, hit Code Assistant, then all the emails that are sent with the Code Assistant label will go straight to this AI agent. So I'm going to show you how all these tools work. All these tools are fairly similar. But I'm gonna show you inside each of them. We're gonna start with the code generator tool. If we hit edit, you can see the only inputs are user request and then message ID. The user request is obviously gonna be whatever the user's requesting to be. So this could be something like you could email the AI agent saying something like, generate me some code for a simple contact form on my website, or generate me some Python code that does this, or whatever you like, whatever code you wanna generate, that would go into this input. And then the message ID. This is going to get passed over from make.com. This just means that the AI agent can actually reply to the email you sent rather than just sending an email into your inbox. So basically the structure for all of these tools is just an LLM step, and of course we are connecting to O3 Mini. And by the way, at the time we're recording this video, it might be different when you guys are actually watching this, there is a rate limit that OpenAI have implemented with O3 Mini. It might be because loads of people are trying to use it, I'm not too sure, but you need to have at the moment a tier 3 API key, which a lot of you may not have. So just be aware that if you're using this on Relevance AI, if you have your API key inputted on Relevance AI, you can see if you have your OpenAI API key input on here and it's doing it through your account, and if you don't have a tier 3 API key, then it won't work. But if that is happening, don't worry, you can just get rid of your API key and then do it through Relevance AI. So basically all we've got here is just a prompt for O3 Mini, and we've said to it You're an AI software engineer. Your task is to generate clean, efficient, and well-documented code based on the user's requirements. Then we've given some instructions here. We've given it the user's request and then the output format. And then for styling, it's just a little bit— I had at the end just to make sure everything sort of has a bit of a modern styling, some curved edges and some slight drop shadows, just so it all looks nice. And then that's going to output the code with a bit of description of what's in the code and how it's working. And then we're going to use a Send Gmail Email step. So really, really simple, send it back to myself. We're going to put the email body as obviously the answer from this step. And then what we want to do is we hit Open Settings, Reply to Message ID, and then we just put the message ID that gets passed through Make.com. And that just means that the AI agent will be able to actually reply to that email rather than just sending an email into your inbox. So really, really simple, we can just fill this out with some demo information. So the user requests, let's say, I want to create a— so I've just said I want to create a HTML toggle button with a cool neon effect. So really, really simple. We'll just see what O3 comes out with here. O3 is actually quite quick as well. I think it's a little bit quicker than O1. I might be wrong, but it just feels a little bit quicker. But it's definitely way better, which is what we want, and it's also way cheaper, which is nice. So this is the code it's given us. Just before I actually render this code, I just want to show you the price difference quickly. If we go to OpenAI If we go to 01 latest here, you can see it's 22.5 credits per 1,000 tokens. If we go to 03, it's 0.5 credits. So it is way cheaper. And obviously if you're doing this through your OpenAI API account, it's going to be even more cheaper. This is just through Relevance AI, but you can sort of see the difference in price there. So we're going to copy all of this HTML code. So if we just render this HTML code here, you can see it's named it Cool Neon Toggle Button. And then you can see we get this nice effect on here. So really, really simple, but obviously it's done it absolutely perfectly, hasn't overcomplicated it or anything, just created a nice neon toggle button, which is really, really cool, looks clean. So now we can look at the code fixing tool. If we hit edit, similar thing again, we have the user request, the message ID. This time we have the user's problem as well. So what would happen here is obviously the message ID going to be the same as the tool before. The user's request would be something like, hey, I have a problem with this code, this part isn't working. Say it's a contact form or something, I have a problem with this, it's not sending this off to my backend or something like that. So that would go in the user's problem input, and then in the user's request would go the piece of code that they've attached with the issue. So the AI agent will split this email that we get through into these different variables— the user's request, and then the user's problem, the user request being the code, the problem being with the specific problem they have with this code, just to give O3 sort of a bit of context on what's going on. So again, we've got a prompt. You're an expert at code debugging. Your task is to analyze the provided code for errors, inefficiencies, and security vulnerabilities. The user will provide their issue with you to help you solve the problem. And then we've got some instructions here on what to sort of look out for, the input code, and then the user's problem. And then just an output format. So it's giving us a— so it's going to give us a summary of the issues, the actual fixed code, and an explanation of the fixes and improvements. So exactly the same thing after that, it's just going to send that back to us on Gmail, obviously using our message ID, so we actually get it straight back to us, which is really, really cool. We're not going to test this out just yet. We're going to test this out when we actually demo the whole agent, just because we have to input some type of wrong code So we're going to test this out after the code translator tool. We can hit edit on that. And again, first two inputs here are pretty similar to the last ones. We have user request and the message ID. Message ID, obviously, like the last two tools. User request, in this case, this is going to be the code that the user wants to translate. So this is going to be— so let's say we want to turn Python into JavaScript, or we want to turn HTML into React. Anything like that, we'd use this tool to do that. So we get the convert from and the convert to in here as well. So it's just going to be the current language that it is and then the language that we want to convert it to. Again, we have an LLM step and we've just prompted it to be able to do exactly what we want it to do. So you're a code translation AI. Your task is to accurately convert a given piece of code from one programming language to another while maintaining its logic, performance, and readability. We've given it some instructions, we've given it the input code and then the convert from and then convert to and the output format. It's going to be the translated code and then an explanation of the differences and then exact same thing again. I'm not going to show you this, we're just sending it back to ourselves via Gmail with that message ID in again. So you can hit save and now we can show the agent that sort of puts all of these tools together. So it's called the O3 Coding Assistant. If we come over to the agent profile, you can see we've just given it a name, an agent description. This part doesn't really matter. If we go to the tools, we've obviously got those 3 tools that we just looked at. Make sure to set these from approval required to auto run. And then the core instructions, nothing too crazy here. We've just said you are a coding assistant for the user. You will be triggered by a Make.com scenario with an email from the user, and using your tools, you will either write new code, debug code, or translate code to a new language. By the way, don't worry, I'm going to show you the mate.com scenario. It's really, really simple though, so don't worry about that. And then the task— when you're triggered, you'll receive an email from the user asking to either write new code, debug their code, or translate their code. Your job is basically just figure out what they're trying to do and then use the correct tool, because in the tools it will get emailed off. So all the agent really has to do is just sort of work out what the user actually wants to do and then input the data correctly into those tools. You have to extract the code from the user's email request and input that into the tool. I'll give you a breakdown of the tools now, and I've just given it a really, really simple breakdown of how to use each 3 of these tools, what inputs it has to put in all of them. You can pause the video and read through this, or again, you can just get the template in the description, and obviously this prompt will be preloaded. But basically we're just saying what the tools do, how to use them, when to use them, what the inputs are for them. So we hit save change on that. I'm going to show you now the Make.com scenario. Because it's really, really simple. All it is is just a Gmail's Watch Email step and then a Relevance AI step to actually trigger the agent. So if we go into the Gmail step, what we've done is we've filtered out, so we're looking at just this folder, Code Assistant. I felt like doing it this way because that means that Make.com doesn't have to look at your whole inbox and kind of wonder which emails are meant for the coding assistant, everything like that. If we put it all in just one label, really, really easy. You can just attach this label to the emails that you want to send to the AI agent. So we put that folder in there, and then simple filter, the criteria all mails, mark email messages as read when they're fetched. You can if you like. I'm probably going to flick that on actually. Maximum number of emails is just 1. And then this Relevance AI step, the role is user. All we're sending over is the message that we get from the email. So this will look like this, the text content, and then the message ID will be the, yeah, Gmail message ID here. It's going to allow us to reply to that exact same email then we just put in our agent ID. If you don't know how to get your agent ID, it's really, really simple. If you just go to Edit and then go to Agent Profile, click on API, and then we get this request body here, and in that it gives you your agent ID. So you just copy that, paste it into this input here. So really, really simple. Basically what's going to happen now is we can send off an email, put it in the Code Assistant label, and then that's going to go through the Make.com scenario gets sent off to our Relevance AI AI agent, and then the agent is going to send that email back to us with the new code, the revised code, whatever it's been doing. We're just going to say to it, I want you to create me a Python script that simulates a chess game. So we're basically going to try and get it to recreate chess with Python and see what comes out. If we hit more options, go to label, code assistant, send this off, and then we're actually going to manually run this in our make.com scenario just so you can see it working. Obviously this would be running automatically. So hit run once. You should see it should have picked up— yeah, I want you to create me a Python— it's been cut off there, but this is the email we sent off. So triggered our AI agent, it's now using the O3 Code Generator tool, which is perfect. We're gonna give this a second and see what it comes out with. Okay, so it's just finished using the tool, and then you can see if we come over to my emails, this is what it sent back to us. So below is a complete Python script, uses the Python Chess Library for game rules and the PyQT5 for a modern GUI with curved drop shadow buttons representing chess squares. Before running the script, install the dependencies. And then this is the code it's given us. It's given us sort of a breakdown of what it is and then the packages to install. And then it's given us the actual Python code here. So this is really cool. I mean, there's quite a lot of it here. So I've just pasted all this into a Python code editor, and what I'm going to do is I'm going to try and delete a bit of it and then send this back to the AI agent and say, hey, this doesn't work, and see if it uses the code fixing or code debugging tool and then see if it can output the right thing. So we're going to choose a random bit of this. We're going to choose to get rid of this part here, and then we're also going to get one more bit. Let's just say this part here. Not too sure what I've actually deleted here, but hopefully that should mess it up enough for O3 to know kind of what we've done and then hopefully be able to fix it. So I've just said to it, this Python script is meant to run a chess game, but it doesn't work properly. And then I've just pasted in that full Python script where I deleted those bits. So we're going to hit more options, go to label code assistant, and then we're going to send this off. So this has just been sent off to our AI agent, and then it's working. Now we should see it using the code fixing tool. So we'll give this a minute and we'll come back when it's done. Okay, so this is what it's just outputted back to us. Here's a summary of the issues: the square buttons are not stored in the self.squares dictionary, so update the board and reset selection methods cannot update them. The click signal button for each button is never connected to the handle_square_click slot. The update_board method is incomplete. I'm not going to read all of these out, but these are the issues it's found, and then it's given us this full fix code here. This obviously should be the working code, but what we're going to do is we're going to send this back to the AI agent, try and get it to convert it into JavaScript, and see what it comes out with. So by the way, at the bottom here it gives us a little explanation of the fixes and improvements that it made. Obviously amending the things that we got rid of in the first case. So really simple, I'm just sending one back off again saying convert this code, convert this code from Python to JavaScript, giving it the full code here. I'm gonna hit more options, label, and then code assistant, send that off, and then we're going to see what it comes out with. Okay, so the AI agent has received it. This is all the code, convert this from Python to JavaScript. It's going to use a tool and then we're going to see what it comes out with. Okay, so this is what output to us. Obviously it's put this JavaScript code into some HTML code Weirdly, when it gets sent over via email, I think Gmail kind of has a weird thing with rendering HTML. It will render HTML sometimes, but then I think if you put JavaScript in it, it doesn't really work. I'm not too sure, it's something I need to look at with this agent. But it's not really a massive deal because mainly what we're trying to do is show off the coding capabilities of O3 Mini. So if we just copy and paste all of this, and then we can just quickly render this, and you can see here we have this full working chess game. So we can move the pieces like this. Obviously you're meant to play with someone else. And then let's see. Okay, yeah, so it doesn't let us move these pieces illegally. It knows how you're meant to move the pieces, which is cool. So we want to move the queen out here and then let's move that one. Then we can get it with the queen. So yeah, I'll be really cool. We've managed to get it to generate Python remove bits out of the Python to basically break it, send it back, say fix it, and then say turn this into JavaScript. And it's managed to do it. And that's also managed to render it in HTML. So really, really cool. See, there's way more things you can do with this. I'm not the best coder myself. Some of you guys that know way more about coding, we have to get a lot more value out of this. But I just thought this is really, really cool for someone who doesn't really know a great deal about coding, like a lot of you that are watching this video. Probably won't. Something like this is absolutely amazing, and it's actually really affordable compared to things like O1. So that is it for this video. I'm really, really excited to see what you guys build with O3 Mini because it is a super powerful model, probably the most powerful model we've seen so far, and also is really, really cost effective. I think maybe OpenAI has probably done this because of the release of Deepseek. Maybe not the API cost, but I didn't mention, but it's free if you just use it through the web interface. If it's free for free users. And then if you're a paid member of ChatGPT, I think you get more queries a day. I think it's about 150 queries a day or something like that. I might be wrong, you can fact-check me. But yeah, this is a massive leap forward in LLMs in my opinion, and I'm really, really excited to see sort of what gets built with this and what people do with this model. As I said at the start of the video, all the templates will be available for completely free that I used in this video. And also, if you did want to work for me so we can implement AI agent systems into your business, then I've left a link to my website in the description. Go ahead and book in a call with me or just fill out the contact form. If there's any AI agent videos that you guys would like to see with Deepseek or with O3 Mini or with something completely different, then please do just let me know. Drop it in the comments or send me an email and I'll try my best to do them.
More from Rory

Dynamic Workflows are crazy. This is how to actually use them (beginner's guide)










