Skip to main content

Agent-Native Explained: Builder.io's Framework Where AI Agents and UI Share the Same Actions

What Agent-Native is, how its define-once action layer lets an AI agent and your UI share data and state, what's included, and where it fits.

November 29, 202611 min readNiraj Kumar

Introduction: Why Bolted-On AI Chat Falls Short

Most "AI features" I see in SaaS products follow the same pattern: a chat panel in the corner, wired to a handful of special endpoints someone wrote for the model. It demos well. Then the product grows, the UI gains features the agent can't reach, the agent's endpoints skip a permission check the UI enforces, and the two slowly drift apart. Users learn that the assistant can only do some things, and they stop trusting it.

The other approach, letting the agent drive the UI by clicking through it like a human, is slow and fragile. Neither treats the agent as a real user of the application.

flowchart LR
    subgraph Bolted["Bolted-on AI chat"]
        direction TB
        U1[UI] --> API1[App API]
        C1[Chat agent] --> AI1["Special AI endpoints"]
        API1 --> D1[(Database)]
        AI1 --> D1
    end
    subgraph Native["Agent-native"]
        direction TB
        U2[UI] --> ACT["One action layer<br/>validation + permissions"]
        C2[Agent] --> ACT
        ACT --> D2[(Database)]
    end
    Bolted ~~~ Native

On the left, two code paths reach the same data and drift apart over time. On the right, there's only one.

Agent-Native is Builder.io's answer to that problem. In this post I'll walk through what it is, how the core idea works, what you get out of the box and where I think it fits.

What Agent-Native Is

Agent-Native is, in the project's own words, "an open source framework for building apps where AI agents and UI share the same database, actions, and application state."

The key facts:

  • Built by Builder.io, published as BuilderIO/agent-native on GitHub.
  • MIT licensed and written in TypeScript.
  • Bring your own everything. The README puts it simply: "Bring your LLM, SQL database, tools, and infrastructure. Everything you build stays yours."

The framing that stuck with me comes from Steve Sewell's post on building agent-first apps, which calls these apps "agents with faces": an agent that does real autonomous work, paired with a purpose-built UI where people can inspect, edit, approve and share what it did.

The Core Idea: Define an Action Once

Everything in Agent-Native revolves around actions. You define each capability once, and the framework exposes it everywhere. As the README says: "Define each capability once as an action: the agent uses it as a tool, and the UI calls it from code."

Here's the example from the README:

ts
import { defineAction } from "@agent-native/core/action";
import { z } from "zod";
 
// One action powers every app surface: UI, agent, HTTP, MCP, A2A, and CLI.
export default defineAction({
  description: "Return a friendly greeting.",
  schema: z.object({
    name: z.string().default("world").describe("Name to greet"),
  }),
  http: { method: "GET" },
  run: async ({ name }) => {
    return { message: `Hello, ${name}!` };
  },
});

The description and the Zod schema are what the agent sees when it decides whether to call the tool. The schema also validates input from every caller, and the http option sets how the action is exposed as an endpoint. In a real app, run is where your business logic and database writes live, and it runs the same way whether a button or the agent triggered it.

For a real feature, say a create-task action, that one definition powers every surface of the app:

flowchart LR
    UI["React UI"] --> A
    AG["Built-in agent"] --> A
    HTTP["HTTP clients"] --> A
    MCP["MCP clients<br/>Claude, ChatGPT"] --> A
    A2A["Other apps<br/>via A2A"] --> A
    CLI["CLI"] --> A
    A["defineAction: create-task"] --> V["Schema validation<br/>+ permissions"]
    V --> R["run()"]
    R --> DB[(PostgreSQL)]
SurfaceWho uses it
UIYour React components call the action directly from code
AgentThe built-in agent sees it as a tool
HTTPAny backend or script can call it as an endpoint
MCPExternal agents such as Claude or ChatGPT connect through the app's /mcp URL
A2AOther agent-native apps discover and call it agent to agent
CLIYou can run it from the terminal

