criogenai

Reasoning

ReAct

Think, act with a tool, observe, repeat.

ReAct (reason + act) runs one model in a loop. Each turn it writes a short thought, picks a tool, reads what the tool returned, and decides again, until it can answer.

It is the default shape of a tool-calling agent: flexible, easy to follow in a trace, and it stops as soon as it has enough.

Use it when
The steps depend on what the tools return
A handful of tools, one goal
You want a readable trace of why each call happened
Skip it when
The steps are always the same (a fixed workflow is cheaper)
Many independent lookups (ReWOO or parallel calls do them at once)

Run it

Scripted model · no key needed · CriogenAI engine in your browser
Ready
actobserveactobservefinalQuestionReasonweather()calendar()Answer
The runmodel 0 · tools 0
  1. Press Run to watch the pattern work, step by step.
Try it with your own key optional: a real model makes the decisions; the tools stay simulated
  • Your key stays in this tab's memory: not saved, not in cookies or the address bar. Reload or close the tab and it is gone.
  • Your browser calls OpenAI directly. Nothing passes through criogenai.com, and nothing is logged.
  • Each run makes at most 16 short model calls, billed to your account. Tools, data and side effects are simulated.

This run is the TypeScript code below, running on the CriogenAI engine in your browser (WebAssembly). Without a key, a scripted model stands in for MODEL; with your key, your provider answers, called from this tab. The tools return made-up data.

Build it with CriogenAI

Ready-made: patterns.react
@tool
def weather(city: str) -> str:
    """Today's forecast for a city."""
    return f"{city}: 24 °C, sunny, 5% chance of rain"

@tool
def calendar(day: str) -> str:
    """The user's plans for Saturday or Sunday."""
    return "Saturday: free after 11:00"

# Think → call a tool → read the result → repeat, at most 6 model calls.
agent = patterns.react("openai:gpt-5-mini", [weather, calendar], max_steps=6)
result = await agent.run("Is this weekend good for a picnic in Lisbon?")
print(result.text)
const weather = tool({
  name: "weather",
  description: "Today's forecast for a city.",
  input: z.object({ city: z.string() }),
  run: ({ city }) => `${city}: 24 °C, sunny, 5% chance of rain`,
});
const calendar = tool({
  name: "calendar",
  description: "The user's plans for Saturday or Sunday.",
  input: z.object({ day: z.string() }),
  run: () => "Saturday: free after 11:00",
});

// Think → call a tool → read the result → repeat, at most 6 model calls.
const agent = patterns.react(MODEL, [weather, calendar], { maxSteps: 6 });
const result = await agent.run(task);
console.log(result.text);