All notes

#199 Building blocks, workflows, and agents

July 27, 2026·5 min read

#199 — Building blocks, workflows, and agents

AI agent projects fail most often not from bad prompts but from unnecessary complexity, and the fix is picking the right pattern for the job before you write any code.

Two categories, not one

Systems that use LLMs and tools fall into two buckets: workflows, where you hardcode the path the LLM and its tools follow, and agents, where the LLM decides its own path and keeps control over execution. This split determines your cost structure and how much supervision the system needs day to day.

Start with the simple version

Find the simplest solution first and add complexity only when that fails. A single well-optimized LLM call with retrieval and good in-context examples handles most tasks without any agent framework at all.

  • Agentic systems trade latency and cost for task performance, so weigh that tradeoff before building one
  • Workflows give predictability for well-defined, repeatable tasks
  • Agents give flexibility when you need model-driven judgment at scale, at higher cost and risk
  • The base building block is an LLM wired up with retrieval, tools, and memory that can write its own search queries and decide what to keep track of

Frameworks hide the parts you need to see

Agent frameworks get you a working demo fast, but they add abstraction layers that hide the actual prompts and responses, which makes debugging harder. Building with raw LLM API calls first, then reading the code underneath any framework you adopt later, avoids the most common failure mode: misunderstanding what the framework does under the hood. A shared protocol for connecting an LLM to third-party tools also cuts down the work of hand-building every integration yourself.

Five patterns and where they fit

Each pattern solves a different problem, and picking the wrong one is how founder-stage products end up overbuilt.

PatternMechanismBest fitExample
Prompt chainingSequential LLM calls, each processing the last one's output, with optional checks between stepsTasks that break cleanly into fixed subtasksDraft copy, then translate it; outline, check, then write the full doc
RoutingClassifies input, sends it down a specialized pathDistinct input categories handled better separatelySplitting support tickets into refund, technical, and general; sending easy queries to a cheap model and hard ones to a stronger one
Parallelization"Sectioning" runs independent subtasks in parallel; "voting" runs the same task multiple timesSpeed through parallel work, or confidence through multiple attemptsOne model answers a query while another screens it for inappropriate content; several prompts independently flag a code review for vulnerabilities
Orchestrator-workersA lead LLM breaks a task into subtasks on the fly and delegates to worker LLMsTasks where the subtasks can't be predicted in advanceMulti-file code changes where scope isn't known upfront; research pulling from multiple sources
Evaluator-optimizerOne LLM generates, a second LLM critiques in a loopClear evaluation criteria plus measurable gains from iterationLiterary translation refined through critique rounds; multi-round search where an evaluator decides if more searching is needed

Prompt chaining

Prompt chaining diagram

Routing

Routing diagram

Parallelization

Parallelization diagram

Orchestrator-workers

Orchestrator-workers diagram

Evaluator-optimizer

Evaluator-optimizer diagram

When agents make sense

Full agents fit open-ended problems where you can't predict the number of steps and can't hardcode a fixed path, and where you're willing to trust the model's decisions over many turns. Autonomy raises costs and opens the door to compounding errors, which is why heavy sandbox testing and guardrails matter before any production use. Two production examples: a coding agent that resolves GitHub issues by editing multiple files, and a "computer use" agent that operates a computer UI directly.

Two domains have shown clear value for agents, and both combine conversation with action, clear success criteria, and tight feedback loops with human oversight.

  • Customer support: conversational flow, tools pulling customer and order data, programmatic actions like refunds, and resolutions that are easy to measure some companies price these agents per resolution
  • Coding agents: automated tests verify output, the agent iterates using test results as feedback, and the problem space is structured enough to measure quality objectively though human review still catches misalignment with broader requirements

Three rules for building an agent

  1. Keep the design simple and skip any step that doesn't demonstrably improve results
  2. Show the agent's planning steps explicitly instead of hiding its reasoning
  3. Put the same effort into the agent-computer interface (tool documentation and testing) that you'd put into a human-facing UI

Tool design deserves as much work as the prompt

