[{"id":"ccarp-prompt-chaining-fixed-steps","courseId":"ccar-p","domain":"solution-design-architecture","topic":"Prompt chaining for fixed steps","prompt":"An insurer handles every claim letter in the same three steps: extract fields, check them against policy rules, draft a decision letter. A vendor pitches an autonomous agent that plans its own steps. The ops lead needs predictable cost and an audit trail. What should the architect recommend?","hint":"Are the steps known before the letter arrives?","explain":"In a workflow the developer writes the sequence of model calls ahead of time. In an agent the model picks each next action from what it has seen. Consider when the subtasks become known.","source":"https://www.anthropic.com/engineering/building-effective-agents","interaction":{"type":"single"},"options":[{"id":"a","text":"An autonomous agent given all three steps as tools, free to choose the order and number of steps per letter","whyNot":"Agents suit open-ended tasks with unpredictable steps; here the steps are fixed, so autonomy only adds cost and error risk."},{"id":"b","text":"An orchestrator model that reads each letter and spawns worker calls for whichever subtasks it decides are needed","whyNot":"Orchestrator-workers fits tasks whose subtasks can't be predicted, and these are known in advance."},{"id":"c","text":"A prompt-chaining workflow: one call per fixed step, with code checks between steps","why":"Building effective agents recommends prompt chaining when a task cleanly decomposes into fixed subtasks. Each call does an easier job, and code can gate between steps. Agents trade latency and cost for flexibility this task doesn't need."},{"id":"d","text":"One prompt that extracts, checks and drafts in a single call","whyNot":"Folding the steps into one call removes the checkpoints that make each step easier and auditable."}],"answer":"c","explanation":"Prompt chaining splits a task into a fixed series of LLM calls, each feeding the next. Code between calls can validate results, which makes the flow predictable and auditable.","concept":"Prompt chaining splits a task into a fixed series of LLM calls, each feeding the next. Code between calls can validate results, which makes the flow predictable and auditable.","rev":1,"kind":"scenario","takeaways":["Fixed, known steps → prompt chaining with gates; keep agents for tasks with unpredictable steps."]},{"id":"ccarp-start-simple","courseId":"ccar-p","domain":"solution-design-architecture","topic":"Start with the simplest solution","prompt":"A retailer wants Claude to answer staff questions about a 300-page returns manual. The team's first design has a planner agent, three specialist subagents and a critic. No prototype exists and the deadline is six weeks. Which is the best first step?","hint":"What does Anthropic say is often enough for many applications?","explain":"A fixed test set scored the same way each run lets two designs be compared. Without a measured baseline, extra pieces rest on argument alone. Consider what a first build would need to show.","source":"https://www.anthropic.com/engineering/building-effective-agents","interaction":{"type":"single"},"options":[{"id":"a","text":"Prototype one LLM call with retrieval and examples, and add agents only if evals show a gap","why":"Anthropic's guidance is to find the simplest solution and increase complexity only when needed. For many applications, optimizing single LLM calls with retrieval and in-context examples is enough. Evals then show whether more is justified."},{"id":"b","text":"Build the planner and subagents now; retrofitting multi-agent later costs more","whyNot":"Anthropic advises adding complexity only when needed, and nobody has shown a single call falls short."},{"id":"c","text":"Fine-tune a model on the manual before writing prompts","whyNot":"Nothing shows prompting plus retrieval is insufficient yet, so fine-tuning is premature."},{"id":"d","text":"Ship a single call plus a critic agent that reviews every answer, so quality is double-checked from day one","whyNot":"A critic added before measuring quality is still complexity without evidence it's needed."}],"answer":"a","explanation":"Every added agent or call brings latency, cost and new failure points. Begin with the simplest design that could work and add parts only when measurements show a need.","concept":"Every added agent or call brings latency, cost and new failure points. Begin with the simplest design that could work and add parts only when measurements show a need.","rev":1,"kind":"scenario","takeaways":["Start with one well-built call plus retrieval; let evals justify agents."]},{"id":"ccarp-routing-by-difficulty","courseId":"ccar-p","domain":"solution-design-architecture","topic":"Routing by request difficulty","prompt":"A telecom's support assistant handles 40,000 messages a day. About 70% are simple billing FAQs; the rest are technical faults that need deeper reasoning. Finance wants lower spend without hurting fault resolution. Which design best balances both?","hint":"The traffic splits into two clear categories.","explain":"Models differ in price and capability, so a request's cost depends on which one answers it. Consider how the traffic's makeup changes what a blanket choice of model would waste.","source":"https://www.anthropic.com/engineering/building-effective-agents","interaction":{"type":"single"},"options":[{"id":"a","text":"Send every message to the most capable model so fault-resolution quality never drops below today's level","whyNot":"That pays top prices for the 70% of easy FAQs, which is the spend finance wants cut."},{"id":"b","text":"Send all messages to the fastest model; retry on a bigger one after complaints","whyNot":"Using complaints as the trigger makes users absorb the failures before quality is restored."},{"id":"c","text":"Split traffic randomly across two models for a month, then keep whichever has the lower bill","whyNot":"Random splitting ignores the clear category difference that makes routing effective."},{"id":"d","text":"Classify each message, then send FAQs to a low-cost model and faults to a capable one","why":"Routing classifies an input and directs it to a specialized follow-up. Building effective agents says it works when distinct categories are better handled separately, such as easy questions to a small model like Haiku and hard ones to a more capable model."}],"answer":"d","explanation":"Routing means a first step labels each input and sends it to the handler best suited to it. It lets each path use its own prompt or model tier.","concept":"Routing means a first step labels each input and sends it to the handler best suited to it. It lets each path use its own prompt or model tier.","rev":1,"kind":"scenario","takeaways":["Distinct categories with different difficulty → route: cheap model for easy, capable model for hard."]},{"id":"ccarp-parallel-guardrail","courseId":"ccar-p","domain":"solution-design-architecture","topic":"Parallel guardrail screening","prompt":"A bank's chat assistant must screen every user message for policy violations, but the product owner says a sequential screening call before each answer breaks the latency target. Which design best fits?","hint":"Must the screen finish before the answer starts?","explain":"Each model call takes time set by how much it generates. Whether those times stack up depends on what each call must wait for. Consider what each check truly needs as input before it can start.","source":"https://www.anthropic.com/engineering/building-effective-agents","interaction":{"type":"single"},"options":[{"id":"a","text":"Remove the separate screen and add a 'refuse policy violations' instruction to the answer call's system prompt","whyNot":"A prompt line is one layer; a separate screen is the stronger, recommended guardrail."},{"id":"b","text":"Run the screen in parallel with the answer call; withhold the answer if the screen flags it","why":"Parallelization by sectioning runs independent subtasks at once. Building effective agents gives guardrails as an example: one instance answers while another screens, which tends to perform better than one call handling both. Running them concurrently keeps the screen off the critical path."},{"id":"c","text":"Screen messages in a nightly batch and suspend violators the next day","whyNot":"Next-day screening lets violating answers reach users in real time."},{"id":"d","text":"Have the answer call screen the message itself, then reply in the same request","whyNot":"Anthropic notes a separate screening instance tends to beat one call doing both jobs."}],"answer":"b","explanation":"Subtasks that don't depend on each other can run at the same time. Total latency then equals the slowest call, not the sum of all calls.","concept":"Subtasks that don't depend on each other can run at the same time. Total latency then equals the slowest call, not the sum of all calls.","rev":1,"kind":"scenario","takeaways":["Independent checks can run beside the main call: safety without an extra sequential hop."]},{"id":"ccarp-orchestrator-workers","courseId":"ccar-p","domain":"solution-design-architecture","topic":"Orchestrator-workers for unknown subtasks","prompt":"A platform team wants Claude to apply a library upgrade across a monorepo. Which files and packages need changes isn't known until the code is inspected, and it differs per repo. Which pattern should the architect choose?","hint":"When do you learn which files need changing?","explain":"A worker sees only the piece it is handed, so the quality of the split shapes everything downstream. Consider whether the parts could be listed before reading the material.","source":"https://www.anthropic.com/engineering/building-effective-agents","interaction":{"type":"single"},"options":[{"id":"a","text":"Orchestrator-workers: a lead model splits the change into subtasks at runtime and delegates them","why":"Orchestrator-workers suits complex tasks where you can't predict the subtasks needed. Building effective agents cites coding changes across many files as the example. The orchestrator derives subtasks from the input instead of a predefined list."},{"id":"b","text":"Prompt chaining with a fixed sequence of upgrade steps that the team writes once and reuses for every repo","whyNot":"Chaining needs subtasks known up front; here they emerge only after the code is inspected."},{"id":"c","text":"Routing: classify each file by type and send it to a prompt specialized in upgrading that kind of file","whyNot":"Routing picks a handler per input; it doesn't plan how a cross-cutting change is split."},{"id":"d","text":"Voting: run the same whole-repository edit several times in parallel and keep the version most runs agree on","whyNot":"Voting raises confidence in one answer; it doesn't decompose an unpredictable multi-file change."}],"answer":"a","explanation":"In orchestrator-workers, a central model breaks a task into parts on the fly and hands each to a worker call, then combines the results. It fits tasks whose shape isn't known in advance.","concept":"In orchestrator-workers, a central model breaks a task into parts on the fly and hands each to a worker call, then combines the results. It fits tasks whose shape isn't known in advance.","rev":1,"kind":"scenario","takeaways":["Subtasks unknown until runtime → orchestrator-workers; known in advance → chaining."]}]