Vendor-neutral architectural guide for designing reliable AI systems: Sequential Decision Framework, Tripartite Execution Regimes (Deterministic Code vs. Probabilistic LLM vs. HITL), Architectural Evaluation Criteria, the 5 canonical workflow patterns, autonomous reasoning loops (ReAct, Plan-and-Execute, Reflection), 4-tier memory & context engineering, multi-agent topologies & typed HandoffContract schemas, and production failure modes.
Agentic design patterns are reusable, framework-agnostic architectural blueprints that govern how an LLM-based system decomposes work, selects control flow, invokes tools, manages context memory, coordinates across specialized workers, and defers high-stakes decisions to deterministic code or human reviewers. They apply identically across Google ADK, the Claude Agent SDK, LangGraph, or direct model API loops.
A raw language model is a stateless, probabilistic token predictor—it can propose an action, but it cannot execute tools, enforce hard business invariants, persist session state, or halt a runaway loop. Architectural patterns define who owns the control flow (deterministic code vs. dynamic model reasoning), where authority sits (code gates vs. model judgment vs. human sign-off), and how context stays clean as tasks scale.
The model is the probabilistic reasoning engine; the architecture is the deterministic harness (nervous system, brakes, and safety interlocks). Start with the simplest architecture that passes your evaluation suite: climb from deterministic code → a single augmented LLM call → a predefined workflow → an autonomous agent only when empirical evaluations prove the simpler tier fails.
| Layer | Control Owner | Role & Runtime Behavior | Memory Hook |
|---|---|---|---|
| Raw LLM | Caller (1 turn) | Stateless token predictor; reasons over prompt context and emits text or structured tool requests, but never executes code. | "Brain in a jar" |
| Augmented LLM | Caller (1 turn + tools) | Single model call equipped with Retrieval (RAG), Tools (MCP/functions), and Memory (read/write state). Handles most production features. | "LLM with a backpack" |
| Composable Workflow | Application code | Multi-step pipeline where LLMs and tools execute along predefined code paths with deterministic gates between steps. | "Railway tracks" — train cannot leave the rails |
| Autonomous Agent | The model | LLM dynamically directs its own multi-turn process, choosing which tools to call and when to stop based on environmental ground truth. | "Taxi" — driver picks the route dynamically |
| Agent Harness / Framework | Infrastructure | Runtime layer (ADK, Claude Agent SDK, LangGraph) supplying the event loop, state persistence, sandboxing, callbacks, and observability. | "Chassis, brakes & dashboard" |
Calling an LLM five times in a Python script does not make the system an "autonomous agent." If application code dictates the sequence, branching, and retry count, it is a workflow. It becomes an agent only when the model itself decides the next step and action trajectory at runtime.
Before writing a single system prompt or selecting an agent framework, resolve four sequential architectural decisions. Skipping Decision 1 or 2 is the primary cause of over-engineered, brittle, or unsafe deployments.
Decompose the business process across Tripartite Execution Regimes (Deterministic Code vs. Probabilistic LLM vs. Human-in-the-Loop).
Select Single Augmented Call, Composable Workflow, or Autonomous Agent using Architectural Evaluation Criteria.
Assign per-step model tiers and reasoning effort, transport mode (sync, stream, batch), and regional data boundaries.
Enforce pre-LLM epistemic gates, tool-boundary callbacks, schema validators, cold-context critics, and HITL checkpoints.
| Execution Regime | Execution Engine | What Belongs Here | Canonical Examples | Why Other Regimes Fail |
|---|---|---|---|---|
| Regime 1: Deterministic Code | Plain application code, SQL, regex, type schemas, policy hooks | Exact arithmetic, schema validation, RBAC & permission enforcement, idempotency keys, database writes, PII redaction, hard policy gates | Fee & tax math, date arithmetic, checking amount <= 500, enforcing user_id tenant scoping, verifying cited section headers exist in source text | LLMs introduce deterministic invariant degradation (silent tail-risk math or rule violations); humans are too slow and inconsistent at scale |
| Regime 2: Probabilistic Model (LLM) | Augmented LLM, Workflow node, or Agent loop | Unstructured synthesis, semantic classification, ambiguous entity extraction, fuzzy matching, multi-step planning over open-ended inputs | Summarizing conflicting legal clauses, triaging free-text support tickets, diagnosing novel stack traces across a codebase, drafting code diffs | Rigid code/regex shatters on phrasing variations; humans cannot manually read 50,000 documents per hour |
| Regime 3: Human-in-the-Loop (HITL) | Human reviewer via durable approval queue / UI checkpoint | High-blast-radius irreversible actions, novel policy exceptions, regulated sign-offs, subjective value trade-offs | Approving a $25,000 wire refund, executing a production database drop, granting an exception to legal policy, merging security-critical PRs | Code lacks contextual judgment for novel exceptions; models cannot bear legal, financial, or ethical accountability |
Deterministic drift occurs when a team delegates exact, rule-bound logic—such as calculating pro-rated subscription refunds, enforcing role-based access control (RBAC), checking date eligibility windows, or redacting Social Security Numbers—to a system prompt instead of application code.
PreToolUse / before_tool_callback hooks, Pydantic validators, or SQL constraints).issue_refund(order_id="ORD-891", amount_usd=490.00)), never vague model prose.<= $50 in code; require HITL for > $50) so human reviewers do not rubber-stamp alerts.Once Regime 2 (the probabilistic slice) is isolated, evaluate architectural criteria to choose between a Single Augmented LLM Call, a Composable Workflow, and an Autonomous Agent.
| Evaluation Criterion | Single Augmented LLM Call | Composable Workflow (DAG / Chain) | Autonomous Agent (Open Loop) |
|---|---|---|---|
| 1. Task Path Predictability | Fully known (1 step): Input maps directly to output with retrieved context or a single tool lookup. | Known decomposition (K steps): Multi-step process where the sequence, branches, or fan-out categories are fixed in advance. | Unknown / emergent (N steps): Step N+1 depends entirely on what tool observation N revealed (e.g., debugging an unknown bug). |
| 2. Latency Budget | Sub-second to ~3 s: Single model roundtrip; ideal for synchronous inline UI responses. | ~3 s to ~15 s: Predictable bounded latency (K sequential stages or 1 parallel fan-out + join). | Seconds to minutes+: Open-ended O(N) sequential turns; requires streaming progress UI or background execution. |
| 3. Error Blast Radius & Reversibility | Low / read-only: Output is displayed to a user or validated by caller code before any state mutation. | Medium / gated: Intermediate code gates catch bad outputs between stages before downstream side-effects run. | High if ungated: Multi-turn tool mutations can compound; requires sandboxing, file checkpoints, and HITL gates on writes. |
| 4. Token Cost Ceiling | ~1× baseline: Minimal prompt overhead; highest prompt-cache hit ratio. | ~3–5× baseline: Bounded multiplier across K focused prompts; easy to route cheap tiers to simple nodes. | ~10–15×+ baseline: Context accumulates across turns and tool outputs; requires strict token/turn caps and compaction. |
| 5. Auditability & Compliance Rigor | High: Single input/output pair; trivial to log and reproduce. | Highest for multi-step: Deterministic transitions and explicit code gate pass/fail logs satisfy strict regulatory audits. | Complex: Non-deterministic trajectories require full event-ledger tracing (tool_trajectory) and replay harnesses. |
"" from a timed-out tool, or a missing policy clause, an unguarded model invents confident facts or fabricated citations. Mitigation: Pre-LLM epistemic gates, explicit is_error: true tool results, and grounded citation verification.<= 16 per agent, and isolate noisy exploration in subagents.0.95^10 ≈ 60% of the time because an early misread file poisons every subsequent turn. Mitigation: Insert ground-truth environmental feedback (compilers, unit tests, schema validators, code gates) after every step to reset the error curve.When a single call falls short due to instruction crowding, multi-stage dependencies, or latency/cost trade-offs—but the control structure can be designed upfront—compose the five canonical workflow patterns. In all five, application code owns or bounds the control flow.
| Pattern | Control Flow Shape | Primary Optimization | Canonical Use Case | Memory Hook |
|---|---|---|---|---|
| 1. Prompt Chaining | LLM 1 → [Code Gate] → LLM 2 → LLM 3 | Accuracy via focused sub-steps + early fail-fast | Drafting an outline → verifying structure in code → generating localized report | "Assembly line with quality inspectors" |
| 2. Routing | Classifier → Specialist Handler A | B | C | Separation of concerns & per-tier cost optimization | Directing billing, refund, and tech-support tickets to distinct prompts, tools, and model tiers | "Hospital triage desk" |
| 3. Parallelization | Fan-Out (N calls) → Programmatic Aggregator | Wall-clock speed (Sectioning) or high confidence (Voting) | Running safety screening in parallel with answer generation (Sectioning); multi-prompt code security audit (Voting) | "Sectioning = slice the pizza; Voting = poll 5 judges" |
| 4. Orchestrator–Workers | Orchestrator LLM → Dynamic Workers (1..K) → Synthesizer | Runtime task decomposition when sub-tasks depend on input | Multi-file refactoring or multi-source research where target files/sources aren't known upfront | "Tech lead assigning tickets after reading the spec" |
| 5. Evaluator–Optimizer | Generator → Critic/Auditor → (Pass | Feedback Loop [max M]) | Iterative quality & compliance against a strict rubric | Legal clause extraction + adversarial citation auditor; literary translation refinement | "Writer + strict editor" |
gate_check): Plain application code between steps that checks schema validity, required fields, length bounds, or citation existence before spending tokens on Step 2.ambiguous / fallback route that asks a clarifying question, log classifier confidence, and allow specialist handlers to reject misrouted inputs back to triage.asyncio.gather / ParallelAgent (e.g., extracting financial metrics, legal risks, and timeline milestones in parallel, or running input/output guardrail screening concurrently with the main response). Each branch must write to a distinct output_key to avoid state overwrites.T > 0 (Self-Consistency CoT for math/logic) or running diverse critique prompts—and aggregates programmatically. Tune vote thresholds to risk: use 1-of-N (any flag) for high-recall vulnerability detection, or majority vote for high-precision labeling.Pairs a Generator LLM with an independent Evaluator / Critic LLM that grades the draft against an explicit rubric and returns actionable feedback in a loop.
include_contents='none') with an adversarial rubric and pair it with deterministic code verification (e.g., verifying cited sections exist in source text).max_iterations (typically 2–3) and an explicit approval signal. If max_iterations trips without approval, fail closed to HITL escalation rather than shipping an unapproved draft.| Loop Phase | Agent / Mechanism | Inputs & Context | Exit / Escalation Criteria |
|---|---|---|---|
| Generation | Generator LLM | Task brief + prior critic feedback (if any) | Emits structured draft with cited section headers |
| Pre-Critic Gate | Deterministic Code | Source text + draft citations | Deterministically checks that cited headers exist in source text; fails fast if missing |
| Evaluation | Cold-Context Critic LLM | Source text + draft + rubric (include_contents='none') | Emits approved: bool and actionable critique; loop terminates if approved == True |
| Termination / Fallback | Deterministic Guard | Iteration counter (attempt <= max_iterations) | If attempt > max_iterations without approval, fails closed to HITL escalation |
| Architectural Pattern | General / Anthropic Framing | Google Cloud / ADK Primitive | Graph / State Machine Framing |
|---|---|---|---|
| Single Building Block | Augmented LLM (Retrieval + Tools + Memory) | LlmAgent with tools + MemoryService | Single node with tool bindings |
| Pattern 1: Sequential | Prompt Chaining + Programmatic Gate | SequentialAgent / Workflow + before_agent_callback | Linear edges + conditional gate node |
| Pattern 2: Dispatch | Routing (Intent / Tier Classifier) | Coordinator (sub_agents) or custom router node | Conditional edge router from START |
| Pattern 3a: Split Work | Parallelization — Sectioning | ParallelAgent (distinct output_keys) + synthesizer | Fan-out branches → JoinNode |
| Pattern 3b: Consensus | Parallelization — Voting / Self-Consistency | ParallelAgent (N× runs) + vote aggregator | Parallel ensemble → majority/threshold reducer |
| Pattern 4: Dynamic | Orchestrator–Workers | LlmAgent invoking specialist AgentTools | Dynamic map-reduce / send API |
| Pattern 5: Refinement | Evaluator–Optimizer | LoopAgent(max_iterations=N) + generator & critic | Cyclic edge bounded by iteration counter |
| Open-Ended Autonomy | Autonomous Agent (Tools in a Loop) | LlmAgent native ReAct loop (Runner) | Cyclic agent ⇄ tools graph |
| Human Checkpoint | Planned Checkpoint / HITL Approval | FunctionTool(..., require_confirmation=True) | interrupt() / RequestInput with checkpointer |
When the number and sequence of steps cannot be predicted in advance—because step N+1 depends on what observation N uncovered—an Autonomous Agent drives its own execution loop using environmental ground truth.
| Reasoning Paradigm | Execution Mechanics | Strengths | Failure Mode & When to Avoid |
|---|---|---|---|
| ReAct (Reason + Act) | Interleaves Thought → Action (tool call) → Observation (ground-truth tool result) turn-by-turn. | Maximum adaptability; each action is chosen from the immediate observation of the prior step. | High sequential latency (O(N) LLM turns); context grows every turn; can drift into local rabbit holes without an externalized checklist. |
| Plan-and-Execute (ReWOO / LLMCompiler) | Planner emits an upfront multi-step plan or dependency DAG of symbolic variables (#E1, $1); Executor/Dispatcher runs ready steps concurrently; Solver/Replanner synthesizes or replans on failure. | Cuts sequential latency and token re-ingestion dramatically by executing independent tool calls in parallel without intermediate LLM turns. | Brittle if early observations invalidate the upfront plan; requires a dynamic replanning trigger when unexpected environment state appears. |
| Reflection / Self-Correction | Agent inspects deterministic feedback (compiler error, failing pytest trace, schema violation) and revises its action or draft before finishing. | Automatically resolves syntax, schema, and localized logic bugs when grounded in objective test/validator output. | Ungrounded reflection drift: Asking a model to "reflect and improve" without external ground truth (tests, linters, search) often degrades accuracy or amplifies hallucinations. |
finish_task / end_turn).max_turns / max_llm_calls): Always bound total turns per invocation so a stuck agent halts deterministically (error_max_turns).max_budget_usd): Track cumulative token cost per session and abort or escalate before runaway spend occurs.(tool_name, canonical_json_args) across turns. If an agent repeats the exact same failing or no-op call 2–3 times, block execution in the harness and inject a loop-breaker error telling the model to change strategy or escalate.is_error: true): Never swallow exceptions as "" (which looks like "0 records found"). Return structured error details (error type, retryability, corrective hint) inside the tool result so the model can adapt.Invest as much engineering rigor in your Agent-Computer Interface (ACI) as in human UX:
/workspace/src/main.py) instead of relative paths that break after directory changes, and use strict Literal / enum types instead of free-text strings.<= 16 tools): Tool selection accuracy drops sharply when an agent must choose among dozens of overlapping tools; split by domain across subagents or use on-demand tool search.| Loop Guardrail Dimension | Detection Mechanism | Runtime Action on Trigger |
|---|---|---|
| Turn Budget | Counter tracking total completed model roundtrips | Halts execution when turn > max_turns; returns error_max_turns |
| Financial Cost Ceiling | Cumulative token spend tracker (spent_usd >= max_usd) | Immediately terminates session; emits budget_ceiling_exceeded |
| Duplicate Call Trap | Hash map tracking (tool_name, hash(canonical_args)) across recent turns | Intercepts 3rd duplicate invocation; returns is_error: true loop-breaker feedback |
| Structured Tool Errors | Exception handler wrapping tool execution harness | Emits {"type": "tool_result", "is_error": true, "content": "..."} with corrective advice |
| Completion Signal | Inspects stop_reason == "end_turn" and output schema | Returns completed payload with final answer and turn count |
A large context window is not a substitute for memory architecture. Stuffing raw transcripts, 50 KB tool responses, and 80 tool schemas into every turn inflates cost and latency while causing Context Rot.
| Memory Tier | Cognitive Role | Storage & Lifetime | Production Engineering Rules |
|---|---|---|---|
| 1. Working Memory | Active scratchpad for the current task (system prompt, recent turns, live tool observations, temp: state) | In-window messages[] + ephemeral invocation state (temp:*); cleared after turn/session | Keep lean; place byte-identical static instructions and tool schemas first for prompt-cache hits; externalize live checklists (TodoWrite / state keys) so goals survive long runs. |
| 2. Episodic Memory | Record of specific past sessions, interaction trajectories, and checkpoints (session.events) | Persistent session store (DatabaseSessionService, JSONL transcripts, checkpointer) or session summaries | Powers session resume (--resume), audit trails, trajectory evaluation, and few-shot recall of how similar past tasks succeeded. |
| 3. Semantic Memory | Verified domain knowledge, entity facts, and consolidated user preferences (user:*) | Vector/hybrid RAG index or managed Memory Bank (VertexAiMemoryBankService) across sessions | Consolidate, don't just append: Use background LLM extraction to update superseded user facts rather than retrieving contradictory raw chat logs. Keep policy stores read-only during inference. |
| 4. Procedural Memory | How the agent operates: system prompt heuristics, tool definitions, and reusable playbooks (Skills) | Code repository (CLAUDE.md, .claude/rules/, SKILL.md bundles, MCP prompt templates) | Use 3-level progressive disclosure: load only compact YAML name + description (~60–100 tokens) at startup, load the full SKILL.md body only when triggered, and run bundled scripts/ outside context. |
messages[] and gets repeatedly referenced on later turns. Critical trap: Running summarization/compaction on a poisoned session preserves the poisoned assumption inside the summary block! Fix by rewinding prior to the bad turn or clearing/resetting into a fresh context window with only verified facts.ArtifactService outside messages[].Grep → paginated Read), path-scoped rules, and on-demand skills only when needed.messages[] arrays.Multi-agent orchestration is justified if and only if subagents have distinct tools or permissions, private data scopes, isolated context windows to contain noisy exploration, parallel I/O, or an independent verification role. Chaining three "persona" prompts that share the exact same tools and context is Agent Theater—multiplying token cost (~4×) and latency (1.5–2.5×) for zero architectural gain.
| Topology | Control & Routing Mechanics | Strengths | Key Risks & Required Safeguards |
|---|---|---|---|
| 1. Hub-and-Spoke (Coordinator / Subagents) | Central coordinator decomposes the request, invokes specialist subagents as tools (AgentTool / Task), collects compact results, and synthesizes the final response. | Central visibility, strict context isolation per spoke, easy to enforce hub-level guardrails and wave limits (3–5 concurrent workers). | Coordinator context overflows if spokes return raw 50 KB dumps instead of structured summaries. Block subagents from spawning recursive subagents unless explicitly needed. |
| 2. Sequential Pipeline | Fixed relay (Agent 1 → Gate → Agent 2 → Agent 3) passing state via explicit keys (output_key + output_schema). | Zero routing overhead; deterministic transitions; ideal for Staged Extract → Redact → Analyze → Format pipelines. | Rigid; if Step 1 misclassifies an input and no deterministic gate catches it, Steps 2 and 3 compound the error. |
| 3. Mesh / Debate / Swarm | Peer specialists transfer control directly to one another (transfer_to_agent) or critique each other's proposals without a central hub. | Useful for adversarial red-teaming, multi-perspective design critique, or seamless specialist conversation handoffs. | Highest risk of infinite ping-pong loops, state corruption, and diffusion of responsibility. Requires strict max_turns, explicit exit tools, and a deterministic tie-breaker/judge. |
| 4. Hierarchical Teams | Multi-tier tree where a root orchestrator delegates to domain leads, which in turn manage narrow execution workers. | Scales to large enterprise systems with dozens of tools by keeping each node's tool catalog <= 16. | High cumulative latency and token spend; trace debugging requires correlation IDs across every parent-child boundary. |
output_key or isolated file/worktree path so concurrent writes never race or overwrite one another.ArtifactService (artifact_uri) and return only a compact HandoffContract summary to the coordinator.Agent → Tool/Data via MCP): Equips an agent with deterministic tools, database queries, and resources. Enforce least privilege with tool_filter allowlists and scrub PII/injections in after_tool_callback.Coordinator → Subagent): Cognitive delegation inside the same runtime via AgentTool / Task with fresh context and typed output schemas.Agent → Remote Agent via A2A): Delegates stateful tasks across organizational boundaries via an AgentCard (/.well-known/agent-card.json). Remote A2A agents are opaque black boxes (they never expose internal tools, prompts, or memory)—authenticate via card securitySchemes and validate all returned artifacts as untrusted input.class HandoffContract(BaseModel):
task_id: str
status: Literal["completed", "partial", "blocked", "escalation_required"]
confidence_band: Literal["high", "medium", "low"]
summary: str = Field(max_length=1200, description="Compact synthesis")
artifact_uri: str | None = Field(default=None, description="Artifact path")
verified_citations: list[dict] = Field(default_factory=list)
While a single multimodal LLM call with a JSON schema can summarize a clean 1-page demo PDF in 2 seconds, unguarded single-prompt pipelines break on real enterprise workloads for five structural reasons:
(Source: Section X) syntax appears, missing fabricated section numbers. Fix: Grounded citation verification deterministically checks that every cited heading/quote exists in the extracted source text.after_tool_callback boundaries.| Production Symptom | Root Architectural Cause | Deterministic Architectural Fix |
|---|---|---|
| Agent miscalculates fees, discounts, or date windows on edge cases | Deterministic drift: Delegating Bucket 1 arithmetic or policy thresholds to probabilistic prose instructions. | Move calculations and threshold checks into deterministic Python/SQL tools or PreToolUse / before_tool_callback hooks. |
| Simple 3-step pipeline takes 45 seconds and costs $0.80 per run | Over-agentification: Using an open-ended autonomous ReAct agent (or Agent Theater) where the task path is known in advance. | Replace the autonomous loop with a Prompt Chain or Parallel Sectioning Workflow using fast-tier models for routine steps. |
Coordinator hits model_context_window_exceeded after calling 4 research workers | Missing context isolation: Workers return raw 40 KB tool dumps into the parent window, or inherit full parent history. | Enforce the Context Isolation Rule: spawn workers in fresh windows, write bulky artifacts to disk/storage, and return a bounded HandoffContract summary. |
| Parallel workers intermittently lose data or overwrite each other's findings | Shared mutable state race: Concurrent branches write to the same session state key (state["result"]) or edit the same file simultaneously. | Give each parallel branch a unique output_key (result_a, result_b) merged by a downstream JoinNode/synthesizer, or isolate file edits in separate worktrees. |
| Generator–Critic loop burns 15 turns and still ships a hallucinated citation | Unbounded loop + ungrounded reflection: No max_iterations cap, and the critic grades prose by "vibes" without checking source text in code. | Cap the loop at max_iterations=3, verify citations deterministically against source text (regex/substring match), and escalate to HITL if the cap trips without approval. |
| Agent tells the user "You have no active orders" during a database timeout | Swallowed tool error: Tool wrapper caught the timeout exception and returned "" or {} with HTTP 200 success semantics. | Return a structured error block (is_error: true or {"status": "error", "retryable": true, "message": "DB timeout"}) so the model knows the lookup failed. |
| After compacting a confused session, the agent keeps repeating the same wrong file path | Compacting poisoned context: Summarization compressed the earlier hallucinated file path into the compacted summary block. | Use rewind / hard context reset (/clear) to discard poisoned turns entirely instead of summarizing them. |
| Agent selects the wrong tool when given 45 enterprise MCP endpoints | Tool catalog saturation: Model attention degrades when forced to discriminate among > 16 overlapping tool schemas in one prompt. | Group tools by domain across specialist subagents (<= 16 tools each) or enable on-demand progressive tool disclosure / Tool Search plus tool_filter allowlists. |
Summarizer agent reading an external email is tricked into calling send_email | Indirect prompt injection + excessive agency: Untrusted data entered the same context that held high-privilege mutation tools. | Enforce least privilege (strip send_email from the reader agent), screen tool outputs in after_tool_callback, and gate external sends with a HITL checkpoint. |
escalation_required = True as the safe default?max_turns / max_iterations, token budget ceilings, duplicate tool-call detection, and explicit escalation when the cap trips?<= 16 per agent, arguments constrained via strict schemas/enums/absolute paths, and failures returned as structured is_error: true signals?HandoffContract objects (with URIs for large artifacts)?gate_check) that fail fast on invalid intermediate outputs.max_iterations.HandoffContract (with artifact_uri pointers for large outputs).LlmAgent, graph Workflow, callbacks, and Memory Bank.stop_reason, adaptive thinking, prompt caching, and batches.Listen to the 55-minute Agentic Design Patterns audio deep dive, open the 2-column study guide PDF, 21-slide deck, and sketchnote infographic in the Hub Viewer, or drill scenario-based questions on workflow vs. agent selection, canonical workflows, and multi-agent isolation.
Q1. What is the Sequential Decision Framework, and why must it run before prompt engineering?
Q2. How do Parallelization (Sectioning), Parallelization (Voting), and Orchestrator–Workers differ?
Q3. Why does asking a single prompt to both generate a 30-page contract summary and verify every citation fail at scale, and what pattern fixes it?
include_contents='none') backed by a deterministic code gate that verifies every cited section header exists in the source text, bounded by max_iterations and HITL escalation on failure.
Q4. When should you choose Plan-and-Execute (or ReWOO / LLMCompiler) over a standard ReAct loop?
Q5. A coding session hallucinates a non-existent helper module in turn 3 and spends the next 6 turns failing to import it. Why is context compaction (/compact) the wrong fix, and what should you do instead?
Q6. What is the Context Isolation Rule in multi-agent systems, and how should a worker return a 40 KB generated report to its coordinator?
ArtifactService and return a compact, schema-validated HandoffContract containing a short summary, status, verified citations, and the artifact_uri pointer.
Q7. During an evaluator–optimizer loop with max_iterations=3, the critic rejects the draft on all 3 attempts. What must happen next?
max_iterations trips. The exit tool must explicitly set an approval flag (approved = True) when the critic passes; a downstream deterministic gate checks that flag and, if False after iteration 3, halts automatic delivery and routes the draft + critic diagnostics to Human-in-the-Loop (HITL) escalation or a safe fallback.
Q8. What is the "Agent Theater" litmus test?