claudio.cool
CCDV-PLessons

CCDV-P · Advanced Agent Architecture and Orchestration

Evolving between workflow and agent with data, and setting harness and framework standards

⏱ 3 min readDraft

A team launched a claims-handling assistant as an autonomous agent. Three months later the data says: 85% of cases follow the same five steps, those cases cost three times the average because the agent “explored” too much, and the remaining 15% is where the agent truly adds value. Keep it as is, rebuild it as a workflow, or split it?

You decide with data, not preferences

In Foundations you learned the design criterion: known steps go in code, unpredictable paths go to the model. At Professional level the question is different: with a system already running, what do the numbers say? For architecture selection you look at:

Production signal What it suggests
Almost every run follows the same tool sequence that part becomes a workflow: cheaper, faster, easier to test
Highly variable cost and latency, with long runs explaining the tail bound the agent (step limit, smaller tool set) or remove what’s predictable
A workflow with many edge cases and branches that keep growing candidate to move the hard part to an agentic pattern
Failures concentrated in a single step fix that step, don’t redesign everything

The usual path is hybrid: a workflow that routes and, only for the unpredictable stretch, a bounded agent. Moving one stretch at a time lets you compare against the current version with the same evaluation suite before shifting real traffic.

An architecture change is a version of the system: you evaluate it, roll it out progressively and keep it reversible.

What to standardize

When several teams build agents, agree on a few things and fix them:

  • The agent harness: the loop, context management, permissions, hooks and logging. Using the Agent SDK or Claude Code as a base gives you all that solved; a custom loop gives full control but you maintain it.
  • The framework, if needed: justified by what it solves (durable state, control graphs, integrations), not fashion. Every added layer is one more layer to debug and upgrade.
  • Reusable patterns: templates for supervisor, approval and retry, shipped with their evaluation and telemetry so each team doesn’t reinvent them.

Criteria for choosing: which measured problem it solves, who maintains it, how it’s observed, how it’s tested and what happens when it’s upgraded. A standard with no owner and no evaluation turns into debt.

The usual traps

  • Redesigning everything as an agent (or everything as a workflow) from an impression rather than a cohort of data.
  • Measuring only quality and ignoring cost and latency, or the reverse.
  • Adopting a framework because another team uses it, with no concrete problem.
  • Changing architecture without an evaluation suite that compares against the current one.
  • Standards each team interprets differently because there’s no reference implementation.

On the exam

When the scenario brings execution data, the answer is usually to move the deterministic part to a workflow gradually and keep the agent for the unpredictable part, validating with evaluation. Discard “rewrite everything” and “add a framework” when no identified problem calls for it.

Quick question

A practice exam question on this domain. It counts towards your progress.

An internal platform agent is connected to several MCP servers that together expose 180 tools: ticketing, deployments, dashboards, billing, and others. Each request starts with all the tool definitions in context, which consumes a large share of the window, and the agent often picks a similar but wrong tool, such as the staging deploy instead of the production deploy.

Most conversations use fewer than ten tools, and the team does not want to maintain a separate agent for each area or retrain users on new entry points.

Which approach best addresses both the context cost and the selection errors?

Practise this domain in a practice exam →