DevInterviewMasterStart free →
Agentic AI PatternsFree to read

Goal Setting & Monitoring

Tell the agent EXACTLY what 'done' looks like

Imagine you send a new intern to "sort out the office party." If you never say what success means, they might spend the whole day picking balloon colours and forget the food. Goal Setting means writing down a clear, measurable target and a checklist for "done." Monitoring means checking, step by step, whether the agent is actually getting closer to that target, and stopping it if it wanders off.

Key points

What 'Goal Setting & Monitoring' means

Goal Setting is giving the agent a specific, measurable target plus clear success criteria (how we know it's finished). Monitoring is continuously comparing the agent's progress against that target and applying stopping conditions so it doesn't loop forever or wander off task.

Note: Clear goal + measurable success criteria + progress checks + stop rules = an agent that finishes the RIGHT job.

Vague goal vs measurable goal

VAGUE GOAL (agent drifts) MEASURABLE GOAL (agent focuses) ────────────────────────── ───────────────────────────────

"Make the report better" "Cut the report to <500 words, │ add a 3-bullet summary, fix ▼ all spelling." ┌─────────────┐ │ │ agent guesses│ ▼ │ endlessly... │ ┌──────────────┐ │ 🌀 🌀 🌀 │ │ check 3 boxes │ └─────────────┘ │ [x] <500 words│ │ │ [x] summary │ ▼ │ [x] spelling │ ❓ never sure it's done └──────┬───────┘ ▼ ✅ all 3 met = DONE

The 4 ingredients of a good goal

The monitoring loop (goal in the middle)

┌─────────────────────────┐ │ GOAL + SUCCESS CHECK │ │ [ ] <500 words │ │ [ ] has 3-bullet summary│ │ [ ] spelling clean │ └────────────┬────────────┘ │ compare every step ┌─────────────────────────┼─────────────────────────┐ ▼ ▼ ▼ ┌─────────┐ act ┌─────────────────┐ observe ┌──────────────┐ │ THINK │───────► │ DO ONE STEP │─────────► │ CHECK PROGRESS│ └─────────┘ └─────────────────┘ └──────┬───────┘ ▲ │ │ not all boxes ticked AND steps left AND budget │ └────────────────────────────────────────────────────┘ │ all boxes ticked │ OR out of steps/budget ▼ 🛑 STOP

A tiny code example (read it like English)

Here the goal is a checklist of functions. Each loop we re-run the checklist, count how many pass, and stop the moment all pass or we hit a safety limit.

MAX_STEPS = 10
MAX_COST = 20.0  # rupees

def success_criteria(report):
    return {
        "under_500_words": len(report.split()) < 500,
        "has_summary": "Summary:" in report,
        "spelling_ok": spell_check(report) == 0,
    }

report, cost, step = draft(), 0.0, 0
while True:
    checks = success_criteria(report)
    met = sum(checks.values())
    print(f"step={step} progress={met}/3 cost=₹{cost:.1f}")  # MONITOR

    if all(checks.values()):
        print("✅ goal reached"); break              # stop: success
    if step >= MAX_STEPS or cost >= MAX_COST:
        print("🛑 stopped: hit a limit"); break      # stop: safety

    report, spent = improve(report, failing=checks)  # ACT
    cost += spent; step += 1

When to invest in goals & monitoring

ScenarioRecommendationWhy
Open-ended task ('improve', 'research', 'optimize')✅ Define measurable criteriaWithout them the agent never knows when to stop.
Long multi-step jobs that cost real money✅ Add progress + budget checksMonitoring catches runaway loops early.
A single, deterministic transform you fully control❌ Lightweight is fineThere's only one step; nothing to drift.
User-facing assistant that must not stall✅ Add stopping conditionsGuarantees a timely answer instead of silence.

Goal & monitoring mistakes

MistakeConsequenceFix
Goals written as vague wishes ('make it good').The agent can't tell when it's done, so it drifts or stops too early.Turn the goal into true/false checks you can run automatically.
No stopping condition besides 'success'.If success is never reached the agent loops forever and burns budget.Always add max-steps, max-cost and no-progress stop rules.
Measuring nothing during the run.You only find out it went wrong after it finished (or crashed).Log progress (e.g. 2/3 criteria met) every loop so you can watch live.

Remember these lines

Key takeaways

Frequently Asked Questions

What is Goal Setting & Monitoring?

Imagine you send a new intern to "sort out the office party." If you never say what success means, they might spend the whole day picking balloon colours and forget the food. Goal Setting means writing down a clear, measurable target and a checklist for "done." Monitoring means checking, step by step, whether the…

How does Goal Setting & Monitoring work?

Goal Setting is giving the agent a specific, measurable target plus clear success criteria (how we know it's finished). Monitoring is continuously comparing the agent's progress against that target and applying stopping conditions so it doesn't loop forever or wander off task.

What are the key takeaways about Goal Setting & Monitoring?

Goal Setting gives the agent a specific target plus measurable success criteria. Monitoring compares progress to that target every step of the loop. Stopping conditions (success, max-steps, max-budget, no-progress) prevent runaway agents. If you can't express 'done' as true/false checks, your goal is still too vague.

Browse all Agentic AI Patterns topics →

Practice this on DevInterviewMaster

Read the full Goal Setting & Monitoring breakdown with interactive demos, quizzes, and Hinglish notes.

Open the interactive topic →

800+ system-design, LLD, coding, and design-pattern topics. Unlock everything with Pro (₹499, one-time) or Ultimate (₹999, one-time) — lifetime access, no subscription.