Blog

Cadence: a local-first autonomous AI coder agent

Cadence runs on your machine, talks to a model you serve yourself in LM Studio, and keeps sessions, memory, goals and research local. It can work in the background — and it can always be interrupted.

Cadence logo
Cadence

October 27, 2026 · 7 min read

Most coder agents ask you to send your code, your context and your questions to somebody else's cloud. Cadence is built the other way round. It runs on an Ubuntu 22.04 or 24.04 box you own, talks to a model you serve yourself through LM Studio, and stores sessions, memory, goals, ideas and research artifacts in local Postgres and on-disk storage. The same repository installs unchanged on a VPS with Docker Compose — the deployment changes, the trust model does not.

The design principle, stated in one line, is the one this site keeps coming back to: autonomy with an operator, not autonomy instead of one. Cadence can keep working in the background, but steering wins over autonomy at every level — an interrupt endpoint, Ctrl+C in the CLI, and heartbeat pause, resume and nudge controls. That is the whole pitch, and the three versions below are how it was built up, layer by layer.

v1: the session engine

Version one is a complete agent loop, not a demo. A session engine with persistent history, fork and resume, so a conversation can be branched without losing the original. An OpenAI-compatible tool-calling loop with parallel tool calls and subagent spawning, so the agent can fan work out and bring results back. Interrupt and steer mid-run, so a bad direction costs a keystroke, not a restart.

Underneath that are Postgres-backed memory, goals and ideas — the agent's working state, queryable and persistent across sessions rather than reconstructed from a chat transcript each time. A deep-research skill turns a question into a structured report: web research gathered note by note, then rendered to DOCX and PDF, with the distilled notes and an append-only log of everything fetched kept alongside. A rich streaming CLI and a streaming web UI sit on top, and each session gets its own Docker sandbox with a terminal and file transfer, so the agent's shell work happens in a container, not on your host.

v2: context, code search, MCP, extensions and voice

Version two is about what happens when a session gets long, a codebase gets large, or the agent needs to talk to other tools. A context controller keeps context packs budget-aware and compacts automatically, using a separate small model, instead of letting a long session silently degrade or blow its token budget. Repo ingestion and ChromaDB semantic code search let the agent ask a codebase where something lives — cadence code-search myapp "where is the auth middleware" — rather than guessing from file names.

Model Context Protocol support runs both ways: Cadence exposes its own tools as an MCP server, and it can consume external MCP servers as agent tools. Plugins, hooks, YAML workflows and scheduled triggers, all with hot reload, turn one-off agent behaviour into repeatable machinery — an example daily-brief workflow, run by hand or on a cron trigger. Voice is optional, not bolted on: faster-whisper for speech-to-text and Kokoro for text-to-speech, with the server degrading cleanly when the voice extras are not installed. The web UI gets the same polish pass as the engine: a session sidebar, markdown rendering and a tool-call timeline, so you can see what the agent did, not just what it said.

v3: heartbeat autonomy and an agent mesh

Version three is where Cadence stops waiting to be asked. Heartbeat autonomy is an opt-in scheduler that lets Cadence work in the background at supervised, autonomous or fully-autonomous levels, with code-enforced tool allowlists and a stand-down while you are chatting with it. It is off by default, and its activity is logged so you can see what it did while you were away — cadence autonomy status and cadence autonomy activity --limit 10 are the first commands, not an afterthought.

The agent mesh is the other half: peer discovery, ping, task delegation and data sharing, over a zero-config local transport or over your own NATS broker. If you already run a NATS broker, Cadence nodes join on cadence.* subjects — never on an admin namespace. Two agents, or two machines, can hand work to each other without handing their credentials to a third party. That separation matters: the mesh is a transport for agents, not a back door into infrastructure.

How it runs

On your Ubuntu box, the path is short. LM Studio runs with a model loaded, and Cadence's installer does the rest: it installs Docker if it is missing, writes its environment file, and brings the services up. The installer generates the API token into .env with mode 600, and you set one variable yourself — the model name, exactly as LM Studio shows it — then restart the backend.

cd ~/cadence            # wherever you put this repo
./install.sh            # idempotent: docker if missing, .env, compose up
# set LMSTUDIO_MODEL=your-model-name in .env, then:
docker compose restart backend

The web UI is at http://localhost:8000/, API docs at /docs, health at /health. If LM Studio runs on the Docker host, the usual case, the default base URL already reaches it through the compose host-gateway mapping; if it runs on another machine, point the base URL at that machine and enable "Serve on local network" in LM Studio. No model at all? A mock mode runs the CLI with a scripted fake model, so the chat and research paths can be smoke-tested with no GPU:

python3 cli/cadence.py chat --mock
python3 cli/cadence.py research "your question" --mock --out ./research_out

The API follows the same shape as the CLI: sessions with create, list, fork, chat over server-sent events and interrupt; memory, goals and ideas as CRUD resources; research as a background job with downloadable DOCX and PDF artifacts; sandbox exec, upload and download per session. Everything but /health needs a bearer token. The v2 and v3 surfaces — context, index and code search, MCP servers, plugins, workflows, triggers, voice, autonomy and mesh — are separate endpoints under the same auth, and they return a clean unavailable response when the feature is disabled or its optional extras are missing, rather than failing silently.

The deep-research skill, in detail

The research skill deserves a paragraph of its own, because it is where Cadence's local-first stance is most visible. The loop gathers notes with a thin-finish gate — fewer than three notes is rejected, not dressed up — and captures prose as a fallback when structured extraction fails. It persists twice: distilled notes as JSON, and an append-only JSONL data-collection log archiving every page fetched. A structured pipeline then turns the notes into an outline, sections and an executive summary, schema-constrained with a text fallback, and renders DOCX and PDF with a title page and numbered sources. The result is a report you can check, because the evidence trail is part of the artifact, not a claim about it.

What was verified, and what still needs a real box

Honesty about verification is part of the design, so here it is, as recorded in the build log. In the build environment, version one's test suite passed 40 of 40, and the version two and three suites passed 214 with 11 skipped — the skips were the optional voice engine tests, without the voice extras installed. A full application boot with a mock model exercised session CRUD, fork and delete, chat streaming from token to tool call to tool result to done, memory, goals and ideas, research jobs through to all four artifacts, and the interrupt path. Tiny-repo ingestion, plugin listing, MCP status and the mesh on its local transport were all exercised the same way.

What that does not prove is the part that needs real hardware, and the build log says so plainly. Still to verify on a real box: Docker Compose bringing all services up, a real per-session sandbox roundtrip, chat against a real LM Studio model, real compaction against a long session, real embeddings and code search over a real indexed repo, a real faster-whisper and Kokoro audio roundtrip, a real MCP loopback against an external server, a NATS mesh against a real broker, and a visual check of the polished UI in a browser. Until those are run, Cadence is a built and mock-verified agent, not a deployed one — and that distinction is worth keeping, because it is exactly the distinction an operations layer is supposed to enforce.

Why this belongs on the Watch

Cadence is interesting to us for the same reason the harness wars were: the scaffold is the product. Hold the model constant and change the harness — sessions, context control, tool allowlists, interrupt paths, mesh — and what the agent can safely do changes completely. A local-first agent that keeps its state on your disk, runs its shell in a sandbox, stands down when you speak, and logs what it did while you were away is a harness you can actually operate. That is the standard the rest of the field will be measured against, whether or not it is the one you run.

Open the Watch → More from the blog