Active Nerds
Back to Cheat Sheets
Topic Reference

Agentic AI Cheat Sheet

Quick reference guide for agent loops (ReAct), tool selection, MCP protocol, reflection loops, and multi-agent patterns.

Last updated: 2026-07-25

Agent Loop Patterns

Command / PatternDescription
ReAct (Thought -> Action -> Observation)

Interleave explicit step-by-step reasoning thoughts with action tool calls and observation inputs.

Plan-and-Execute

First phase generates structured DAG plan breakdown; second phase executes sub-tasks sequentially.

Reflection / Critique Loop

Evaluator LLM checks output against acceptance criteria, returning feedback to generator until pass.

Human-in-the-Loop (HITL)

Pause agent execution loop on high-risk tool calls (e.g. write file, run terminal command) awaiting user approval.

Tool Call Schema & Protocol

Command / PatternDescription
JSON Schema Tool Definition

Declare tool name, description, and strict parameter properties/types in system schema payload.

MCP JSON-RPC Request

Standard protocol method invocation: `tools/call` with parameters over stdio IPC or SSE transport.

Tool Response Handling

Format tool outputs clearly as string or JSON observations injected directly back into chat context.

Multi-Agent System Topologies

Command / PatternDescription
Supervisor / Orchestrator Pattern

Central supervisor agent inspects goal, routes tasks to domain subagents, and synthesizes output.

Hierarchical Team Pattern

Tree hierarchy where department sub-supervisors manage worker agents for deep sub-tasks.

Sequential Pipeline Swarm

Linear chain where Output of Agent A becomes Input context for Agent B (e.g. Specs -> Code -> Test).

Agent Safety & Guardrails

Command / PatternDescription
Max Iterations Guard

Hard cutoff (e.g. max_steps = 15) preventing runaway infinite tool loops or budget exhaustion.

Tool Permission Scoping

Restrict write/execute tool access to specific workspace directory paths, blocking root/system access.

Context Window Truncation

Prune old observation logs or summarize earlier loop turns when approaching model context window limits.