Agentic Engineering Cheat Sheet
One line per need. Click a row to open the lesson.
Architecture
One LLM call answers the question->No agent — a single call with a good promptSteps are known and deterministic->Workflow (explicit code / state graph), not an agentSteps only known at runtime->Agent loop with termination criteriaPersistent, resumable multi-step workflow->State machine / graph with checkpointsRoute requests to different handlers->Router architecture (classify, then dispatch)Clear specialization across sub-tasks->Consider multi-agent — after a single agent with better tools failsCentral coordinator delegating sub-tasks->Supervisor patternFixed sequence of transformation stages->Pipeline patternModel output consumed by code->Structured outputs with a JSON schema + validationDecide whether planning is worth it->Plan-then-execute only for long, dependent step chainsFramework or not?->Start without one; adopt when you need checkpointing / streaming / graphs
Knowledge
Answers from private / proprietary knowledge->RAGSemantic retrieval ("means the same thing")->Vector search (dense embeddings, cosine / top-k)Exact retrieval (IDs, codes, names, rare terms)->Keyword / BM25Both semantic and exact retrieval->Hybrid search (dense + sparse, RRF fusion)Structured / tabular data questions->SQL tool, not embeddingsPrecision problems in top-k results->Reranking (cross-encoder over top-50)Restrict retrieval to tenant / date / doc type->Metadata filtering before vector searchRetrieved chunks are cut mid-sentence->Fix chunking (structure-aware, overlap)Verifiable citations->Span-level grounding with source IDsBad answers with a good model->Inspect context and retrieval before tuning the promptMeasure retrieval quality->Recall@k / MRR on a labeled query set
Tools
Take an action in an external system->Tool callingWrong tool chosen->Better tool descriptions + evals on tool selectionModel sends malformed arguments->Schema validation at the boundary, return error to the modelReusable integrations across agents and clients->MCP serverSingle app, few tools, one vendor->Direct function calling, skip MCPIndependent tool calls in one turn->Parallel tool executionDuplicated side effects on retry->Idempotency keysTool call hangs or flakes->Timeouts + bounded retries with backoff
State
Session continuity across turns->State / short-term memory (conversation + working state)Remember users across sessions->Long-term memory with explicit write policyLong conversations blow the window->Summarization / compaction of older turnsLost in the middle->Ordering: critical facts at the start or end of contextStale or contradictory memories->Timestamps, overwrite semantics, expiryAssemble context per request->Dynamic context assembly under a token budget
Safety
High-risk or irreversible action->Human approval gateAgent reads untrusted content (web, email, docs)->Treat as data + restrict tools for that turnSecrets (API keys, tokens)->Never in context — inject at the tool boundaryLimit blast radius of a compromised agent->Least-privilege, per-task scoped tool permissionsBlock harmful inputs / outputs->Input and output guardrails (classifiers, allowlists)Act on behalf of a specific user->Propagate user identity: authn + authz per toolModel is uncertain->Confidence threshold → escalate to human
Quality
Agent behaving incorrectly->Traces + evals (find the failing step, then regress-test it)Know if version B is better than A->Golden dataset + regression evalGrade open-ended answers->LLM-as-judge with rubric, calibrated against humansCheck format, schema, or exact values->Deterministic evaluatorsQuality drifts after launch->Online evaluation on sampled production traffic
Operations
Agent looping->Termination criteria: max steps, budget, no-progress detectionProvider down->Fallback chain to a second model / providerKnow what happened in a run->Trace every LLM call, tool call, and state change as spansCatch regressions in production->Metrics + alerts on error rate, p95 latency, cost per runEnumerate what can go wrong->Failure-scenario review with one mitigation per scenario