agent-architecture-choiceChoose between a single call, a fixed workflow and an autonomous tool loop for a new LLM feature, and decide whether a multi-agent split is warranted: start with the cheapest shape and move up only on measured failure, use a fixed workflow whenever the steps can be written in advance, allow a loop o
agent-memory-designDesign persistent cross-session memory for an assistant or agent as a database with a gated write path and read path: decide what is memorable (preferences, confirmed facts, decisions; never transcripts or untrusted tool content), store typed entries with source turn, timestamp, confidence, scope an
context-compactionDesign how a long-running assistant or agent compresses its own history without losing facts it will need: decide what is pinned verbatim (task, user constraints and corrections, decisions with reasons, open questions, identifiers, paths, the last tool results), compact in tiers (clear old bulky too
document-extractionExtract structured data from receipts, invoices, forms, tables, charts, screenshots and scans with a vision model or OCR, and prove the values are right, not just fluent. Use when pulling fields out of a document image, choosing between text extraction, OCR and a vision model, or checking a number.
llm-batch-processingRun a bulk LLM job (classify, enrich, summarise, extract over millions of items) so it finishes, costs what was projected and can be resumed: pilot a stratified 200-item sample and project cost and time from measured tokens per item including retries, key items by stable id and content hash with per
llm-classifier-designBuild and verify an LLM classifier, tagger or router to a measured precision and recall: write the taxonomy first with definition, positive and negative example and tie-break rule per class plus an explicit other class, measure human agreement with Cohen's kappa on a double-labelled 100, hold out 30
llm-latency-budgetDecompose and cut the wait on an LLM-backed request: measure per stage (queueing, prompt processing, time to first token, inter-token rate, output length, tool and retrieval time) at p50 and p95 split cached versus uncached, set a budget per stage against the user-visible target of first visible pro
llm-provider-resilienceKeep an LLM feature up when the provider rate-limits, overloads, times out or has an outage: classify errors as retryable (429 rate limit, overloaded, 5xx, timeout, truncated stream) or deterministic (schema, refusal, context length, spend-cap 429) and retry only the first, honour Retry-After with f
mcp-server-designBuild, test and secure a Model Context Protocol server: a few task-shaped tools named and described for the model, strict input schemas, failures returned as isError results, stdio for local servers with logs on stderr, Streamable HTTP with Origin checks and OAuth audience validation (no token passt
model-migrationMove an LLM-powered feature to a different model or version, because of a deprecation, a price or a quality gap, without a silent regression: read the provider's deprecation and migration notes and list the behaviour changes that apply to your requests (rejected parameters, tool-use, thinking and ca
output-filter-calibrationDesign and tune input and output checks on an end-user-facing LLM feature (policy, topic, PII, brand, unsafe content) against measured false-block and miss rates: define each class with examples and severity, build a labelled violating set and real benign traffic, measure miss rate and benign false-
rag-designDesign a retrieval-augmented generation pipeline you can show retrieves the right passages: build a small labelled eval of questions mapped to answering passages before tuning anything, score retrieval (recall@k, MRR) apart from answer faithfulness, chunk by document structure keeping source ids and
source-grounded-promptsWrite, check and revise the prompt that makes a source-grounded notebook assistant (one that answers only from documents you upload) produce a slide deck, briefing memo, study guide, audio-overview script or mind map: a structured style spec for the look, a grounding block so every number and quote
structured-outputGet machine-readable output from a language model that a program can trust: JSON, tool-call arguments, enums and extraction records. Write the schema first as the contract, small and flat; use the provider's native structured-output, strict tool-use or strict JSON-schema mode rather than prompt-only
tool-result-shapingReshape what tools return to a model so results are small, decisive and recoverable: measure token size per result from real traces and cap each tool, return only the fields the next decision needs with readable ids, a count and total so the model knows what it did not see, and a continuation handle