Concepts

The five ideas that make the framework work: the continuity model, memory tiers, the runner, budgets, and the fleet.

The continuity model

Every AI coding agent starts each session blank. The framework's core bet is that context should outlive the session: what you decided, what shipped, what's next, and who you are as an operator should be waiting for the next agent the moment it connects.

The gateway — a local MCP server at http://localhost:3100/mcp — is the continuity layer. Any MCP-capable agent (Claude Code, Cursor, Windsurf, Codex CLI) connects to it via myai connect-agent, and from that moment:

The result is measured: the dashboard tracks cold-start tokens saved — how many tokens each session skipped re-reading because context was served instead of rebuilt.

Memory tiers

Memory is layered from hottest (always loaded, token-cheap) to coldest (retrieved on demand):

TierWhatCost to boot
Brain briefCompiled brief.md from the brain store — the distilled truth every agent boots from~150 tokens
Hot state filesstate/STATE.md (top 3 sessions) + state/AI_AGENT_HANDOFF.md (current handoff)~5k tokens
Cold archivestate/archive/YYYY-MM.md — older sessions, month-bucketedon demand
RAG memoryVector store over state, handoffs, commits, PRs, patterns across all reposper query

Two of these deserve more detail:

The brain is git-versioned agent memory — a private git repo, separate from your code, where sessions are branches and wrap-up is a merge. Agents append small content-addressed "atoms" (session summaries, decisions, ideas); a distiller recompiles brief.md/working.md/rollup.md on the brain's main after every merge. A returning agent calls brain_delta with the last SHA it saw and gets a ~300–800-token diff instead of re-reading everything. Because atoms are append-only and named by content hash, merges are conflict-free by construction. CLI: myai brain init|status|write|session|idea|log.

RAG memory is the semantic layer: memory_search and recall_session embed your query and return the most similar chunks from state files, handoff notes, commit messages, PR descriptions, and learned patterns — across every managed repo. myai scan seeds it; memory_reindex keeps it current; myai memory export|import moves the whole corpus between machines as a portable markdown + JSON bundle.

The runner

The CLI runner is a headless worker that executes queued tasks autonomously — typically off-hours, on a schedule (launchd on macOS, systemd user timer or cron on Linux).

The cycle:

  1. You (or an agent) queue a task: myai schedule --title "..." — it lands in the gateway task queue with a priority.
  2. On each tick (default every 10 minutes), the runner claims the highest-priority pending task, opens a headless agent session in that repo, and works it on the test branch.
  3. Finished work flips to review status and appears in Needs Review on the dashboard — nothing merges without you.
  4. You review and ship it (or fix, or reject). Reconciliation scripts self-heal the board, flipping tasks whose work provably shipped.

Safety properties: the runner never pushes to main, never deploys shared infrastructure, isolates poison tasks (an unresolvable task is blocked and skipped rather than starving the queue), and respects a consent list of repos that get no autonomous work without explicit opt-in.

Budget

Token spend is metered at two levels, because the scarce resource is shared across everything you run:

The gateway records per-day, per-repo budget rows, exposed through read-only budget tools and the dashboard, and the model router can route work to cheaper or free-window models when appropriate. The guards warn — they never hard-block, because stranding a half-finished session wastes more than it saves.

Fleet

The framework manages many repos from one master. Each managed repo is self-contained (its own AI/ folder with state, handoff, agents, skills), while the master repo is the propagation hub: framework changes are written once and synced to every managed repo.

Fleet-level machinery:

The same continuity model applies at fleet scale: the gateway, memory, queue, and dashboard are shared, so context flows not just between sessions but between repos, machines, and devices.


Next: the CLI reference and MCP tool reference are generated straight from the source on every docs build.