Lab Notes
Architecture

System Architecture

The detailed view — the 8-layer model, runtime processes, directory layout, communication paths, and deployment topology.

Purpose

This page is the lab's technical architecture reference. It complements the high-level System Overview with concrete details on processes, ports, directories, and communication paths.

The 8-layer model

The lab is organized in 8 layers. Each layer has a single responsibility, a clear contract with adjacent layers, and is independently testable.

Loading diagram…
The 8-layer model — a top-to-bottom stack from User Interface to External; the dotted edges are the interior layers reading and writing State.
LayerNameResponsibility
1User InterfaceNatural-language input/output. Sessions, prompts, results.
2CoordinationIntent resolution, routing, memory, session, skills.
3AgentSpecialized roles (Research, Coding, Media, Web).
4FrameworkDomain orchestration (Research Framework, Coding sub-agent).
5ToolTyped, deterministic capabilities (CLI tools, MCP adapters).
6AdapterProvider-specific translation (Tavily, DuckDuckGo, etc.).
7StateMemory, sessions, skills, artifacts, audit trail.
8ExternalModel providers, search providers, streaming services, devices.

The contract between adjacent layers is documented in the Framework page.

Runtime processes

The lab has the following runtime processes:

ProcessOwnerPortLifespanRestart policy
Coordinator gatewayCoordinator18789Always onlaunchd / systemd
Scout gatewayResearch Worker + Media Agent18790Always onlaunchd / systemd
Coding sub-agentCoding Assistantn/aPer-invocationRe-spawned each call
Browser (Chromium)Web Agent18800On demandRestarted on crash
Media Lab ServerCoordinator (or any agent)8765On demandManual or launchd
Tool processesVariousn/aPer-callRe-spawned each call

The two gateways are the only long-running processes. Everything else is short-lived.

Directory layout

The lab's directory layout is:

{workspace-root}/
├── .openclaw/                  ← framework state
│   ├── openclaw.json           ← main config
│   ├── workspace/              ← main workspace (Coordinator)
│   ├── workspace-scout/        ← Scout workspace
│   ├── agents/                 ← agent configs
│   ├── plugin-skills/          ← bundled skills
│   └── media/                  ← Media Lab outputs
│       └── outbound/
├── devclaw-tools/              ← tool repos
│   ├── audio-server/           ← Media Lab Server
│   ├── stack-template/         ← project template
│   └── tools/                  ← misc tools
├── movie-scraper-tools/        ← media toolkit
│   ├── tools/
│   │   ├── torrent-finder/
│   │   ├── subtitle-finder/
│   │   ├── dubbed-finder/
│   │   └── media-info/
│   ├── tools.json
│   └── SKILL.md
├── scoute-research-framework/  ← research framework
│   ├── scout/
│   │   ├── orchestrator/
│   │   ├── phases/
│   │   ├── schemas/
│   │   └── tools/
│   ├── docs/
│   └── pyproject.toml
├── stack_inicial_proyectos/    ← Next.js template
│   └── front-end/nextjs/
├── reports_test/               ← research artifacts
├── Audits/                     ← audit reports
├── Codex/                      ← coding sub-agent logs
└── comandos_terminal/          ← cheatsheets

The layout is the result of iteration. The most important directories are .openclaw/ (framework state), devclaw-tools/ and movie-scraper-tools/ (the tool repos), and scoute-research-framework/ (the research framework).

Communication paths

The agents communicate through the following paths:

FromToPath
CoordinatorResearch WorkerHTTP POST to 127.0.0.1:18790/<endpoint>
CoordinatorMedia AgentHTTP POST to 127.0.0.1:18790/<endpoint>
CoordinatorWeb AgentIn-process call to the browser tool
CoordinatorCoding AssistantIn-process call to the coding sub-agent
Research WorkerCoordinatorHTTP response (synchronous)
Media AgentCoordinatorHTTP response (synchronous)
Web AgentCoordinatorIn-process return
Coding AssistantCoordinatorIn-process return
Research WorkerResearch FrameworkIn-process call to the orchestrator
Coding AssistantCoding sub-agentCLI invocation (codex exec ...)
Research FrameworkAdaptersIn-process call to adapter functions
AdaptersExternalHTTP / HTTPS to provider APIs

The paths are unidirectional where possible. The response path mirrors the request path.

Configuration files

The lab's configuration is spread across several files:

FilePurpose
.openclaw/openclaw.jsonMain framework config (model, ports, paths).
.openclaw/agents/main/agent/models.jsonThe Coordinator's model config.
.openclaw/agents/scout/agent/models.jsonThe Scout's model config.
{project}/tools.jsonThe tool registry for a project.
scoute-research-framework/config/*.jsonThe research framework's adapter config.
~/.codex/config.tomlThe coding sub-agent's config (sandbox, trust).
~/Library/LaunchAgents/*.plistThe launchd units (macOS).
/etc/systemd/system/*.serviceThe systemd units (Linux).

Configuration changes are made by the Coordinator and require explicit user authorization.

Deployment topology

The lab is a single-host deployment. All processes run on the user's machine. The only network access is to external providers (model, search, streaming).

Loading diagram…
Single-host deployment — two gateways, one coding sub-agent, one browser, one media server, plus external providers.

The host is the user's machine (typically a MacBook Pro on macOS). The host has:

  • A coordinator gateway on port 18789.
  • A Scout gateway on port 18790.
  • A coding sub-agent invoked on demand.
  • A browser (Chromium) on CDP port 18800.
  • A Media Lab Server on port 8765.

The host has network access to the model's provider (over HTTPS) and to the local network (mDNS for device discovery).

Failure domains

The lab's failure domains are:

DomainWhat can fail
Coordinator gatewayAll routing; the user is disconnected.
Scout gatewayResearch and media; the user is partially disconnected.
Coding sub-agentOne invocation; retries handle transient failures.
BrowserThe Web Agent; the Coordinator can restart the browser.
Media Lab ServerGeneration; the Coordinator can restart the server.
Model providerAll model calls; the framework retries with backoff.
Search providerOne adapter; the framework falls back to another.
Streaming serviceOne source; the Media Agent tries the next source.
DevicePlayback; the Media Agent surfaces the error.

The failure domains are designed to be small. A failure in one domain does not cascade to others.

Performance

The lab's performance is bounded by:

  • Model latency. The Coordinator's response time is dominated by the model provider's response time.
  • Adapter latency. The Research Framework's response time is dominated by the search adapters' response time.
  • Tool latency. The Coding Assistant's response time is dominated by the coding sub-agent's response time.

The lab does not aim for real-time response. It aims for bounded, predictable response. A typical request completes in 5-30 seconds; a research mission completes in 2-5 minutes.

See also

On this page