System Design Space
Knowledge graphSettings

Updated: June 21, 2026 at 10:18 PM

Dyad: local AI app builder architecture

medium

Analysis of Dyad's architecture: multi-process Electron, a local execution stack, agent-and-tool orchestration, project templates, and checkpoints for safe rollback.

Dyad matters not because it brings AI into a desktop app, but because it turns local execution, tools, and project state into one manageable system.

The chapter shows how multi-process Electron, IPC boundaries, project templates, and checkpoints support safety, reproducibility, and change quality.

For architecture interviews, it is a useful case for discussing desktop software, local execution, tool permissions, and the trade-off between agent autonomy and platform control.

Practical value of this chapter

Local runtime

The chapter helps you discuss local execution as an architectural choice rather than as a marketing property of the product.

Agent and tools

Dyad is a strong case for breaking down the boundaries between the interface, agent orchestration, the file system, and template-driven project control.

Rollback and state

The case shows why checkpoints and controlled state matter before agent autonomy is expanded.

Interview material

It is a useful case for discussing desktop architecture, local execution, and safe automation of engineering actions.

Source

Dyad repository

The open repository of the local AI app builder: source code, architectural notes, and documentation on how the platform is built.

Open repository

Dyad is a desktop AI app builder that assembles code right on the developer's machine. Architecturally, it is interesting for how it joins three things that usually pull in different directions: a local-first execution model, agent orchestration, and template-driven project control. The developer sets intent, while the platform makes sure changes and checks run in a controlled way rather than however they happen to land.

The chapter is based on public materials and architectural notes from the team. The point is not the product itself but the patterns that transfer to any AI-assisted platform: explicit IPC boundaries, project templates, and checkpoints for safe rollback.

Dyad Architectural Patterns

Multi-process Electron architecture

The main process handles OS functions, files, and integrations, while the renderer process keeps the React interface responsive.

  • System and interface responsibilities stay apart: a failure in one does not drag down the other.
  • IPC works as an explicit communication bus between processes.

Agent and tool orchestration

The LLM returns more than text with code in it: it emits structured actions that Dyad executes through a constrained toolset.

  • Reasoning and action are pulled into one managed loop instead of being spread across services.
  • Through the toolset, the platform decides what the model is even allowed to do.

Local execution and state handling

Code and working artifacts stay on the user's machine. That reduces latency and removes the question of who stores the project's private data and where.

  • The core product runs without a mandatory cloud runtime.
  • The platform is easier to fit into an existing developer workflow and IDE setup.

Templates and generation rules

Project templates and AI_RULES.md define the technical boundaries and expected structure of generated output before the first request to the model.

  • The start comes from a prepared foundation instead of a blank project the model fills in by guesswork.
  • Generation expectations are fixed declaratively at the template level.

Checkpoints and rollback

Code and database changes roll back through checkpoints and Postgres branching, so a bad generation does not turn into cleaning up the aftermath by hand.

  • Rollback and re-apply are built into the platform rather than left as manual rituals.
  • Experimenting with agent-driven changes is cheaper when state is captured explicitly and there is somewhere to return to.

Application architecture visualization

The diagram lays Dyad out as a local execution stack and shows where the trust boundary runs: from the interface and IPC boundary to project tools, workspace state, and external providers.

User interface and task intake
chatpreviewdiffrequest flow
Layer transition
Preload and IPC boundary
message contractallowed commandsNode API isolationvalidation
Layer transition
Main process and orchestration
task queuecoordinationexecution orderrun state
Layer transition
Tools and project operations
patchescheckscommandsidempotency
Layer transition
Workspace, templates, and checkpoints
local filesAI_RULEStemplatesrollback
Layer transition
External providers and integrations
LLMexternal APIscostfallback

What to keep under control

It helps to see Dyad not as a shell around a model, but as a local runtime with explicit layers for state, safety, tools, and controlled rollback.

Trust boundaries

IPC contracttool permissionsNode APIexternal calls

State and rollback

checkpointschange historyreproducibilityrollback

External dependencies

model providercostlatencyfallback

Key repository modules

Core application

The interface, preload layer, main process, and background tasks, including heavy checks and build steps.

Shared packages

packages/@dyad-sh: shared libraries for AI providers, common typing, and integrations.

Templates and starter blueprints

Starter project structures and generation rules, including AI_RULES.md.

Testing and release flow

Unit, integration, and end-to-end checks, Electron Forge packaging, and CI automation.

How change moves through Dyad

The change flow surfaces three key moments: where the platform gathers context, where it executes actions, and where it captures state so that rollback stays cheap later.

Dyad change path

From user request to checkpoint and safe rollback

Intent
Planning
Execution
Safety
01

Request and intent

The user describes a task: a new capability, an interface update, or a logic change.

02

Context gathering

Dyad gathers the relevant project files, templates, and generation rules.

03

Agent plan and tool execution

The model builds the next action sequence and returns structured tool calls for the platform.

04

Applying changes

The main process applies patches, runs checks, and refreshes the preview.

05

Checkpoint and rollback

State is captured as a checkpoint so regressions can be rolled back safely.

Click "Run" to step through the Dyad change path.

Engineering Strengths

  • Local execution keeps project data with the developer and removes the lock-in to a vendor.
  • Explicit tool boundaries stop the model from executing actions chaotically.
  • The template-driven approach speeds up the start and makes generation repeatable rather than a one-off win.

Build, tests, and quality

  • Electron Forge and Vite support local development and packaging for desktop builds.
  • Playwright covers end-to-end scenarios, while Vitest handles unit and integration tests.
  • Husky and lint-staged enforce quality checks before commit.
  • Separating OSS and Pro modules reduces the risk of license overlap.

Practical checklist

  • Define the boundaries between the interface, agent orchestration, and file operations before adding new tools.
  • Design rollback and checkpoints before you expand agent automation, otherwise there is nothing to roll back to.
  • Keep templates and AI_RULES in the same lifecycle as the product: the template version should match the generation contract.
  • Cover the full request-to-patch-to-preview path with end-to-end scenarios for critical user flows.
  • Maintain a strict integration contract between Pro and OSS modules so the open core stays stable.

Related chapters

Enable tracking in Settings