# builderio/agent-native architecture

> Architecture diagram of the GitHub repository builderio/agent-native, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/builderio/agent-native
- Repository: https://github.com/builderio/agent-native

## Overview

Agent-Native is a TypeScript framework for applications that combine autonomous agents with purpose-built user interfaces. The principal workflow is that a person or agent invokes a shared action; the action applies the same validation, permissions, and implementation regardless of caller, and shared application data makes the result available across the agent and UI. The README also documents chat, authentication, context awareness, persistent agent resources, automations, teams, and PostgreSQL support. Several subsystems are represented at their enclosing package or directory because their implementation was not sampled.

Main entry points: [`packages/core/src/agent`](https://github.com/builderio/agent-native/tree/main/packages/core/src/agent) (Agent), [`packages/core/src/server`](https://github.com/builderio/agent-native/tree/main/packages/core/src/server) (Shared database), [`packages`](https://github.com/builderio/agent-native/tree/main/packages) (Purpose-built UI), [`packages/core/src/client/use-action.ts`](https://github.com/builderio/agent-native/blob/main/packages/core/src/client/use-action.ts) (Action client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["Application surfaces"]
  node_chat["Agent chat"]
  node_ui["Purpose-built UI"]
end

subgraph group_runtime["Action runtime"]
  node_actions["Shared actions"]
  node_client["Action client<br/>[use-action.ts]"]
  node_engine["Agent engine<br/>[builder-engine.ts]"]
  node_context["Application context"]
end

subgraph group_shared["Shared application data"]
  node_database[("Shared database")]
end

subgraph group_agent["Agent capabilities"]
  node_agent["Agent"]
  node_resources["Skills and memory"]
  node_automations["Automations"]
  node_teams["Agent teams"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication"]
  node_postgres[("PostgreSQL backend")]
end

node_person(("Person"))

node_person -->|"uses"| node_ui
node_person -->|"delegates work"| node_chat
node_ui -->|"invokes"| node_client
node_client -->|"calls"| node_actions
node_agent -->|"invokes tools"| node_actions
node_actions -.->|"executes agent work"| node_engine
node_actions -->|"reads and writes"| node_database
node_database -->|"shares results"| node_ui
node_database -->|"shares results"| node_agent
node_context -->|"provides UI state"| node_agent
node_auth -->|"controls access"| node_actions
node_resources -->|"provides expertise"| node_agent
node_automations -->|"runs scheduled work"| node_agent
node_teams -->|"delegates work"| node_agent
node_postgres -->|"backs production data"| node_database

click node_agent "https://github.com/builderio/agent-native/tree/main/packages/core/src/agent"
click node_chat "https://github.com/builderio/agent-native/tree/main/packages/core/src"
click node_ui "https://github.com/builderio/agent-native/tree/main/packages"
click node_client "https://github.com/builderio/agent-native/blob/main/packages/core/src/client/use-action.ts"
click node_engine "https://github.com/builderio/agent-native/blob/main/packages/core/src/agent/engine/builder-engine.ts"
click node_context "https://github.com/builderio/agent-native/tree/main/packages/core/src"
click node_database "https://github.com/builderio/agent-native/tree/main/packages/core/src/server"
click node_auth "https://github.com/builderio/agent-native/tree/main/packages/core/src/server"
click node_resources "https://github.com/builderio/agent-native/tree/main/packages/core/src"
click node_automations "https://github.com/builderio/agent-native/tree/main/packages/core/src"
click node_teams "https://github.com/builderio/agent-native/tree/main/packages/core/src"
click node_postgres "https://github.com/builderio/agent-native/tree/main/packages/core/src/server"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chat,node_ui toneBlue
class node_actions,node_client,node_engine,node_context toneAmber
class node_database toneMint
class node_agent,node_resources,node_automations,node_teams toneRose
class node_auth,node_postgres,node_person toneIndigo
```

## Components

### Application surfaces

- [Agent chat](https://github.com/builderio/agent-native/tree/main/packages/core/src): `packages/core/src`
- [Purpose-built UI](https://github.com/builderio/agent-native/tree/main/packages): `packages`

### Action runtime

- **Shared actions**
- [Action client](https://github.com/builderio/agent-native/blob/main/packages/core/src/client/use-action.ts): `packages/core/src/client/use-action.ts`
- [Agent engine](https://github.com/builderio/agent-native/blob/main/packages/core/src/agent/engine/builder-engine.ts): `packages/core/src/agent/engine/builder-engine.ts`
- [Application context](https://github.com/builderio/agent-native/tree/main/packages/core/src): `packages/core/src`

### Shared application data

- [Shared database](https://github.com/builderio/agent-native/tree/main/packages/core/src/server): `packages/core/src/server`

### Agent capabilities

- [Agent](https://github.com/builderio/agent-native/tree/main/packages/core/src/agent): `packages/core/src/agent`
- [Skills and memory](https://github.com/builderio/agent-native/tree/main/packages/core/src): `packages/core/src`
- [Automations](https://github.com/builderio/agent-native/tree/main/packages/core/src): `packages/core/src`
- [Agent teams](https://github.com/builderio/agent-native/tree/main/packages/core/src): `packages/core/src`

### Platform services

- [Authentication](https://github.com/builderio/agent-native/tree/main/packages/core/src/server): `packages/core/src/server`
- [PostgreSQL backend](https://github.com/builderio/agent-native/tree/main/packages/core/src/server): `packages/core/src/server`

### Other components

- **Person**

## Connections

- Person → Purpose-built UI: uses (evidence: `README.md`)
- Person → Agent chat: delegates work (evidence: `README.md`)
- Purpose-built UI → Action client: invokes (evidence: `README.md`)
- Action client → Shared actions: calls (evidence: `README.md`)
- Agent → Shared actions: invokes tools (evidence: `README.md`)
- Shared actions → Agent engine: executes agent work
- Shared actions → Shared database: reads and writes (evidence: `README.md`)
- Shared database → Purpose-built UI: shares results (evidence: `README.md`)
- Shared database → Agent: shares results (evidence: `README.md`)
- Application context → Agent: provides UI state (evidence: `README.md`)
- Authentication → Shared actions: controls access (evidence: `README.md`)
- Skills and memory → Agent: provides expertise (evidence: `README.md`)
- Automations → Agent: runs scheduled work (evidence: `README.md`)
- Agent teams → Agent: delegates work (evidence: `README.md`)
- PostgreSQL backend → Shared database: backs production data (evidence: `README.md`)