One team building a coding agent for a benchmark task spent more time optimizing tool definitions than the prompt itself, and forcing the model to use absolute file paths instead of relative ones eliminated a whole category of mistakes once the agent had moved away from the root directory.

  • Pick formats the model has seen naturally on the internet a full file rewrite is easier for a model to produce than a diff, which requires pre-counting changed lines, and markdown code is easier than JSON, which needs escaped newlines and quotes
  • Give the model tokens to think before it locks into a bad structure
  • Write tool descriptions the way you'd write a docstring for a junior engineer, with example usage and clear boundaries against other tools
  • Change parameter design so mistakes become structurally hard to make
  • Run real inputs through a workbench, watch where the model stumbles, and iterate from there

For founders, the practical move is matching system complexity to what the task actually needs, then scaling up only after measuring that a simpler option fell short.

Frequently asked questions

What's the difference between an AI agent and a workflow?

A workflow is a system where you hardcode the exact path the LLM and its tools follow through code you decide the steps in advance. An agent is a system where the LLM decides its own path and keeps control over execution as the task unfolds . The practical difference: workflows are predictable and cheaper to run, agents are flexible but cost more and carry more risk of compounding errors .

Do I need LangChain or an agent framework to build an AI agent?

No. Most agentic patterns can be implemented in a few lines of code using raw LLM API calls, and starting there makes debugging far easier than working through a framework's abstraction layers . If you do adopt a framework like the Claude Agent SDK, AWS's Strands, Rivet, or Vellum, read the underlying code first misunderstanding what's happening under the hood is one of the most common mistakes teams make .

When should a startup use an AI agent instead of a simpler LLM workflow?

Use an agent only for open-ended problems where you can't predict the number of steps needed and can't hardcode a fixed path, and where you're willing to trust the model's judgment over many turns . For most well-defined, repeatable tasks support ticket routing, document generation, translation a workflow or even a single optimized LLM call with retrieval outperforms an agent on cost and predictability .

What is Model Context Protocol (MCP) and why does it matter for AI agents?

MCP is Anthropic's open standard for connecting an LLM to a growing ecosystem of third-party tools through a simple client implementation, instead of hand-building every integration yourself . For founders, this means faster tool integration for agents that need to pull data from CRMs, databases, or APIs without custom-coding each connector .

How much does it cost to run AI agents in production compared to simple LLM calls?

Agentic systems trade latency and cost for better task performance, so agents are inherently more expensive to run than a single well-optimized LLM call . Anthropic's own guidance is to default to the simplest solution and only add the cost and complexity of agents when a simpler approach demonstrably fails to meet the task .

What are real examples of companies using AI agents successfully?

Anthropic's own SWE-bench coding agent resolves real GitHub issues by editing multiple files based only on a task description, and its 'computer use' reference implementation lets Claude operate a computer UI directly to complete tasks . In customer support, some companies now charge customers only for successful resolutions under a usage-based pricing model, signaling real confidence in agent reliability .

Why do AI agent projects fail even with good prompts?

Agent failures usually trace back to unnecessary complexity, not weak prompts adding steps, frameworks, or autonomy that don't measurably improve the outcome . Anthropic's teams found that tool design deserves as much attention as prompt design; a small fix like forcing absolute file paths instead of relative ones eliminated an entire category of agent mistakes in their SWE-bench work .

What is an 'agent-computer interface' (ACI) and why does it matter?

ACI refers to how clearly you document and structure the tools an agent uses, and Anthropic recommends investing the same effort here that teams typically put into human-facing UI design . Poorly documented tools, ambiguous parameters, or formats the model hasn't seen naturally online (like raw JSON instead of markdown) create avoidable errors regardless of how good the underlying prompt is .

Which industries get the most value from AI agents right now?

Customer support and coding are the two domains where agents have shown the clearest production value, both sharing conversational interaction, clear success criteria, tight feedback loops, and built-in human oversight . Coding agents benefit from automated tests as objective feedback, while support agents benefit from measurable resolutions and direct access to customer and order data through tools .

How do I test an AI agent before putting it into production?

