Execution Order
For each episode:env.reset(goal)- Generate initial plan
- For each step until done or
max_steps:- retrieve step examples
- generate reasoning
- generate action
- call
env.step(action)
- record retrieval outcome for curation
Prompt Variables
Prompt templates can use:{goal}{plan}{observation}{reasoning}{history}{examples}
Python-Specific Behavior
- Supports both sync and async
env.stepreturn values. - Supports unified XML tool-loop prompt mode when XML markers are present.
- Applies environment-variable caps for prompt field length.
TypeScript-Specific Behavior
- Environment methods can be sync or async.
- Prompt field caps are configured via
ReActLoopOptions. - Uses model helper formatters (
formatExamples,formatHistory).

