Re in Act
Re in Act extends reason into the action loop, so local disturbances are handled before they turn into extra round trips, noisy context, and brittle control in traditional ReAct agents.
Set the goal and guardrails once. Let small decisions happen where the work happens.
Start Here
Start with the docs, read the spec, dig into the rationale, or join the project.
From ReAct to Re in Act
How the flow changes: less stop-and-think, more structured action.
Paradigm Shift
ReAct returns to the outer loop at every step. Re in Act keeps the work moving inside one RAS.
Local Action Space
One RAS can coordinate multiple act() and reason() steps before returning a denoised result.
Run tests, read logs, or fetch a document without pushing raw output back to top-level reasoning.
Turn noisy evidence into one bounded decision using an explicit goal, observation, relevant context, and constraints.
Execute the next step, inspect the result again, and only return a denoised outcome once the local job is actually settled.
Two Action Forms
The same idea can run as code or shell pipelines. In both forms, deterministic Turing-complete control is stronger than probabilistic LLM-stepped flow.
The Interfaces
Two simple interfaces: one for local judgment, one for external action.
reason(prompt, example_output)
Turns goal plus local reality into structured output that the RAS can use right away.
act(name, args) — Optional
Calls tools or external systems with explicit arguments, returning structured output and errors.
Reason-able Action Spaces
What the RAS looks like in practice: multiple act() and reason() steps cooperating inside one bounded action space.
Code RAS (Python / TS)
Deterministic orchestration in scripts: branches, loops, retries, and validation happen in code, while `reason()` supplies bounded judgments. That gives the runtime Turing-complete deterministic control instead of probabilistic LLM-stepped control.
1test_run = await act('bash', 'npm test -- --reporter json')23focus = await reason(4['Goal: pick the retry step.',5observation, 'Relevant context: latest CI run.',6'Constraints: return retry_cmd + reason only.'],7{"retry_cmd": "", "reason": ""},8)910retry_run = await act('bash', focus['data']['retry_cmd'])11decision = await reason(12['Goal: continue or escalate?',13retry_run['content'][0]['text'], focus['data']['reason'],14'Constraints: return action + reason only.'],15{"action": "continue", "reason": ""},16)17if decision['data']['action'] == 'escalate':18await act('notify', {'message': decision['data']['reason']})19print(decision['data']['reason'])20else:21await act('deploy', {'target': 'production'})22print('deployed')
Bash RAS
Unix-style pipelines compose `reason` and `act` in a single action phase. Shell gives you deterministic, Turing-complete control flow, while the LLM stays confined to bounded local judgments.
RAS as Harness
When the optional agent() extension is used, the RAS is the harness: agent() does delegated work inside it, and the RAS keeps that work explicit, bounded, and auditable.
This is specifically the agent extension pattern: agent() runs delegated work inside the RAS, returns text and trajectory, reason() verifies those signals inside the RAS, and deterministic limits are enforced inside the RAS.
Delegated agent work
When the optional agent() extension is present, the RAS can host delegated agent work inside one bounded action space instead of turning that delegation into a separate top-level architecture.
Post-agent verification
In this pattern, reason() is not acting as an agent. It checks both text and trajectory returned by agent(), extracts the signal that matters, and turns it into structured control data.
Deterministic boundaries
Loops, max iterations, timeout, escalation, and stop conditions live in the runtime. That is what makes the RAS the harness for agent() rather than just another prompt wrapper.
This harness framing belongs to the optional agent() extension. The point is not that reason() is agent-related by itself, but that once agent()is introduced, the RAS becomes the harness that contains delegated work, verification, and escalation. See Agent Interface Extension. For related harness terminology in long-running agent systems, see Harness design for long-running apps.