The important consequence is spelled out in the README: "The agent does not click through the UI. It works through the same action layer as the UI." There's no second, thinner API for the model to drift away from. Or, as Sewell puts it: "Anything the UI can do, the agent can do, no matter what."

The README also mentions per-action controls for sensitive output, such as keeping a result out of chat history (persistInChatHistory: false) or out of the browser cache (persistInBrowser: false). The model call that's running at that moment still receives the result.

If you've built tool-calling agents before, this will feel familiar. It's the same discipline I recommend in Designing AI Agents: Tools, Patterns, and Pitfalls, with typed schemas like the ones in Self-Healing Tool-Call Loops with Zod. The difference is that the framework makes the tool layer and the app's real business logic the same thing.

Shared Data and Shared Application State

Sharing actions is half the story. The other half is that the agent and the UI work on the same data and know about the same application state.

  • Shared data. The agent reads and writes the same SQL database the UI renders from. When the agent creates a task, it's in the list the user is looking at. There's no copy to sync.
  • Shared application state. The agent knows what the user is looking at: the current page, the selected record, the active view. "Summarize this" or "move these to next week" works because the agent knows what "this" and "these" are.

That second point is what makes an in-app agent feel like a colleague rather than a search box. Most bolted-on assistants have no idea which record you have open, so users end up pasting IDs into chat.

Here's how that plays out, conceptually, for a simple request. The exact mechanics of how state reaches the agent are a framework detail, so check the docs for those:

sequenceDiagram
    participant U as User
    participant UI as App UI
    participant AG as Agent
    participant ACT as Actions
    participant DB as Database

    U->>UI: Select three tasks
    UI-->>AG: Shared state: current view + selected IDs
    U->>AG: "Move these to next week"
    AG->>ACT: update-tasks(ids, dueDate)
    ACT->>DB: Validate, check permissions, write
    DB-->>UI: Updated tasks
    UI-->>U: List shows the new due dates

What's in the Box

Beyond actions, Agent-Native ships the pieces you'd otherwise build yourself before your agent could go anywhere near real users:

FeatureWhat it gives you
Agent chatA built-in chat interface wired to your actions
Auth and permissionsUsers, organizations and access control that apply to the agent too
Skills and memoryReusable instructions and persistent memory for the agent
AutomationsScheduled or event-driven agent work that runs without a user present
Agent teamsSpecialist agents in one workspace, or connected across apps
DatabasePostgreSQL in production, PGlite for local development
/mcp endpointConnect any app to Claude, ChatGPT or other MCP clients
/visual-edit and /remixEdit a running app on a canvas, or rebuild an effect you saw elsewhere in original code

Sewell's post also mentions Slack and Telegram access to your agents and a rich Notion-style editor that you can import or eject into your own code, similar to how shadcn components work.

The agent teams idea deserves a note. Builder.io argues for several specialized agents over one agent with every tool, because a huge tool list bloats the context window and makes the model worse at choosing. That matches my experience. In Agent-Native, apps in the same monorepo can discover and talk to each other, which is the agent-to-agent (A2A) pattern without having to wire up the protocol yourself.

flowchart LR
    subgraph Repo["One monorepo"]
        MAIL["Mail agent"] <-->|A2A| CAL["Calendar agent"]
        MAIL <-->|A2A| AN["Analytics agent"]
        CAL <-->|A2A| AN
    end
    EXT["Claude or ChatGPT"] -->|MCP| MAIL
    SL["Slack or Telegram"] --> CAL

Each agent keeps a small, focused tool list, and hands off to a specialist when a request falls outside it.

Templates You Can Clone

Agent-Native comes with a gallery of full apps you can clone and change, listed at agent-native.com/apps:

  • Mail and Calendar for inbox and scheduling agents
  • Slides and Design for generating and editing decks and interactive designs
  • Analytics for asking questions of your data
  • Clips for meetings, screen recordings and voice notes
  • Content, Assets and Plans for content, media and planning workflows

The repo also includes a Brain knowledge-base template.

