Lab Notes
Architecture

Data Flow

The data moving through the lab — what crosses each boundary, in what format, and with what guarantees.

Purpose

This page documents the data flow through the lab's architecture. It complements the System Overview and System Architecture with concrete details on the data that crosses each boundary, in what format, and with what guarantees.

Boundaries and data

The lab has 8 layers (see System Architecture → The 8-layer model). Data crosses the boundaries between these layers. Each crossing has a format, a direction, and a set of guarantees.

BoundaryDirectionFormatGuarantee
User ↔ CoordinatorBothNatural languageBest effort
Coordinator ↔ AgentDownRequest (JSON)At-most-once
Agent ↔ CoordinatorUpResponse (JSON)At-least-once
Agent ↔ FrameworkDownMethod callSynchronous
Framework ↔ ToolDownFunction callSynchronous
Tool ↔ AdapterDownFunction callSynchronous
Adapter ↔ ExternalDownHTTP/HTTPSPer adapter
Coordinator ↔ StateBothFile I/OAtomic write
Framework ↔ StateBothFile I/OAtomic write

The guarantees are documented in detail below.

User ↔ Coordinator

The user communicates with the Coordinator in natural language. The Coordinator parses the request, resolves the intent, and returns a response in natural language.

AspectDetail
FormatNatural language (UTF-8 text).
DirectionBoth.
EncodingUTF-8.
Size limitNone enforced (the Coordinator truncates very long inputs).
GuaranteeBest effort. The Coordinator may misunderstand ambiguous requests.
LoggingThe Coordinator logs every request and response.

The Coordinator may return artifacts (file paths, images, etc.) along with the natural language response.

Coordinator ↔ Agent

The Coordinator dispatches a request to an agent through its public interface. The format is JSON.

AspectDetail
FormatJSON.
DirectionDown (request) and up (response).
EncodingUTF-8.
Size limit1 MB per message (configurable).
GuaranteeAt-most-once (the Coordinator does not retry).
Timeout60s (configurable per agent).
LoggingThe Coordinator logs the request and the response.

The request schema is:

{
  "request_id": "string",
  "agent": "string",
  "task": "string",
  "params": "object",
  "context": "object"
}

The response schema is:

{
  "request_id": "string",
  "status": "ok | failed | partial",
  "result": "object",
  "error": "string | null",
  "duration_ms": "integer"
}

Agent ↔ Framework

The agent invokes the framework through method calls. The calls are synchronous.

AspectDetail
FormatIn-process method call.
DirectionDown.
EncodingNative Python objects.
Size limitNo hard limit (large artifacts are written to disk).
GuaranteeSynchronous; the agent waits for the framework's result.
LoggingThe framework logs every call.

The Research Framework's public API is documented in Research Framework → Source layout.

Framework ↔ Tool

The framework invokes tools through function calls. The calls are synchronous and return typed results.

AspectDetail
FormatFunction call with typed arguments.
DirectionDown.
EncodingNative Python objects.
Size limitNo hard limit.
GuaranteeSynchronous; the framework waits for the tool's result.
LoggingThe tool logs every invocation.

The tool contract is documented in Tooling Layer.

Tool ↔ Adapter

A tool that needs to talk to an external service invokes an adapter. The adapter translates the tool's generic request into the provider's specific format.

AspectDetail
FormatFunction call with typed arguments.
DirectionDown.
EncodingNative Python objects.
Size limitNo hard limit.
GuaranteeSynchronous; the tool waits for the adapter's result.
LoggingThe adapter logs every call to the request journal.

The adapter contract is documented in External Providers → Adapter contract.

Adapter ↔ External

The adapter talks to the external service through HTTP or HTTPS. The format and the guarantees depend on the provider.

AspectDetail
FormatHTTP / HTTPS.
DirectionDown.
EncodingJSON (most providers) or form-encoded.
Size limitPer provider (typically 1-10 MB per request).
GuaranteePer adapter (the adapter handles retries).
Timeout30s per request (configurable per adapter).
LoggingThe adapter logs every call to the request journal.

The request journal is documented in External Providers → Request journal.

Coordinator ↔ State

The Coordinator reads and writes the state layer. The state layer includes MEMORY.md, daily logs, session state, and skill artifacts.

AspectDetail
FormatMarkdown (for MEMORY.md and daily logs) or JSON (for session state and skill artifacts).
DirectionBoth.
EncodingUTF-8.
Size limit1 MB per file (the Coordinator splits larger files).
GuaranteeAtomic write (the Coordinator writes to a temp file and renames).
LoggingThe Coordinator logs every read and every write.

The state layer is documented in Memory and Context.

Framework ↔ State

The framework reads and writes the state layer for research artifacts. The artifacts are JSON files validated by Pydantic schemas.

AspectDetail
FormatJSON (validated by Pydantic schemas).
DirectionBoth.
EncodingUTF-8.
Size limitNo hard limit.
GuaranteeAtomic write; validation on read and write.
LoggingThe framework logs every read and every write.

The artifact schemas are documented in Artifacts and the Data Dictionary.

End-to-end data flow

The end-to-end data flow for a research request is:

Loading diagram…
End-to-end research flow — every data crossing is auditable.

The flow shows every data crossing. Each crossing is auditable.

Data persistence

The lab persists data in the following locations:

DataLocationFormat
Long-term memory{workspace-root}/MEMORY.mdMarkdown
Daily logs{workspace-root}/memory/YYYY-MM-DD.mdMarkdown
Session state{workspace-root}/sessions/<id>/session.jsonJSON
Skill artifacts{workspace-root}/skills/...Markdown
Research artifacts{research-root}/runs/<mission_id>/*JSON
Request journal{framework-root}/runtime/request_journal.jsonlJSONL
Token pool state{framework-root}/runtime/token_pool_state.jsonJSON
Mission state{research-root}/runs/<mission_id>/phase.jsonJSON
Audit reports{workspace-root}/security/audits/...Markdown

The retention policy is documented in Mission Lifecycle → Retention and archival.

See also

On this page