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
| Part | Port | Process | Owns |
|---|---|---|---|
| Forge Central | 8080 | uvicorn forge.central.api:app | Task state, projects, workers, sessions, schedules, workflows, methods, traces |
| Brain | 8081 | uvicorn brain.api:app | Chat, retrieval, knowledge, voice, writing, research, operator context |
| Cortex | 3000 | Static files served over HTTP | The browser interface to both APIs |
| Forge worker | none | forge.worker | Running a coding CLI against a local checkout |
| Academy site | 3040 | Docusaurus or Nginx | These 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
| Store | Location | Owner |
|---|---|---|
forge.sqlite3 | Forge data root | Tasks, projects, workers, sessions, schedules, workflow templates, method packages, task settings |
traces.sqlite3 and traces/raw/ | Forge data root | Run traces, retained deliverables, stage input reports |
chroma/ | Brain data root | Vector collections for knowledge, notes, learnings, conversations, voice examples, canonical project memory |
writing.sqlite3 | Brain data root | Drafts, versions, approved examples, operator settings, comparison cases and runs, reply ratings, polish verdicts, meaning trials, research records |
sources.sqlite3 | Brain data root | Managed source catalog, revisions, publications, named selections, archived passages |
context.sqlite3 | Brain data root | Persistent briefs, decisions, preferences, lessons, and rules |
conversations.sqlite3 | Brain data root | Named conversation snapshots and their revisions |
feedback.sqlite3 | Brain data root | Canonical task, attempt, artifact, and lesson judgments |
document-edits.sqlite3 | Brain data root | Memory correction intents, status, and before and after evidence |
prompt-budgets.json, local-processing.json, voice-pack-settings.json | Brain data root | Versioned settings that Cortex writes |
| Voice pack directory | Outside both roots | Profiles, lenses, static samples, style rules, pack history |
| Influence library directory | Outside both roots | Original 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
- 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.
- A worker polls
GET /tasks/next. Central checks the worker pin, installed engine, required capabilities, parent completion, task state, and project status. - The worker claims the task. Central issues a lease with a server owned TTL and a run token. The worker renews while it runs.
- 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.
- The worker snapshots the workspace before and after, runs the verification command if one is configured, and posts a result through its outbox.
- 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.