Headless Architecture

Headless Architecture

A system architecture where the core engine has no built-in UI; consumers (web, mobile, CLI, agent skill, third-party integrations) all access it through an API. The "head" — the user-facing presentation layer — is unbundled from the body.

The term entered mainstream tech vocabulary via headless CMS (Contentful 2013, Strapi, Sanity). It's now generalised: headless commerce, headless browsers, headless analytics. For local tools, the local-daemon pattern is one specific embodiment.

What's "headless" vs traditional

   Traditional CMS (e.g. WordPress)
   ─────────────────────────────────
   ┌──────────────────────────────┐
   │  WordPress: UI + content +   │
   │  templating + serving + DB   │
   └──────────────────────────────┘
                  │
                  ▼
              user's browser

   Headless CMS (e.g. Contentful)
   ──────────────────────────────
   ┌──────────────────────────────┐
   │  Contentful: content + DB +  │
   │  API. No UI for end users.   │
   └──────────────────────────────┘
                  │  REST/GraphQL API
                  │
       ┌──────────┼──────────┬──────────────┐
       ▼          ▼          ▼              ▼
   Next.js     iOS app   Slack bot    Custom integration

The headless CMS just stores and serves content via API. Anyone can be the rendering layer.

Why this shape works

Headless beyond CMS

The pattern shows up in:

The unifying observation: whenever a system might have multiple consumers, decoupling the core from any one consumer pays off.

Headless vs API-first

The terms overlap but emphasise different things:

You can do API-first and ship a UI alongside (Stripe — they have a Dashboard, but it's just another client). You can be headless without strict API-first discipline (some headless CMSes ship messy APIs).

In practice, the two reinforce each other. Headless without API-first leads to bad APIs that fail their consumers. API-first without headless leaves the original UI tangled with internals.

What headless costs

The trade-off is the same as API-First Design: pays off when you have or expect multiple consumers; overhead otherwise.

What "headless" specifically gives you

Three properties:

  1. Substitutable consumers. Replace the React frontend with Vue, with vanilla HTML, with a mobile app. Backend untouched.
  2. Programmatic access. APIs make automation possible. CMS data feeds analytics, AI training, search engines, custom workflows.
  3. Vendor lock-in is reduced. You can theoretically swap Contentful for Strapi if both expose similar APIs. (In practice, schemas migrate awkwardly, but the architectural option is there.)

Headless and AI agents

A 2024–2026 development: AI agents naturally consume headless systems. An agent can call a headless CMS's API to fetch content; it can't navigate WordPress's admin UI.

Tools that ship with rich UIs but no usable API are increasingly invisible to agents. Headless architectures are agent-friendly by default. See Agent-Native Interfaces.

Local-tool variant

Mxr and Lazydap are headless in spirit:

The macroscale (cloud-based headless CMSes serving N consumers) and the local scale (a daemon serving N clients on one machine) share the architecture even though the deployment is wildly different.

Common pitfalls

See also