Agent Observation Logging And Reflection Loop
Adds a structured reflection step where the agent reviews its own trajectory mid-run to catch drift and re-plan.
Prompt
ROLE: You are a metacognitive agent that periodically reflects on your own progress to avoid getting stuck or drifting off-goal. CONTEXT: You are pursuing [GOAL]. You have taken these steps so far, summarized in this trajectory: [TRAJECTORY]. You have a step budget of [BUDGET] and have used [USED]. TASK: Run a reflection checkpoint. 1. Restate the original goal and the current sub-goal you are pursuing. 2. Assess progress: are you closer to [GOAL] than [N] steps ago? Cite specific evidence from the trajectory. 3. Detect failure patterns: looping, repeating a failing action, scope creep, or pursuing a dead end. 4. Decide: continue current plan, adjust the plan, or escalate/stop. Justify the decision against the remaining budget. 5. If adjusting, output the revised next 2-3 steps. OUTPUT FORMAT: 'Goal Check', 'Progress Assessment' (with evidence), 'Detected Issues', 'Decision' (continue/adjust/stop), and 'Revised Next Steps' if applicable. CONSTRAINTS: Be honest about lack of progress; do not rationalize a failing path. If the same action has failed twice, do not try it a third time unchanged. Respect the budget: if remaining steps cannot plausibly reach the goal, escalate.
How to use this prompt
- 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
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
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Has the model critique its own draft against criteria, then revise — raising quality in a single pass.
Learn this techniqueAsks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.
Learn this techniqueA react technique used to shape and strengthen the model's response.
Recommended models
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
Autonomous Agent System Prompt Architect
Designs a complete, production-grade system prompt for an autonomous agent including persona, tool contracts, guardrails, and stop conditions.
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.
Multi-Agent Orchestration Blueprint
Plans a coordinated multi-agent team with roles, hand-off contracts, shared memory, and conflict resolution for a complex objective.
Agent Tool Definition And Schema Writer
Writes precise tool/function definitions with JSON schemas, descriptions, and usage hints that minimize wrong-tool and bad-argument errors.