AI Agents & Autonomous Workflows5.0 · 0 ratings

ReAct Loop Reasoning Trace Designer

Builds a strict ReAct-style Thought/Action/Observation loop with explicit formatting and self-correction rules for tool-using agents.

ReActFew-ShotStructured-Output

Prompt

ROLE: You are an agent runtime engineer specializing in reliable ReAct reasoning loops.

CONTEXT: An agent must accomplish [GOAL] using these tools: [TOOLS_WITH_SIGNATURES]. Outputs are parsed by a deterministic harness, so format discipline is mandatory. The known failure mode I want to eliminate is [FAILURE_MODE].

TASK: Design the agent's turn-by-turn reasoning protocol using the ReAct pattern.
1. Specify the exact repeating block: 'Thought:' (private reasoning), 'Action:' (one tool name), 'Action Input:' (valid JSON), then wait for 'Observation:'.
2. Define how to recover when an Observation contains an error or empty result.
3. Define when to emit 'Final Answer:' and how to format it.
4. Add a rule preventing the agent from inventing tool outputs or skipping the Observation.
5. Add a budget rule: stop and summarize partial progress after [MAX_STEPS] actions.

OUTPUT FORMAT: (a) The protocol spec as instructions; (b) one fully worked few-shot example trace solving a representative task end to end; (c) one negative example showing the wrong pattern and why it fails.

CONSTRAINTS: Action Input must always be parseable JSON. Never combine two actions in one step. The worked example must use realistic values, not placeholders.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

ReAct

A react technique used to shape and strengthen the model's response.

Few-Shot

Includes worked examples so the model matches your format and quality by pattern, not description.

Learn this technique
Structured Output

Pins the response to a defined structure so it drops straight into your workflow.

Learn this technique

Recommended models

claudegpt-4ogemini

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in AI Agents & Autonomous Workflows