Reyn

{{ARCH_HERO_EYEBROW}}

{{ARCH_HERO_H1_HTML}}

{{ARCH_HERO_LEDE}}

{{ARCH_S01_NUM}} {{ARCH_S01_LABEL}}

{{ARCH_S01_HEADING_HTML}}

{{ARCH_S01_BODY}}

flowchart TB U(["User / External System"]) subgraph I01["01 · Interface"] direction LR CLI["CLI"] ~~~ TUI["TUI (Textual)"] ~~~ WEB["Web UI (FastAPI + WebSocket)"] end subgraph I02["02 · Agent Registry"] direction LR AM["manages named agents"] ~~~ TG["Topology gate — network · team · pipeline"] end subgraph I03["03 · Agent = ChatSession"] direction LR RL["RouterLoop (LLM-driven dispatch)"] ~~~ PL["Planner (optional · plan mode)"] ~~~ MEM["memory scope · skill allowlist"] end subgraph I04["04 · OS — the constant"] direction LR CB["Context Build"] ~~~ LC["LLM Call"] ~~~ VA["Output Validation"] ~~~ EE["Event Emit"] end subgraph I05["05 · Skill"] direction LR PG["Phase Graph + Transitions"] ~~~ FO["final_output_schema"] ~~~ PP["Postprocessor"] end subgraph I06["06 · Phase"] direction LR PRE["Preprocessor"] ~~~ LO["LLM + Control IR ops"] ~~~ LP["↺ loops until transition/finish"] end subgraph I07["07 · Persistence"] direction LR WS["Workspace (artifacts · files)"] ~~~ EV["Events (append-only log)"] end U --> I01 --> I02 --> I03 --> I04 --> I05 --> I06 --> I07
{{ARCH_S02_NUM}} {{ARCH_S02_LABEL}}

{{ARCH_S02_HEADING_HTML}}

{{ARCH_S02_BODY}}

{{ARCH_S02_C1_LABEL}}

{{ARCH_S02_C1_BODY}}

{{ARCH_S02_C2_LABEL}}

{{ARCH_S02_C2_BODY}}

{{ARCH_S02_C3_LABEL}}

{{ARCH_S02_C3_BODY}}

{{ARCH_S02_C4_LABEL}}

{{ARCH_S02_C4_BODY}}

{{ARCH_S02_C5_LABEL}}

{{ARCH_S02_C5_BODY}}

{{ARCH_S03_NUM}} {{ARCH_S03_LABEL}}

{{ARCH_S03_HEADING_HTML}}

sequenceDiagram participant U as User participant A as Agent (ChatSession) participant PL as Planner (optional) participant SK as Skill graph participant PH as Phase loop participant WS as Workspace + Events U->>A: message alt Complex multi-step request A->>PL: plan_task(goal) PL-->>A: Plan { steps: [S1, S2, ...] } Note over A: each step → skill invocation else Simple request Note over A: RouterLoop picks Skill directly end A->>SK: invoke skill SK->>PH: enter entry phase loop Until transition or finish PH->>PH: preprocessor (deterministic) PH->>PH: LLM call (closed candidate set) PH->>PH: validate output against schema PH->>WS: execute Control IR ops · emit events PH-->>SK: result + control decision alt decision = transition Note over SK: validate against next.input_schema SK->>PH: enter next phase else decision = finish Note over SK: validate against final_output_schema opt postprocessor declared (skill-level) SK->>WS: postprocessor steps · emit events end SK-->>A: final output end end A-->>U: reply

{{ARCH_S03_BODY}}

{{ARCH_S04_NUM}} {{ARCH_S04_LABEL}}

{{ARCH_S04_HEADING_HTML}}

{{ARCH_S04_BODY}}

sequenceDiagram participant U as User (depth=0) participant A as Agent A (depth=1) participant B as Agent B (depth=2) participant C as Agent C (depth=3=limit) U->>A: message Note over A: RouterLoop → delegate_to_agent A->>B: send(to=B, depth=1, chain_id=xyz) Note over B: RouterLoop → delegate_to_agent B->>C: send(to=C, depth=2, chain_id=xyz) Note over C: depth=3 = max_hop_depth C-->>B: result (chain_id=xyz) B-->>A: result (chain_id=xyz) A-->>U: final reply Note over A,C: chain timeout = 60s
flowchart LR subgraph SRV["MCP Server — implemented (reyn mcp serve)"] direction TB EXT["External LLM Client\nClaude Code · Cursor · OpenAI SDK"] STDIO["stdio / JSON-RPC 2.0"] TOOLS["list_agents() · send_to_agent()"] AR["AgentRegistry → ChatSession"] EXT --> STDIO --> TOOLS --> AR end subgraph CLI2["MCP Client — implemented (stdio · HTTP)"] direction TB PHASE["Reyn Phase (control_ir)"] MCIROP["MCPIROp kind: mcp"] MCLIENT["MCPClient\nstdio / HTTP transport"] EXTMCP["External MCP Server"] PHASE --> MCIROP --> MCLIENT --> EXTMCP end

{{ARCH_CTA_HEADING_HTML}}

{{ARCH_CTA_BODY}}