Architecture

How the pieces fit together — Zero sync, apps, flows, and AI

start.chat is built on a few core systems that compose together. Understanding how they connect helps when building apps and writing flows. The source and self-hosting release are not public yet; see Software Availability and Rights for the current status.

Stack

LayerTechnologyRole
FrontendReact + TamaguiUniversal UI (web, desktop, mobile)
RoutingOne (Vite)File-based routing, SSG/SSR/SPA
SyncOrezReal-time local-first data sync
DatabaseSQLiteNamespaced primary storage
DesktopTauriNative macOS/Windows/Linux app
MobileReact Native (Expo)iOS and Android
AIMulti-providerClaude, Gemini, Qwen, Ollama, more
FlowsPipedownDSL for multi-step automation

Data flow

All data flows through Orez’s local-first sync runtime. The client maintains a local replica of the data it has access to. Mutations are optimistic — the UI updates immediately, then the server confirms or rebases.

client → optimistic mutation → local state updates instantly → server mutation → namespaced SQLite write → sync to all clients

This means:

  • The UI is never blocked waiting for the server
  • Offline edits queue and sync when connectivity returns
  • Conflict resolution is automatic
  • Every query is a local read — fast regardless of server latency

Permissions at the sync layer

Zero enforces access control at the data level through where predicates. When a client subscribes to data, the server filters rows based on the user’s roles and permissions. Private channels, secret data, and admin-only resources are invisible to unauthorized clients — they never leave the server.

Apps

Apps are the primary extension mechanism. An app definition (createApp()) declares:

  • Actions — functions that agents and flows can call
  • Backends — scheduled code that runs on a timer (runsEvery)
  • Blocks — React components that render inline in chat
  • Data — structured key-value storage scoped to the app
  • OAuth — connect to external services
  • Webhooks — receive events from external services

Apps compile in a sandbox. The sandbox injects a global namespace with toolstools.data, tools.message, tools.generate, tools.strategy, tools.notify, and more. Apps cannot access the filesystem or make arbitrary network requests.

Flows

Flows are written in Pipedown, a plain-language DSL that compiles to an AST. The runtime executes steps sequentially or in parallel, calling app actions, LLM providers, or built-in operations at each step.

event trigger → parse Pipedown → execute steps → store results ↓ app actions, AI calls, data writes, notifications

Flows can be triggered by events (new message, webhook, data change), schedules (every 6 hours), or manual commands. Each step has access to previous step outputs via tags.

AI

The AI system composes abilities into a system prompt at request time. When a user messages HUD:

  1. Load channel config (model tier, system prompt, enabled abilities)
  2. Assemble context (recent messages, available apps, user role)
  3. Build system prompt from enabled ability definitions
  4. Stream response, executing tool calls as they arrive
  5. Post-process: citations, code blocks, action results

Model tiers

Seven tiers from xxs to xl, each mapping to specific models:

TierUse caseExamples
xlComplex reasoningClaude Opus, Claude Sonnet
lgDetailed responsesClaude Sonnet, Claude Haiku
mdGeneral conversationClaude Haiku (extended thinking), Gemini Flash
smTool-calling/strategyGemini Flash (high thinking), Claude Haiku
xsSimple tasksGemini Flash, Claude Haiku
xxsQuick operationsGemini Flash Lite, Claude Haiku

Server admins set the default tier. HUD selects models within that tier based on task complexity. Ollama is supported for fully self-hosted AI.

Search combines three ranking signals over namespace-local search documents:

SignalHow it worksBest for
TextToken and phrase matching with title boostExact phrases and known terms
RecencyTime and document-kind weightingRecent conversations and trusted documents
SemanticCosine similarity over stored embeddingsConceptual queries, “find messages about…”

Results are merged with weighted ranking. Product mutations update search documents explicitly, so new content is findable without a database trigger.

Routing

File-based routing via One. Routes in app/ map to URL paths:

  • app/(chat)/ — authenticated chat UI
  • app/(site)/ — public marketing site, docs, blog (SSG)
  • app/api/ — REST API endpoints
  • app/auth/ — authentication flows

The (chat) group wraps everything in ~15 context providers (current server, channel, user, theme, Zero client, etc). The (site) group uses static generation for docs and blog pages.

Desktop sync

The Tauri desktop app adds bidirectional file sync. Your server’s apps and flows mirror to ~/start/{server-slug}/ on your filesystem. Edit in your editor, changes push back as drafts. Cloud edits write to local files.

Safety guards protect against accidents: mass change detection, large change ratio checks, freshness verification, offline protection, and per-file confirmation for deletions.