Architecture
A bird's-eye view of the components that make up Reyn, and how they coordinate to execute a single request.
Reyn is built from a small set of components. Agents hold long-lived conversations. Skills describe directed phase graphs. Phases loop the LLM through one task at a time. The OS runs everything under a strict validation contract. Workspace and Events make every step inspectable and replayable.
Each component has one job. Agents don't know about Phases. Phases don't know about Skills. The OS is the only layer that touches all of them — and it never embeds skill-specific logic.
A long-lived ChatSession. RouterLoop dispatches messages to Skills, an optional Planner decomposes complex goals, memory scope and skill allowlist define what the agent can see and do.
A directed graph of Phases. Owns the entry phase, the allowed transitions, and the final-output schema. Cycles are first-class — revision loops are a feature, not a workaround.
The execution unit. Declares an input contract and instructions, runs a preprocessor, calls the LLM, dispatches Control IR ops. Loops until it decides to transition or finish.
The runtime engine. Builds context, validates LLM output against schemas, executes ops under permission gates, emits an event for every state change. Constant; never embeds skill specifics.
Workspace is the single source of truth for inter-phase data. Events is an append-only log of every transition, op call, and decision. Together they make crash recovery and replay possible.
A user message arrives at an Agent. The RouterLoop picks a Skill. The OS enters the entry Phase, runs its preprocessor, calls the LLM with a closed candidate set, and validates the response. Control IR ops are dispatched under permission gates and write to the Workspace. An event records each step. The Phase either transitions to a peer or finishes; the OS validates the final output against the Skill's schema and the reply travels back to the user.
Agents delegate to other Agents asynchronously through a topology gate — network, team, or pipeline — with hop depth capped at three. From outside, Reyn exposes itself as an MCP server: Claude Code, Cursor, and any MCP-aware client can call list_agents() and send_to_agent(). Inside Phases, Control IR ops can call external MCP servers as well — third-party tools come under the same permission gate and event log as everything else.
The concepts section covers each component in detail — with design rationale, edge cases, and links to the implementation.