System¶
System defines the runtime execution architecture that turns objectives, patterns, skills, tools, connectors, and memory into a single coordinated reasoning-and-action loop. Where Memory supplies durable knowledge and State curates the working context window, the System layer defines how the runtime actually steps forward; what the agent thinks, what it acts on, how it observes results, how it plans, when it reflects, when it branches, and when it terminates. Emergence treats the System layer as a swappable runtime pattern: a Unitt may run a simple Thought → Action → Observation loop for routine workloads, or compose multiple deliberative search and reflection patterns for high-stakes operations.
Runtime patterns inside Emergence are drawn directly from the active agentic research lineage, including ReAct, Reflexion, ReWOO, Plan-and-Solve, Tree-of-Thoughts, Graph-of-Thoughts, LATS, Self-Refine, CodeAct, Voyager, reasoning-native models such as DeepSeek-R1, and long-horizon agentic-OS runtimes. Selection criteria for picking a runtime pattern for a given Unitt workload are documented in Research › Runtime Systems.
Runtime Loop¶
Every System pattern in Emergence is implemented as a deterministic step function that observes runtime state, advances reasoning, optionally invokes tools, optionally writes memory, and emits the next runtime event. The step function is wrapped by a governance harness that enforces budgets, policies, and validation gates between every transition so that even adaptive runtime patterns remain controllable.
flowchart LR
O[Objective] --> S[Runtime Step]
S --> T{Tool?}
T -->|yes| X[Execute Tool]
X --> OB[Observation]
T -->|no| R[Reason / Plan]
OB --> R
R --> M{Memory Write?}
M -->|yes| MW[Write Memory]
M -->|no| G{Goal Met?}
MW --> G
G -->|no| S
G -->|yes| F[Finalize Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class O,S,T,X,OB,R,M,MW,G,F stage
The runtime step is the atomic unit of execution. All higher-level runtime patterns are compositions of step functions; ReAct interleaves a single loop, Reflexion wraps multiple trials around the loop, Plan-and-Execute decomposes one outer loop into many inner loops, and Tree-of-Thoughts expands the loop over multiple frontier states. This compositional view lets the platform select, replace, and benchmark runtime patterns without rewriting the surrounding governance, memory, or connector layers.
Reasoning Patterns¶
The patterns below define the active runtime strategies available to a Unitt. Each pattern is selected based on the objective profile, deliberation budget, observability requirement, and reliability target documented in Research › Runtime Systems. A single Unitt may run different patterns for different objectives, and the WorldSim layer is used to validate which pattern produces the best outcome for a given workload.
ReAct¶
ReAct (Yao et al., 2023) interleaves a Thought / Action / Observation trace inside a single agent. The model reasons aloud, calls a tool, observes the result, and conditions the next thought on the accumulated trace. ReAct is the default Emergence runtime pattern for short-to-medium-horizon workloads with well-typed tools because it is cheap, debuggable, and produces a fully readable execution trace.
flowchart LR
A[Agent] -->|thought| A
A -->|action| T[Tool]
T -->|observation| A
A -->|finish| F[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class A,T,F stage
ReAct fails on tasks that need global planning, when observations are noisy enough to thrash the trace, or when context bloat from accumulated observations exceeds the working-memory budget. Emergence mitigates these by combining ReAct with the State layer's compaction and the Memory layer's recall pipeline.
Reflexion¶
Reflexion (Shinn et al., 2023) wraps the ReAct loop in an outer trial / evaluate / reflect cycle. After each attempt, an evaluator scores the trajectory and a self-reflection module writes a natural-language critique to episodic memory; the next attempt prepends that memory. This is "verbal reinforcement learning"; policy improvement without weight updates.
flowchart LR
AC[Actor: ReAct Trial] --> EV[Evaluator]
EV --> SR[Self-Reflection]
SR --> EM[Episodic Memory]
EM --> AC
EV -. success .-> F[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class AC,EV,SR,EM,F stage
Reflexion is selected for workloads with a verifiable reward signal; unit tests, oracle outputs, validation checkpoints; and a budget for multiple trials. It pairs naturally with WorldSim regression scenarios where each scenario produces a deterministic pass/fail signal.
ReWOO¶
ReWOO (Xu et al., 2023) decouples planning from observation. A Planner emits the complete dependency graph of tool calls upfront with variable placeholders; Workers execute the tool calls in parallel where dependencies allow; a Solver receives the resolved evidence table and emits the final answer. The Planner never sees intermediate observations, which yields roughly a 5× token reduction relative to ReAct on predictable multi-hop workloads.
flowchart LR
Q[Query] --> P[Planner]
P --> W1[Worker / Tool 1]
P --> W2[Worker / Tool 2]
P --> W3[Worker / Tool 3]
W1 --> S[Solver]
W2 --> S
W3 --> S
S --> F[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class Q,P,W1,W2,W3,S,F stage
ReWOO is selected when the plan is inferable from the question alone (research, fixed-schema retrieval, structured lookups) and when token efficiency matters more than mid-flight adaptation.
Plan-and-Execute¶
Plan-and-Execute (Wang et al., 2023) separates strategic planning from tactical execution. A heavyweight Planner writes an explicit ordered plan; an Executor; often a smaller, cheaper ReAct sub-agent; runs one step at a time; a Replanner observes the updated past_steps after each step and either revises the remaining plan or emits the final answer.
flowchart LR
O[Objective] --> P[Planner]
P --> EX[Executor]
EX --> RP[Replanner]
RP -->|revise| EX
RP -->|finalize| F[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class O,P,EX,RP,F stage
This pattern is the workhorse for medium-to-long workflows where planning is expensive but execution can be delegated to a cheaper runtime tier. It is the default System pattern for multi-stage Patterns that include validation checkpoints, human approvals, and connector-heavy work.
Tree-of-Thoughts¶
Tree-of-Thoughts (Yao et al., 2023) lifts inference from autoregressive generation to deliberate search over discrete reasoning states. At each frontier, a Thought Generator proposes k candidate next-thoughts; a State Evaluator scores each; a search algorithm (BFS / DFS / beam) expands the most promising frontier and optionally backtracks.
flowchart TD
R[Root: Problem]
R --> A1[Thought A]
R --> A2[Thought B]
R --> A3[Thought C]
A1 --> B1[Continuation A1]
A1 --> B2[Continuation A2]
A2 --> B3[Continuation B1]
A3 -. pruned .-> X[Discarded]
B1 --> F[Leaf: Candidate Solution]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class R,A1,A2,A3,B1,B2,B3,X,F stage
ToT is selected for combinatorial reasoning with scorable intermediate states; constraint satisfaction, planning under uncertainty, code synthesis fragments; and only when correctness justifies the branching-factor × depth token cost.
Graph-of-Thoughts¶
Graph-of-Thoughts (Besta et al., 2024) generalizes ToT to an arbitrary DAG. In addition to expansion, GoT supports aggregation (merging multiple thoughts into one) and refinement (self-loop edges) under the control of a developer-defined operator graph. GoT is selected when sub-problems share substructure or when synthesis of partial solutions yields a stronger whole; multi-source summarization, sorting and merging workloads, document synthesis.
LATS¶
LATS (Zhou et al., 2024) unifies reasoning, acting, planning, and reflection inside a Monte Carlo Tree Search. Each iteration selects a leaf via UCB, expands with ReAct-style actions, simulates and evaluates with a language-model value function, backpropagates value up the tree, and on failure reflects into a verbal critique that biases future selection.
flowchart LR
SEL[Select via UCB] --> EXP[Expand: ReAct Action]
EXP --> SIM[Simulate / Evaluate]
SIM --> BP[Backpropagate Value]
BP --> SEL
SIM -. failure .-> RFL[Reflect to Critique Store]
RFL --> SEL
BP -. terminal .-> F[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class SEL,EXP,SIM,BP,RFL,F stage
LATS is selected only for high-stakes workloads where compute budget is large and the environment is reversible enough to support rollouts; e.g., code generation, decisional agents, validated research pipelines.
Self-Refine¶
Self-Refine (Madaan et al., 2023) uses the same model to generate, critique, and revise its own output in a tight cycle. It is the cheapest deliberative pattern and is selected for constrained generation tasks (style, math, format compliance) where the model is a competent critic of its own work.
CodeAct¶
CodeAct (Wang et al., 2024) replaces JSON tool calls with executable code in a stateful interpreter. The Action channel is Python source; the Observation is stdout, stderr, and return values. Variables persist across turns, enabling composition, loops, conditionals, and library calls as first-class agent actions. Emergence enables CodeAct for Unitts that operate on data, scientific workflows, or any workload where Python expressivity reduces step count.
Voyager¶
Voyager (Wang et al., 2023) composes an Automatic Curriculum, an Iterative Prompting code generator, and a Skill Library into an open-ended lifelong-learning runtime. Verified code is stored in the procedural memory tier, and future curricula retrieve relevant skills as primitives. Emergence uses the Voyager pattern for Unitts that operate in long-lived sandboxed environments where capability should compound over time.
Reasoning-Native Models¶
Frontier reasoning models such as DeepSeek-R1, OpenAI o-series, and Claude extended-thinking emit a long internal chain-of-thought before each action. When a Unitt uses a reasoning-native model, the System pattern collapses to a "thin ReAct" loop; the model handles deliberation inside a single forward pass, and the harness handles tools, observability, and termination.
flowchart LR
A[Reasoning Model] -->|internal think| A
A -->|action| T[Tool]
T -->|observation| A
A -->|finish| F[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class A,T,F stage
This pattern is selected when each runtime step deserves deep deliberation but the surrounding scaffolding should remain lightweight, observable, and cheap.
Agentic-OS Long-Horizon Runtime¶
For Unitts that operate over hours or days, Emergence supports an agentic-OS pattern in which a central Planner / Orchestrator decomposes the objective into a hierarchical task graph, specialized Subunits run asynchronously inside a durable runtime environment with persistent filesystem and connectors, CodeAct is the action substrate, and a scheduler resumes paused tasks on external events. State is durable across the full operational horizon, and human-in-the-loop interrupts are first-class.
Pattern Selection¶
Pattern selection is governed by the objective profile, the runtime budget, the deliberation depth required, and the reliability target. The recommended selection heuristic is documented and continuously refined in Research › Runtime Systems. The runtime continuously evaluates pattern performance against simulation outcomes in WorldSim and may mutate or replace the active pattern as part of the evolutionary optimization loop described under Emergence.
| Pattern | When to Select |
|---|---|
| ReAct | Short tool-use loops, well-typed tools, debuggability required. |
| Reflexion | Verifiable reward signal, multi-trial budget, regression-grade reliability. |
| ReWOO | Predictable multi-hop retrieval, parallel tool execution, token efficiency. |
| Plan-and-Execute | Multi-step workflows, cheap-executor / smart-planner split, mid-flight adaptation. |
| Tree-of-Thoughts | Combinatorial reasoning, scorable intermediate states, correctness >> cost. |
| Graph-of-Thoughts | Shared substructure, aggregation across partial solutions, multi-source synthesis. |
| LATS | High-stakes deliberation, reversible environment, large compute budget. |
| Self-Refine | Constrained generation, single-model critic-and-revise loops. |
| CodeAct | Data, scripting, scientific workloads, Python-native composition. |
| Voyager | Open-ended sandboxed environments, lifelong skill accumulation. |
| Reasoning-native | Each step deserves deep deliberation, scaffold should stay thin. |
| Agentic-OS | Multi-hour horizons, durable state, async wake-ups, hierarchical sub-agents. |
Composition¶
Production Unitts routinely compose multiple patterns. A typical enterprise configuration runs an Agentic-OS orchestrator on a reasoning-native model, with CodeAct as the action substrate, Reflexion-style memory across runs, and LATS reserved for the hardest sub-objectives. Composition is declarative; each Unitt defines which pattern is active at which workflow stage, and the WorldSim loop validates that the composed runtime produces the intended outcome.
flowchart TD
OR[Agentic-OS Orchestrator] --> SU1[Subunit: Research]
OR --> SU2[Subunit: Build]
OR --> SU3[Subunit: Validate]
SU1 -. uses .-> RW[ReWOO]
SU2 -. uses .-> CA[CodeAct]
SU3 -. uses .-> LA[LATS]
RW -. writes .-> EM[Episodic Memory]
CA -. writes .-> EM
LA -. writes .-> EM
EM -. reflects .-> OR
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class OR,SU1,SU2,SU3,RW,CA,LA,EM stage
Governance Of The Runtime Loop¶
Every runtime pattern is wrapped by the same governance harness defined in Core › Governance. Budgets, policies, validation gates, and audit trails are enforced between every step regardless of which pattern is active. Reflection writes pass an explicit governance gate. Tool calls pass an authorization gate. Memory writes pass a sensitivity gate. The harness is what makes adaptive runtime patterns safe to operate in production.
Runtime Governance Requirements
- Every step records the active pattern, model, tools used, memory reads / writes, and budget consumed.
- Tool authorization is re-evaluated at every Action transition, not just at agent boot.
- Reflection and replanning passes are themselves governed runtime steps with their own budget.
- Pattern switches are explicit, logged, and reversible.
- Reasoning traces and search trees are retained in the audit trail for replay and regression.
Cross-References¶
- Memory supplies the durable substrate that reflection and replanning write into.
- State curates the working context window consumed by every runtime step.
- Subunits describes how complex runtimes are decomposed into specialized sub-agents.
- WorldSim describes how runtime pattern performance is benchmarked and evolved.
- Research › Runtime Systems documents the selection criteria, citations, and source research behind each pattern.