0:00Last week, I vibe coded Bluey, an iOS app that connects to my computer, follows my mouse, and acts as a little agent that can point to things on my screen, and say things. Well, today I'm going to turn Blueie into an app that helps me with my ADHD, and keeps me on track. Okay, so here's the plan for the day. We're going to talk about what Bluey is now. We're going to talk about what I want Blueie to be, which will be a little focus friend. And then we're going to talk about how we're going to create this focus friend using the
0:28decisions API. And then we're going to just build this new version with codec.
0:33And you can follow along and build your own version of Bluey because Bluey is fully open source. So the first things first, what is Bluy? What is this app that I made a few weeks ago? I have my old phone that was just sitting around doing nothing and I wanted a way to use it as an extra screen with my computer in a unique, fun, and a simple way. And I wanted it to feel like a little companion. For those of you who have ADHD, you know that if you have someone
1:01around, something about it, it just makes it easier to focus. And so that's kind of my vision. When I originally created it, I just didn't think about it well enough. And so basically when I hold Bluey down and ask it a question, it points to the part of the screen and leaves a little comment directly on the screen and makes a little cute noise.
1:20Hey, can you point to the computer monitor?
1:27What else should I add to this about Bluey?
1:36Can you research the decisions API? Um, I want to learn more about it.
1:44And so look, it can even do some research here at the top. And so it can do a little research. And so the way Bluey is controlling my desktop computer is it's using a different OpenAI API which is called OpenAI Realtime API or GPT realtime 2.1. And so it's also using uh GPT40 transcribe. This is my voice to text
2:12when I hold down my phone. Hey, uh, can you please point to the little blue character on the screen?
2:24You see what it's doing here is when I hold down my phone, it records my voice from my phone and then it uses this GPT real time to control my screen. Now, you might be thinking, wait, this is my phone running below my computer, right?
2:39This right here is my phone. This right here is my computer. How are they communicating? Well, I asked AI last week. I said, I want to build an iOS app, right? And so, Bluey is the iOS app. And then there's also a desktop app, which is a Mac app running on my computer. And you can see this is running right here. When you set up this app, you can very easily scan a QR code and connect your phone to the desktop app. And so they work together. And so
3:09that's why it can follow my mouse around. It can literally it's sending data from the Mac app to the iOS app, which is where Bluey should be looking at all times. And it makes it feel like you almost have like a little buddy there watching you as you work, which is kind of fun. And so the Mac app and the iOS app are inside of a mono repo which is in this GitHub link. And all that means here is the Mac app and the iOS
3:37app lives inside this repository. So all the code you need for both apps are right here. And so basically Bluey right now is just cute. It's kind of vague. It doesn't really have a purpose. It can do some things. I guess it can kind of search the internet, but I don't want it to be this general thing. I want it to be practical, purposeful, and solve a specific problem while maintaining its cuteness. Okay, so now for the technology behind this new version of
4:06Bluey, and we'll call it focus Bluey.
4:08And we're going to be using the decisions API. So the decisions API is a specialized inference API powered by GBT6 Luna designed to help apps make fast focused decisions. You give it context and a specific question and it can return a probability, pick from options you provided or give you a score and your app then uses that result to decide what happens next. Said another way, the decisions API turns text and or
4:35images into small specific decisions for an app that you use or one that you create. And what makes the decisions API really interesting is the output is free. There's actually no output cost when you use the decisions API. The decisions API gives you an answer based on a set of possible outputs that it can have. So it basically just makes a decision. It doesn't output any text.
5:05And there's actually three types of outputs it can give. The input is text can be text and images. But there's three types of outputs. And the first one is called predicate. and a predicate estimates the probability that a statement is true. The second one is called a choice. And the choice basically selects from options you define with probabilities, right?
5:35Probabilities for the options and a confidence score. And then the third and final output is called the score. And I guess which basically means like rating something on a scale you define. And so what we're using for this video is choice. So we're using this specific type of output. And so let me explain what I mean by this. Bluey is going to
6:04be running below our computer. And this is just a little character on a spare phone that we have. I'm going to be able to hold it down and tell it what task I'm about to do. And then it's going to start a timer. And the timer is going to show up here at the bottom right. And then it's going to list the task up here. Now, what this app is going to do, it's going to take a screenshot of my computer every 30 seconds. And we're also going to have a system prompt. So,
6:32every 30 seconds, a prompt plus a screenshot of whatever I'm doing on my computer at any given time. This will be sent to the decisions API. Sorry, I spelled that wrong. It's okay. It's going to be sent to the decisions API and there it's going to make a choice.
6:53And this is very fast and very cheap.
6:56It's either going to be on task, off task, or uncertain. And then we're going to have AI. I'm going to have Codeex come up with some algorithm as to when Bluey should intervene with whatever I'm doing. I don't think if it's if it says that I'm off task. I don't think that every time it deems me off task, it should intervene or comment on it. Maybe he like gets a little more conf it gets a little confused look, but it should
7:25actually intervene and stop me after I've shown repeated like repeatedly off task. So like every 30 seconds it'll basically fill a database of like whether like he's off task on task and the algorithm can also factor in these probabilities for the options. It'll basically say like he's on task 100%. If I go to blueie and say all right for the next 30 minutes I'm going to be working
7:52on my video script and 100% confidence score would be like would see that I literally have the script open and I'm writing and that would be 100% probability. But maybe I'm doing research on a topic that's related to the essay. And so we need to figure out a way to do this in a smart way so that it doesn't get annoying with how much it intervenes, but if I'm clearly off task for like 5 minutes, it should definitely intervene and try and nudge me to get back on track. And so that's the point.
8:20And so the decisions API, what's really cool about the decisions API is it's incredibly [snorts] cheap. You can see that a 100 screenshot checks is a scent. Eight hours every 30 seconds is 9 cents. So that means eight hours of focus costs about 10 cents, which is pretty cool. Okay, so now that we know what the decisions API is, we are going to talk about the prompt that we're going to run in codeex. And I think we can oneshot this app using the decisions API by OpenAI. We're going to
8:50want to put in the link to the docs for this. Um, but here's the prompt that I'm using. rework my existing uh Bluey Mac OS and iOS apps into a focus companion still called Bluey and I'm giving it the GitHub repo. You can use this GitHub repo. If you want to clone this app, you will need an OpenAI API key uh link in the description for that. And it's going to be uh read the repo and attach grants first and reuse the current architecture blah blah blah blah blah. So, it's going to reuse all the features that we have already. Now I want to change the
9:19purpose of Blueie will become a focus friend monitoring my screen and when I'm off task it lets me know I'm off task and points at the thing when it makes a comment that should be sort of playful and funny like hey this doesn't look like current task that you're doing and I just kind of describe it how it's going to work every 30 seconds have the Mac capture a screenshot and send it with my task elapse time and idle duration and recent check history to the decisions API cuz Remember, all of this
9:48will be sent as an input. So, I'm going to have codec come up with the right inputs. So, it's going to be screenshot plus certain inputs, and it's going to be judge the activity in context.
9:57Watching a codeex tutorial can support making a codeex video while unrelated entertainment may not. So, it's I'm either on remember I'm either on task, off task, or it's unsure. And each of these will be rated on how confident the decisions API is at whether or not I'm on task, off task, or unsure. And so we're going to be implementing the nudge logic in the app. So allow for brief detours and only interrupt after repeated confident offtask checks
10:26spanning at least 2 minutes if close to 100% certain. If it's like in the 50 to 80% certain range and not fully certain the user is being off task, maybe it's every 3 to four minutes. And I'm saying come up with an algorithm to determine when to intervene, etc., etc.
10:42Implementing a short cool down between nudges. That's what I want to do. And then we're just going to build the full app end to end. So that's basically a quick overview of the prompt. All the prompts will be linked in the description. Now what I'm going to do is we're going to go back to chat GPT here.
10:58And now what we're going to do is we are going to build the app. So I'm just going to enter this prompt here. And I'm just going to say update the apps and let's test both of them and get them running on computer and phone. So this we are using GPT 6.1 soul extra high.
11:22This will probably take 10 to 20 minutes. So I'm going to wait a little bit and we'll see how it does. Okay, so it just worked for 18 minutes. And I'm going to make my phone a little bit bigger. So my phone is actually below my computer, but I'm screen sharing it on my computer, so it would kind of show up below the computer here. So this is what it looks like. Now, it says on your iPhone, pair the Mac or scan QR code.
11:49And so I think we need to come up to Bluey and I think we need to pair iPhone. There we go. So, I'm going to go ahead and leave this up. Now, I'm going to grab my phone. I'm going to hit pair allow. Did that work?
12:08Okay. So, we are paired. So, Bluey integration test build focus friend Macup. Okay. Okay. Hey, buddy. I want to start a task now, which is building an app using codecs. It is an app that allows me to talk to my phone. It's a little bluey app.
12:28There we go. All right, let's build Bluey. Eyes on the prize, mate. And look at this. So now you see pause, end, and focus here. And remember, this is below my screen right now, but it's like pair your Mac and focus together. And it should be focused. So now what I want to do here, I'm going to be building an app with chat, GPT, and Codeex. And I want to do this for five minutes.
12:54Okay, there you go. So, look at this.
12:57It's kind of small, but it's showing a timer for 5 minutes. And let's just tell Codeex all of these things. So, the things that I want to change is I need the a timer on the bottom right. That's big white text that has the timer. The timer is way too small. And then make the pause, end, and focus buttons like little icons on the bottom left. And yeah, those are the changes that I want you to make. And then the listening hold to ask. Make it an icon. Put it on the
13:27bottom left as well. Maybe we don't need that. But I want the timer to be the main focus for this. Yeah. So make those changes.
13:37Okay guys, so it's done. One thing I added was a little developer mode. So I wanted to make it faster so we can actually test it faster. So it'll actually moves at 4x the speed. I want to start a task real quick, which is to use chat GPT codeex to build an app.
13:55Creating my little blue character.
13:59Okay, so it's now working. If we go to focus mode here, we should see Okay, so we are on task for the first one. Um, let's go back to Bluey here.
14:17Now, what I'm going to do is I'm going to go off task and let's see what it looks like to be on Twitter.
14:28Hey, this doesn't look like Chat GPD codec. Shall we hop back to Blue Buddy app? There we go. So, it's nudging me to get back on task. There we go. Okay, so we're still off task. Okay, so this is cool. It's working. And let's go ahead and stop. And so here is the session.
14:50It shows that we did it for 7 minutes and 30 seconds and it shows how we did for each part and we were off task for most of this session here. So this works. We got our app working. And so it basically decides every 30 seconds with the decision API whether we are on task or whether we are off task. All right.
15:09So here is the app now that it's done.
15:13It sits below my computer screen. I have it set up on this little like magnet thing. I can put a link in the description to better options. We have Louis here. Hey little guy. I just want you to know that we need to work for the next 20 minutes on writing an essay.
15:33So, it created the timer. It's on dev mode, so it's moving pretty fast. And now I can just work on the thing that I'm working on, right? I can just do whatever task I want to work on. And right now it might think that I'm on task because we are on the Codeex app.
15:47But if we were to go to Twitter, let's see if it intervenes if we're on Twitter.
16:01Look at that. Hey, this doesn't look like writing an essay. Shall we hop back to the draft? There we go. Bluey works.
16:10And we can always view our progress.
16:12Right here we can see a summary of when we are on task. That's the green. And then the brown is when we are off task.
16:20And it keeps track using the decisions API. And that is really cool. This is now our little focus friend bluey that I can very easily connect just by scanning a QR code. It's that easy. And I'm just going to say okay, push this to GitHub and update all the changes. And you guys will be able to create your own Bluey.