cloudshock.dev
// CODE > IDEAS > EXPERIMENTS

Local-First Architecture

Local iron is canonical. Deterministic CLIs own the plumbing; frontier models earn their tokens.

Dec 2, 2026 Agent Architecture · Local-First https://cloudshock.dev/projects/local-first/

Cloud-first agent loops drift, lose custody of your notes, and trap personal workflows inside someone else's UI. This project documents a practical local-first pattern for personal knowledge and multi-agent orchestration where plain Markdown on local hardware remains the single source of truth.

Core Pattern

flowchart LR
    A[Local Markdown Store] --> B[Deterministic Python CLI]
    B -->|Explicit Handoff| C[Frontier Model]
    C -->|Ranked Output & Drafts| D{Human Approval Gate}
    D -->|Approved| A
    D -->|Syndicate| E[Cloud / Public Sites]
            

The Split: Code vs. Models

  • Deterministic Python CLIs own structured work: polling, seen-tracking, link cleaning, schema and header validation, archive moves, manifest sync, and idempotent state transitions—zero judgment tokens burned.
  • Frontier models own judgment: semantic filtering, relevance ranking, concise rationales, and cross-source synthesis—called only when the training set plus local personal context earns the token.

Operating Rules

  • Local Markdown is authoritative: cloud copies are fallback or syndication layers only, never the system of record.
  • Explicit handoffs over magical autonomy: cross-agent communication is hand-carried or scripted, never silently assumed.
  • Human-in-the-loop gates: consequential actions and durable writes require explicit human approval, with read-back verification.
  • Zero trackers, full chain of custody: plain text files, Git history, and deterministic scripts you can inspect at 3 AM.

Related Writing

Ongoing field notes and CLI orchestration patterns from this architecture are published in the Maestro Newsletter.