Agent-Native

A full-stack TypeScript framework where AI agents and UI share the same actions, database, and context.

Framework
npm
v0.163.1
4,528stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
81/100Excellent
Development Activity100
Maintenance100
Community60
Maturity24
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture88
Code Quality82
Innovation87
Learning Curve78

Agent-Native (published to npm as @agent-native/core) is Builder.io’s open-source framework for building applications where AI agents are a first-class part of the app rather than a bolted-on chat widget. Its central primitive is defineAction: a single schema-validated function that can be invoked from the browser UI, an in-app agent tool call, an HTTP endpoint, an MCP tool, an A2A request, or the CLI, so business logic is written once and reused across every surface. The framework ships a batteries-included agent runtime (chat, tool loop, memory, background jobs, observability, and multi-step run resumption), a Drizzle-backed SQL data layer that is backend-agnostic, and a toolkit of shared UI building blocks for collaboration, sharing, and settings, letting teams scaffold a working agent-native app with a single npx @agent-native/core create command.

What You Get

  • A defineAction primitive that unifies UI, agent, HTTP, MCP, A2A, and CLI dispatch behind one schema-validated function
  • A built-in agent runtime with chat, tool calling, skills, durable background jobs, run resumption, and observability
  • A backend-agnostic SQL data layer via Drizzle, supporting any Drizzle-compatible database and a Nitro-compatible host
  • A reusable toolkit of UI building blocks for collaboration, presence, sharing, settings, and audit trails
  • A project scaffolding CLI (npx @agent-native/core create) with ready-made templates (chat, headless, workspace) to start a new app in one command

Common Use Cases

  • Building an internal tool where an agent and a human both need to read/write the same records through identical, validated business logic
  • Adding an autonomous agent surface (chat, MCP tool, or A2A endpoint) to an existing product without duplicating server-side logic
  • Standing up an agent-first SaaS-style app (analytics, content, forms) that ships with UI, database, and agent access from day one
  • Exposing existing internal actions as MCP tools for external coding agents or third-party agent integrations

Under The Hood

Architecture

Agent-Native centers on the defineAction primitive (src/action.ts, 1427 lines) which tags every invocation with an ActionCaller (tool/http/frontend/cli/mcp/a2a/automation) so one schema-validated function backs six different dispatch surfaces. The agent runtime (src/agent/) layers a resumable run loop (run-loop-with-resume.ts) with soft-timeout and resumable-error continuation on top of a pluggable engine abstraction (src/agent/engine/ with anthropic-engine.ts, ai-sdk-engine.ts, openrouter-engine.ts, builder-engine.ts), letting the same agent loop run against many LLM providers. The data layer (src/db/) wraps Drizzle with a DDL guard, additive-column migration helper, and async-transaction support over better-sqlite3/libsql/postgres, keeping the framework backend-agnostic while enforcing schema-safety guards at the framework level.

Tech Stack

TypeScript throughout (77% of repo bytes) in a pnpm workspace monorepo (packages/core plus toolkit, dispatch, embedding, mobile-app, and 13 other workspace packages). Core dependencies include the Anthropic SDK/tokenizer, Model Context Protocol SDK, Drizzle, better-sqlite3/@libsql/client/@neondatabase/serverless for storage, React Router 8 + Vite 7 + Tailwind 4 for the app shell, and Sentry/OpenTelemetry for observability. Peer dependencies span nearly every major AI SDK provider (@ai-sdk/anthropic, openai, google, groq, mistral, cohere) plus optional integrations (Convex, Supabase, Excalidraw, xterm.js), so consuming apps opt into only the providers/integrations they use.

Code Quality

The core package has 627 spec/test files against roughly 1,122 non-test TypeScript source files (~36% test-file ratio), with tests co-located next to implementation files (e.g. action.spec.ts beside action.ts, run-loop-with-resume.spec.ts and a separate .integration.spec.ts beside run-loop-with-resume.ts). Repo-level guard scripts (scripts/guard-.mjs and guard-.ts, over 20 of them) enforce architectural invariants at CI time — no unscoped DB queries, no credential leakage into env vars, no cross-package barrel-import violations — which is an unusually strict quality bar for a framework of this size. Source files carry substantial doc-comments explaining non-obvious behavior (e.g. the soft-timeout/resumable-error rationale in run-loop-with-resume.ts).

API Design

The distinguishing design choice is ActionCaller-tagged dispatch: rather than building a chatbot layer over an existing app, every action a developer writes is automatically agent-callable, HTTP-callable, MCP-callable, and CLI-callable with one schema definition, removing the usual duplication between a REST handler and an agent tool wrapper. The npx @agent-native/core create scaffolding CLI plus a library of forkable full-stack templates (chat, content, analytics, clips) gives it strong developer-experience ergonomics for going from zero to a running agent-native app, backed by 1,009+ localized documentation markdown files across the docs/content tree.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search