Builder.io calls this "clonable SaaS": instead of renting a tool and living with its limits, you clone an open-source app that already works and own the whole thing. Whether that changes how software is bought is an open question, but as a starting point for an internal tool it's very practical.

Getting Started

The README's quick start creates a standalone app from the chat template:

bash
npx --yes @agent-native/core@latest create my-agent --standalone --template chat

From there:

  1. Add your model keys and point the app at a database (PGlite works locally with no setup).
  2. Write your first action for the one job you want the agent to do.
  3. Call it from the UI and ask the agent to do the same thing in chat. Seeing both paths hit the same code is the "aha" moment.
  4. Connect an external client through the app's /mcp URL if you want to drive it from Claude or ChatGPT.
  5. Deploy it wherever you host your apps. You don't need a separate agent server. Sewell's walkthrough deploys a to-do app to Netlify.

The CLI collects anonymous usage data. The README links to a page explaining how to turn it off.

Where It Fits, and the Trade-offs

Where I'd reach for it:

  • Internal tools and back-office apps where an agent doing the boring 80% and a human approving in a real UI is exactly the right split.
  • Agent-first SaaS products where the agent is the product and the UI exists to review and steer its work.
  • Teams already in TypeScript who want auth, permissions, automations and MCP without building them from scratch.

What to weigh before adopting it:

  • It's young and moves fast. Pin @agent-native/core to a specific version and read the changelog before upgrading.
  • It's opinionated. You're adopting its action layer, database setup and server conventions. If you already have a mature Next.js and PostgreSQL backend, adding a well-designed MCP server in front of your existing services may be the smaller step.
  • Shared actions don't remove the need for guard rails. The agent can do anything the UI can, so permissions, confirmation steps for destructive actions and human-in-the-loop approvals matter even more.
  • Your evaluation work doesn't go away. The framework gets the plumbing right. It can't tell you whether the agent picks the right action for a messy request. That still needs real test cases.

Conclusion

The idea at the centre of Agent-Native is simple and, I think, right: an agent should be a first-class user of your application, not a bolt-on with its own private API. Define each capability once, let the UI and the agent share it, and give the agent the same context the user has. The framework wraps that idea in auth, automations, MCP and a set of real templates, which removes a lot of work you'd otherwise do before your first agent is useful.

It's early, so treat it as a fast-moving dependency. But if you're starting a new internal tool or an agent-first product in TypeScript, it's well worth an afternoon with the chat template.

If you're planning an agent-powered product and want help choosing the architecture, see how I work with startups or get in touch.


References

Frequently asked questions

What is Agent-Native?

Agent-Native is an open-source TypeScript framework for building apps where an AI agent and the user interface share the same database, actions and application state. You define each capability once as an action, and both the UI and the agent use it.

Who makes Agent-Native, and what is the license?

It's built by Builder.io and published on GitHub as BuilderIO/agent-native. The project is MIT licensed, so you can self-host it, modify it and use it commercially.

How is Agent-Native different from adding a chat widget or an MCP server to an existing app?

A chat widget or a separate MCP server usually gives the agent its own, smaller set of endpoints that drift away from what the UI does. In Agent-Native the UI and the agent call the same actions, so anything the UI can do, the agent can do, with the same validation and permissions. Each app also exposes those actions over MCP for you.

What stack and hosting does Agent-Native use?

It's TypeScript end to end. The README describes PostgreSQL in production and PGlite for local development, and you can deploy it anywhere without a separate agent server. You bring your own LLM, database, keys and infrastructure.

Is Agent-Native production-ready?

It ships production features such as authentication, permissions, automations and multi-agent setups, and Builder.io's own templates run on it. It's still a young project that changes quickly, so pin the package version, keep up with the changelog and test your critical actions before relying on it for customer-facing work.

Discussion

Get new guides in your inbox

Practical, production-focused write-ups on AI agents, RAG and full-stack engineering. No spam; unsubscribe any time.

Written by

Niraj Kumar

Software Developer — building scalable systems for businesses.

Building this for real? LangChain Developer Services — Production LangChain & LangGraph systems for RAG, agents, and AI workflows.