How to build agent-native apps (and what to avoid)
By Steve (Builder.io)
Summary
Topics Covered
- Highlights from 00:00-01:16
- Highlights from 01:05-02:27
- Highlights from 02:14-03:19
- Highlights from 03:13-04:14
- Highlights from 04:09-05:04
Full Transcript
This is the biggest mistake I see people constantly make when making AI applications. Let me show you how to
applications. Let me show you how to make this substantially better. First,
we need two new things. We need tools and a loop. Because LLMs can't do anything on their own, but you can provide them tools like for an email app, it could be draft email, search emails, etc. And so, you send a call to
an LLM, it'll send back what tools it wants to run. Those tools will execute and the results will be sent back to the LLM on a loop until things are complete.
You can introspect each step. You can
output each piece to the UI like progress. But this still has one massive
progress. But this still has one massive issue. We're still assuming the AI is
issue. We're still assuming the AI is correct. In this case, we're just
correct. In this case, we're just running through a loop and then doing something with the results without giving users a way to give that feedback that we know is so critical for non-deterministic systems. So, the better thing you could do is this. Make
sure you build a UI that shows the streaming result as the agent is outputting things. Give users a way to
outputting things. Give users a way to stop it, give feedback, cue the next message. This is sort of the
message. This is sort of the state-of-the-art today, but I actually think we can do one solid step better.
The reason why things like cloud code, co-work, cloud, etc. are so powerful is there's a lot more customization you can do of your agents. You can give them all kinds of custom instructions unique to you and your use case and your project.
You can give them additional files as context that they can reference right from file system. You can give them skills. They can keep track of their own
skills. They can keep track of their own memory as they learn and improve. These
things can make a crazy difference and are a big reason why cloud code is exploding so much right now. But you're
probably wondering, how do I provide all of that in my application? It's a lot to build. I've personally come to the
build. I've personally come to the opinion that this is the better pattern that pretty much every application should adopt if possible. But it is true it is complex to build a cloud code fitted for your application that is
userfriendly, has the right permissions and guardrails and just generally makes sense. I've been working on an open
sense. I've been working on an open source project called agent native. It's
very early but it does a couple interesting things. The first one is
interesting things. The first one is your application is defined as a set of actions. These actions are exposed over
actions. These actions are exposed over APIs. So your friend will use these same
APIs. So your friend will use these same actions like for email, search mail, draft mail, etc. And these core actions the agent can use as well as tools. The
agent has a bunch of built-in stuff that'll show you and you render the agent chat and workspace anywhere you want in your application. And then users can chat with that or you can send messages to the agent from other parts of your app because a great part of
applications versus pure agents is you could have workflows and have buttons that give users guidance. But again, you don't want those buttons to just make an LLM call and just dump a result somewhere. You want them to go through
somewhere. You want them to go through an agent. So you can look, modify, give
an agent. So you can look, modify, give feedback. It's influenced by those
feedback. It's influenced by those instructions, skills, and other customizations. And then if the output's
customizations. And then if the output's not right, you can go back to the chat, tell it what it did wrong, get it right the next time. Of course, you need some basics. You need the agent and the UI to
basics. You need the agent and the UI to always be in sync. When the agent makes updates, the UI updates, and vice versa.
And that's what the framework provides.
So we have our standard chat, but we also have our workspace. The workspace
is like a cloud code or co-workspace where you can have your instructions and skills and memories. You can add files, you can add sub agents, you can really customize it. And this is stored in a
customize it. And this is stored in a way where each user can customize their own experience however they want their agent to behave the way they want in your app. And at the organization level,
your app. And at the organization level, you can set standards too. Then when you chat with the agent, it respects those things. So I can jump in and say add a
things. So I can jump in and say add a new revenue dashboard. And based on how I set it up, it might know what all those things mean and start doing the right queries and calling the right tools to do that. And that's cool and all. And we can go into full agent mode
all. And we can go into full agent mode where the agent fills the screen. And
it's kind of like using a chat app entirely. But I mentioned applications
entirely. But I mentioned applications have a lot of value too. And I see people treating these things as way too either or when I generally find most applications are better with a built-in agent. Most agents are better if they
agent. Most agents are better if they have UI capabilities. As you've seen in things recently like cursor, codeex, cloud code. These tools can all generate
cloud code. These tools can all generate UIs kind of, but again they don't work like an application. If I'm using an agent for analytics, I will want it to save certain views as a dashboard. I
want to choose who has access to the dashboard. I want it to work like an
dashboard. I want it to work like an app, but I don't want to lose any of the agent affordances. I also want buttons.
agent affordances. I also want buttons.
And what's cool is the buttons can take prompts. When we say something like make
prompts. When we say something like make me a traffic and signups dashboard, when you submit that gets delegated to the agent. You can see the agent work. It
agent. You can see the agent work. It
works identically to all those cloud code and other products you're used to, but it's native to your application. In
this framework, the agent can also see what's on your screen, update what's on your screen, navigate you to other pages. And generally speaking, if the
pages. And generally speaking, if the UIs can do it, the agent can do it. And
if the agent could do it, the UIs can do it. And this doesn't require any super
it. And this doesn't require any super complicated like container setup where you have dev boxes and you're running machines on them. You can deploy this anywhere. You can use any LLM that you
anywhere. You can use any LLM that you want. You can use any Drizzle compatible
want. You can use any Drizzle compatible database. So any SQL database
database. So any SQL database effectively and it's pretty easy to use.
At least I think so. Now whether you want something all-encompassing like this or you just want to integrate into an existing product, I hope this ladder of sort of good, better, best is helpful. If you want to try out Agent
helpful. If you want to try out Agent Native, it's over on GitHub. Totally MIT
licensed. There's a bunch of example apps you can just try out and get a feel for it. And while it's super duper
for it. And while it's super duper early, I'd love your feedback both on the general concept and if you try it on the implementation. But what do you
the implementation. But what do you think? Do you think applications are
think? Do you think applications are better off not integrating agents or agents are better than applications and nobody will have a UI in the future?
It's just going to be agents and text and Telegram. That's the only way you
and Telegram. That's the only way you ever use products. Love to know your thoughts in the comments. Let me know.
Loading video analysis...