Anthropic recommends extensive sandbox testing paired with clear guardrails before any agent touches production, given that autonomy raises both cost and the risk of compounding errors . A practical method is running real inputs through a workbench, observing exactly where the model stumbles on tool calls, and iterating on tool definitions from there .

What is the Model Context Protocol (MCP) and do I need it to build AI agents?

MCP is Anthropic's open standard that lets an LLM connect to third-party tools and data sources through a single client implementation instead of custom-coding every integration . You don't strictly need it many agentic patterns work fine with a few lines of direct API code but it saves significant engineering time once you're integrating more than a handful of external tools .

What's the difference between sectioning and voting in parallel AI workflows?

Sectioning splits one task into independent subtasks that run at the same time, like having one model answer a user query while a separate model screens it for inappropriate content . Voting runs the identical task multiple times to get diverse outputs, such as several prompts independently reviewing the same code for security vulnerabilities and flagging issues by consensus .

How is an orchestrator-workers pattern different from simple parallelization?

They look similar on a diagram, but parallelization pre-defines the subtasks upfront while orchestrator-workers has a lead LLM decide the subtasks dynamically based on the specific input . This matters for tasks like multi-file coding changes, where you can't know in advance how many files need editing or what kind of change each one needs .

How do you stop an AI agent from running forever or spiraling into errors?

Anthropic recommends building in explicit stopping conditions, such as a maximum number of iterations, alongside checkpoints where the agent pauses for human feedback when it hits a blocker or completes a meaningful step . Grounding the agent in real environmental feedback at each step like actual tool results or code execution output is what lets it assess its own progress instead of drifting .

Should I use JSON or markdown for LLM tool outputs?

Markdown is generally easier for a model to produce reliably than JSON, because JSON requires escaping newlines and quotes while markdown code blocks don't carry that formatting overhead . The broader rule is to pick whatever format the model has seen most naturally occurring in internet text, since anything unfamiliar increases the chance of formatting errors .

What does 'poka-yoke' mean in the context of AI tool design?

Poka-yoke is a manufacturing term for mistake-proofing, and applied to AI tools it means changing parameter design so that errors become structurally difficult to make . A concrete example from Anthropic's own coding agent: requiring absolute file paths instead of relative ones eliminated a whole class of navigation errors once the agent had moved away from the root directory .

Can AI agents replace traditional automation or RPA tools?

Not for well-defined, repeatable processes those are exactly the cases where a hardcoded workflow beats an agent on cost, predictability, and debuggability . Agents earn their place only on open-ended tasks where the steps can't be predicted in advance and some model judgment is required, which is a narrower slice of automation work than founders often assume .

How many tools should I give an AI agent?

The source doesn't specify a number, but it stresses that each tool needs a clear, unambiguous purpose with boundaries against other tools similar to writing a docstring for a junior developer joining your team . Testing real inputs against your tools in a workbench and watching where the model gets confused is the recommended way to find out if you have too many overlapping tools .

What is SWE-bench and why do AI companies benchmark against it?

SWE-bench Verified is a benchmark where an AI agent resolves real GitHub issues by editing code across multiple files, using only the pull request description as input . Anthropic used it internally to test its own coding agent and found that tool definition quality mattered more to performance than the core prompt .

How do companies price AI agents if usage varies so much?

Some companies charge only for successful outcomes rather than per API call or seat, particularly in customer support where a 'resolution' is easy to define and measure . This outcome-based pricing signals real confidence in the agent's reliability, since the vendor absorbs the cost of failed attempts rather than passing it to the customer .

Do AI agents still need human oversight if they're autonomous?

Yes even in Anthropic's best-performing use cases, human review remains essential for catching issues automated tests can't, like a coding agent's solution technically passing tests while missing broader system requirements . The recommended pattern is human checkpoints built into the agent's loop, not full unsupervised autonomy, especially before production deployment .

more than just words|

We're here to help you grow better at every stage of the climb.

let's go to market

Whether you're finding problem-market fit, refining your positioning, shipping product, or scaling go-to-market we're built for every stage of the journey.