Skip to main content

Architecture

Status: Ready

Truth label: Current

Audience: New builder, System designer

Reader outcome: Name each process, the port it answers on, the store it owns, and the one direction each call travels.

Last verified: 2026-09-13

Full guides: Architecture, Architecture design, How it works, Data and storage

Four parts and one optional site​

PartPortProcessOwns
Forge Central8080uvicorn forge.central.api:appTask state, projects, workers, sessions, schedules, workflows, methods, traces
Brain8081uvicorn brain.api:appChat, retrieval, knowledge, voice, writing, research, operator context
Cortex3000Static files served over HTTPThe browser interface to both APIs
Forge workernoneforge.workerRunning a coding CLI against a local checkout
Academy site3040Docusaurus or NginxThese lessons, separate from the control plane

The control plane runs without the Academy. The Academy runs without the control plane. They share a port range convention only so a single machine can run both.

Which process talks to which​

Every arrow starts at the caller. The browser calls both services directly, and the worker calls both services directly; nothing calls the worker.

Cortex builds both API addresses from the browser's own hostname. It needs no build step and no compiled API address, which is why the container serves it as plain static files.

Central never calls a worker. A worker polls Central and claims work. That direction is the reason a worker can sit on a laptop behind a firewall while Central runs on a server.

Where state lives​

StoreLocationOwner
forge.sqlite3Forge data rootTasks, projects, workers, sessions, schedules, workflow templates, method packages, task settings
traces.sqlite3 and traces/raw/Forge data rootRun traces, retained deliverables, stage input reports
chroma/Brain data rootVector collections for knowledge, notes, learnings, conversations, voice examples, canonical project memory
writing.sqlite3Brain data rootDrafts, versions, approved examples, operator settings, comparison cases and runs, reply ratings, polish verdicts, meaning trials, research records
sources.sqlite3Brain data rootManaged source catalog, revisions, publications, named selections, archived passages
context.sqlite3Brain data rootPersistent briefs, decisions, preferences, lessons, and rules
conversations.sqlite3Brain data rootNamed conversation snapshots and their revisions
feedback.sqlite3Brain data rootCanonical task, attempt, artifact, and lesson judgments
document-edits.sqlite3Brain data rootMemory correction intents, status, and before and after evidence
prompt-budgets.json, local-processing.json, voice-pack-settings.jsonBrain data rootVersioned settings that Cortex writes
Voice pack directoryOutside both rootsProfiles, lenses, static samples, style rules, pack history
Influence library directoryOutside both rootsOriginal uploaded files and immutable extraction files under a hidden managed directory

Two data roots exist because two prefixes configure them. SE_MANAGER_DATA_DIR configures Forge. DATA_DIR configures Brain. The default points both at the same directory. See Configuration reference for the trap that follows from setting one and not the other.

The one filesystem rule​

The live SQLite data root must sit on a native local filesystem. Central refuses to start on drvfs, 9p, virtiofs, cifs, and nfs, because SQLite write-ahead logging and advisory locks are not reliable across those boundaries. In containers this means the data root is a named volume, never a bind mount from a Windows or macOS host.

Content directories are different. The voice pack, influence library, and knowledge directory can be bind mounted, and must sit outside the data root.

Lifecycle of one task​

  1. Cortex or the Brain task tool posts a task to Central. Central resolves execution settings from the explicit request, the workflow stage, project defaults, operator defaults, then system defaults.
  2. A worker polls GET /tasks/next. Central checks the worker pin, installed engine, required capabilities, parent completion, task state, and project status.
  3. The worker claims the task. Central issues a lease with a server owned TTL and a run token. The worker renews while it runs.
  4. The worker assembles a prompt from persona or managed method, the brief, repository control files, active rules, scoped retrieval, prior stage input, and verification expectations, then starts the CLI in the project directory.
  5. The worker snapshots the workspace before and after, runs the verification command if one is configured, and posts a result through its outbox.
  6. Central records the result, the retained deliverables, and the trace. A checkpoint task holds for a human decision. An autonomous task completes.

Each numbered step has its own handbook page. Step 2 and 3 are in Workers. Step 4 is in Methods and workflows and Settings and budgets. Step 6 is in Reviews and deliverables.