Skip to content

10 · When the Second Agent Is Unnecessary: Choosing the Simplest Architecture That Works

We’ve reached the final lesson.

Over the previous nine lessons, we’ve progressively built a system that can reason, call tools, maintain state, recover from failures, request human approval, and coordinate multiple agents.

Today we’re going to do something different.

We’re going to remove complexity.

Because understanding how to build an agent is only half the engineering skill.

The other half is recognizing when you don’t need one.

The goal is not to build the most autonomous system. It’s to build the simplest system that reliably solves the problem.

We’ll compare four architectures for the same task:

A. Ordinary Python
B. Python + one LLM call
C. One agent with tools
D. Two cooperating agents

By the end, you’ll have a practical way to choose between them.


1. Start with a realistic business problem

Section titled “1. Start with a realistic business problem”

Imagine we’re building a customer-support system.

A customer asks:

I was charged a $15 late fee on invoice 4812. Why was I charged, and can the fee be waived?

Our application has two pieces of information.

The invoice:

invoice = {
"id": 4812,
"days_past_due": 14,
"late_fee": 15,
}

And the company’s policy:

policy = {
"grace_period_days": 10,
"late_fee_amount": 15,
"waiver_requires_manager": True,
}

The answer should explain that the invoice is beyond the grace period and that a waiver can be requested but requires manager approval.

Importantly, the system must not actually waive the fee.

Let’s solve this using four progressively more elaborate architectures.


Here’s the simplest implementation.

def explain_late_fee(invoice: dict, policy: dict) -> str:
if invoice["days_past_due"] <= policy["grace_period_days"]:
return "The invoice is still within the grace period."
message = (
f"Invoice {invoice['id']} is "
f"{invoice['days_past_due']} days past due. "
f"The grace period is {policy['grace_period_days']} days. "
f"A ${invoice['late_fee']} late fee therefore applies."
)
if policy["waiver_requires_manager"]:
message += (
" You may request a waiver, "
"but it requires manager approval."
)
return message

Call it:

answer = explain_late_fee(invoice, policy)
print(answer)

Output, shown with wrapping for readability (print writes one concatenated line):

Invoice 4812 is 14 days past due.
The grace period is 10 days.
A $15 late fee therefore applies.
You may request a waiver,
but it requires manager approval.

For the stated fixtures, we solved the problem. This function explains an already-recorded charge; the fixture assumes its $15 amount agrees with the supplied policy. It is not a complete billing engine or a waiver authorization mechanism.

Zero model calls.

Zero tokens.

Zero agent loops.

Zero unpredictable decisions.

And we can test the business rules with ordinary unit tests.

For example:

def test_late_fee_explanation():
answer = explain_late_fee(invoice, policy)
assert "14 days" in answer
assert "$15" in answer
assert "manager approval" in answer

This doesn’t prove that every conceivable policy is implemented correctly, but we can test the actual conditions directly.

For this exact question, we probably wouldn’t.

Python already knows:

Invoice status
Grace period
Late fee
Waiver requirement

And the requested explanation follows deterministic rules.

But suppose customers ask questions in natural language:

Why did you ding me fifteen bucks?

Or:

I paid late because I was traveling. Can you help?

Or:

What’s going on with that extra charge?

Now interpreting the customer’s intent becomes useful.

That brings us to Option B.


We still don’t need an agent.

Our application already has the necessary facts.

The only uncertainty is how to interpret and respond to the customer’s language.

Let’s use one model call.

import json
from openai import OpenAI
from pydantic import BaseModel
client = OpenAI()
class CustomerReply(BaseModel):
message: str
waiver_requested: bool

Now:

def draft_customer_reply(
question: str,
invoice: dict,
policy: dict,
) -> CustomerReply:
response = client.responses.parse(
model="gpt-5.5-2026-04-23",
instructions="""
You are a customer-support assistant.
Answer using only the supplied invoice
and company policy.
Explain the policy clearly.
Identify whether the customer is asking
to have a fee waived.
Never claim a waiver has been approved
or performed.
""",
input=json.dumps({
"question": question,
"invoice": invoice,
"policy": policy,
}),
text_format=CustomerReply,
)
if response.status != "completed":
raise RuntimeError("Model response incomplete")
if response.output_parsed is None:
raise RuntimeError("No structured reply returned")
if not response.output_parsed.message.strip():
raise RuntimeError("No reply text returned")
return response.output_parsed

The Responses API supports this pattern: supplying a Pydantic model through text_format and receiving a parsed object through output_parsed. OpenAI structured-output guidance

Now:

reply = draft_customer_reply(
question=(
"I paid late because I was traveling. "
"Can you remove that extra charge?"
),
invoice=invoice,
policy=policy,
)
print(reply.message)
print(reply.waiver_requested)

A possible result:

The $15 late fee was applied because your
invoice was 14 days past due, which is beyond
our 10-day grace period.
You can request a waiver, but it requires
manager approval.

And:

True

Notice what we’ve achieved.

The model understood a loosely worded customer question.

It produced a structured response.

But it didn’t need tools.

It didn’t need a loop.

It didn’t need to retrieve anything.

And it certainly didn’t need a second agent.

Our architecture is simply:

CUSTOMER QUESTION
|
v
+----------+
| PYTHON |
| get data |
+----+-----+
|
v
+----------+
| LLM |
| explain |
+----+-----+
|
v
CustomerReply
|
v
+----------+
| PYTHON |
| checks |
+----------+

One model call.

One contract.

Done.

This is probably the architecture I would choose for this particular requirement.

One critical distinction: waiver_requested=True is the model’s interpretation of the message. It is not authorization to process a waiver. Python would still enforce the waiver workflow independently.


Now imagine the customer asks something more complicated:

I don’t understand the charges on my account. Can you figure out what’s going on?

This is different.

The application doesn’t necessarily know which information is relevant.

The agent might need to:

Look up customer
|
v
Retrieve invoices
|
v
Inspect payment history
|
v
Retrieve policy
|
v
Explain discrepancy

But perhaps the customer has no unpaid invoices.

Or perhaps the extra charge is a subscription fee rather than a late fee.

The correct sequence depends on what the agent discovers.

Now a tool-using agent becomes reasonable.

We could expose:

AVAILABLE_TOOLS = {
"get_customer": get_customer,
"get_invoices": get_invoices,
"get_payments": get_payments,
"get_policy": get_policy,
}

And use the loop we built in Lesson 4.

Conceptually:

def run_support_agent(question: str):
context = [{"role": "user", "content": question}]
for step in range(10):
response = call_model(
context=context,
tools=TOOL_DEFINITIONS,
)
if not response.tool_calls:
return response.answer
for call in response.tool_calls:
result = execute_allowed_tool(call)
context.append(result)
raise RuntimeError("Step limit exceeded")

That’s illustrative pseudocode, not a standalone runnable implementation. response.tool_calls, response.answer, and context.append(result) are shorthand here. A real Responses API implementation inspects response.output, keeps response items and associated tool outputs, and checks unsuccessful responses as shown in Lesson 4. The sketch omits those protocol details to isolate the architectural comparison.

The important difference from Option B is:

The model is now choosing which information to retrieve next.

Consider a possible execution:

MODEL:
get_customer()
PYTHON:
returns customer ID 42
MODEL:
get_invoices(customer_id=42)
PYTHON:
returns three invoices
MODEL:
get_payments(customer_id=42)
PYTHON:
returns payment history
MODEL:
get_policy(topic="late_fees")
PYTHON:
returns policy
MODEL:
produces explanation

We have genuine agentic behavior.

The next action is not fully predetermined.

The model makes decisions based on information returned by tools.

Could we still implement this with ordinary Python?

Absolutely.

If every customer-support request always requires those four lookups, we could simply do:

customer = get_customer(customer_id)
invoices = get_invoices(customer["id"])
payments = get_payments(customer["id"])
policy = get_policy("late_fees")

Then pass the results to one model call.

No agent loop required.

That’s a crucial realization:

Needing multiple tools does not automatically mean you need an agent.

If Python knows which tools to call and in what order, let Python do it.

An agent becomes useful when choosing the next operation genuinely requires judgment based on intermediate results.


Now let’s revisit Lesson 9.

Suppose we decide to separate the system into:

Agent A — Account Investigator

Searches account records, invoices, payments, and policies.

Agent B — Customer Response Specialist

Converts the findings into a clear explanation.

The architecture:

CUSTOMER QUESTION
|
v
+-------------+
| AGENT A |
| investigator|
+------+------+
|
Research
brief
|
v
+-------------+
| PYTHON |
| validate |
+------+------+
|
v
+-------------+
| AGENT B |
| writer |
+------+------+
|
v
FINAL ANSWER

We already know how to build this.

The orchestrator is almost embarrassingly simple:

def answer_customer(question: str) -> CustomerAnswer:
brief, retrieved = research_agent(question)
if not brief.source_ids:
return CustomerAnswer(
message="I couldn't verify the answer from the available company policies.",
source_ids=[],
)
return writing_agent(question, brief, retrieved)

This excerpt uses the contracts and function signatures from Lesson 9. Python retains the original question, and the writer is still one model call. An account investigator would also need invoice and payment evidence in its research implementation; this excerpt shows the handoff, not those additional tools. The empty-evidence branch is the same application decision, not another agent.

But ask yourself:

What problem did adding Agent B solve?

The first agent already understands the customer question.

It already has the account information.

It already has the policies.

Why can’t it write the response?

It probably can.

So we’ve added another model call, another contract, more latency, more cost, and another possible failure point.

And we haven’t demonstrated any improvement.

This is the central lesson.

A second agent should exist because it measurably improves the system, not because the workflow contains two conceptual responsibilities.


6. Don’t confuse separation of responsibilities with additional agents

Section titled “6. Don’t confuse separation of responsibilities with additional agents”

This is a subtle but important software-engineering distinction.

You might reasonably want to separate:

Research
Writing
Validation
Publishing

That doesn’t mean you need four agents.

You could implement:

research = retrieve_relevant_documents(question)
draft = generate_draft(question, research)
validated = validate_draft(draft, research)
if validated:
save_draft(draft)

Let’s examine each component.

retrieve_relevant_documents()

Could be ordinary Python using database queries or search.

generate_draft()

Could be one model call.

validate_draft()

Could be deterministic Python checks, perhaps supplemented by a model-based evaluation where warranted.

save_draft()

Should be ordinary application code.

We’ve separated responsibilities cleanly.

But we used only one LLM-powered component.

That’s good architecture.

Modularity is not the same thing as multi-agent design.

You can have beautifully modular software without multiple agents.


Let’s compare them directly.

Architecture Model calls Main advantage Main disadvantage
A. Python only 0 Predictable, fast, inexpensive Cannot interpret complex language without additional logic
B. Python + LLM Usually 1 Natural-language flexibility Model output can be wrong
C. One agent + tools Variable Model chooses actions dynamically More latency, cost, and control complexity
D. Multiple agents Usually more Specialized contexts and responsibilities Coordination overhead and compounded failures

Notice that I haven’t labeled Option D as the most advanced or the best.

It is simply the most elaborate.

That complexity may be justified.

Or it may be wasteful.


8. When is a second agent actually worth considering?

Section titled “8. When is a second agent actually worth considering?”

Let’s make this concrete.

Imagine a research-and-writing system.

One agent must search a large collection of documents, compare sources, identify contradictions, and construct a research brief.

Another component must produce highly specialized writing for a particular audience.

Separating them might improve quality because the tasks demand substantially different contexts and instructions.

For example:

RESEARCHER
Goals:
identify relevant evidence
compare sources
surface contradictions
identify missing information
Capabilities:
search
retrieve documents
Output:
structured research brief

Then:

WRITER
Goals:
turn evidence into publication-ready prose
respect editorial guidelines
preserve factual claims
communicate uncertainty
Capabilities:
no external tools required
Output:
structured article draft

This can be useful.

But even here, the writer doesn’t necessarily need an agent loop.

It might simply be one model call.

So a more accurate description could be:

One research agent plus one LLM-powered writing function.

That’s fine.

Don’t force everything into an “agent” abstraction.

And before implementing the separation, I’d want evidence that it improves at least one meaningful outcome: accuracy, maintainability, context isolation, testability, or operational reliability.


Here’s the simplest architectural decision process I know.

START WITH REQUIREMENT
|
v
Can ordinary Python solve it reliably?
|
YES / NO
| |
v v
PYTHON Does language understanding
or judgment add value?
|
YES / NO
| |
v v
ONE LLM REVISIT
CALL REQUIREMENT
|
v
Does the model need to choose
which action to perform next?
|
YES / NO
| |
v v
ONE AGENT ONE LLM CALL
|
v
Is there a demonstrated reason
to separate model-driven roles?
|
YES / NO
| |
v v
CONSIDER KEEP
MULTIPLE ONE AGENT
AGENTS

The progression should be:

Start with the least complicated architecture. Add autonomy only when the requirement demands it.

This is the opposite of how many agent demonstrations are presented.

Those often begin by introducing agents, then inventing reasons to use them.

We should begin with the business problem.


10. A useful distinction: workflow complexity versus decision complexity

Section titled “10. A useful distinction: workflow complexity versus decision complexity”

I want to introduce one final concept because it will help you make better architecture decisions.

A task can have many steps without requiring agentic behavior.

Consider:

1. Fetch document
2. Extract text
3. Validate text
4. Send to model
5. Parse result
6. Store result
7. Generate report
8. Email administrator

Eight steps.

But perhaps every execution follows exactly the same sequence.

That’s workflow complexity.

It doesn’t necessarily require an agent.

Now consider:

Investigate why this customer’s latest transaction failed and determine the next appropriate support action.

The model might need to inspect different information depending on what it discovers.

That’s decision complexity.

The workflow path isn’t known beforehand.

This is where agentic behavior can help.

The distinction:

MANY STEPS
≠
NEED AN AGENT
UNKNOWN NEXT STEP
+
JUDGMENT REQUIRED
=
POSSIBLE AGENT USE CASE

I consider this one of the most valuable takeaways from the entire curriculum.


11. Why more agents can make a system worse

Section titled “11. Why more agents can make a system worse”

Imagine we implement five agents:

Planner Agent
|
v
Research Agent
|
v
Analysis Agent
|
v
Writing Agent
|
v
Review Agent

Each model-driven stage introduces a possibility of error.

Suppose, purely as an illustration, each stage has a 95% chance of satisfying its own acceptance criteria.

If all five stages must succeed, and their failures were independent:

0.95 × 0.95 × 0.95 × 0.95 × 0.95
≈ 77%

That’s about a 77% probability of the entire chain succeeding.

Real agent failures are not necessarily independent, and a reviewer may catch upstream mistakes, so this is not a prediction of actual system reliability.

But the example illustrates an important engineering concern.

Adding stages creates additional opportunities for failure.

And downstream components may make upstream errors harder to notice.

For example:

RESEARCH AGENT:
Gets a fact wrong.
WRITING AGENT:
Turns incorrect fact into polished prose.
REVIEW AGENT:
Judges prose quality rather than checking source.
FINAL RESULT:
Confident, professional, incorrect.

This is why multiple agents should not be assumed to produce better results merely because they appear to check one another.


12. How to know whether the second agent helps

Section titled “12. How to know whether the second agent helps”

Remember Lesson 8?

Evals.

That’s how we answer the question objectively.

Suppose we have two implementations.

Version A:

answer = single_agent(question)

Version B:

research = research_agent(question)
answer = writing_agent(research)

Prepare the same evaluation dataset for both.

For example:

TEST_CASES = [
{
"question": "Why was my late fee charged?",
"expected_policy_id": "POL-17",
},
{
"question": "Can I get a fee waiver?",
"expected_policy_id": "POL-18",
},
{
"question": "Can you refund my entire invoice?",
"expected_no_action": True,
},
]

Then compare the implementations on the same tasks. The refund case tests that this answer-only system performs no refund. We have not added a refund capability to either implementation. If a later product supports one, its permission and approval workflow needs separate requirements and checks.

We would measure:

Metric One agent Two agents
Correct answers Measure Measure
Correct source usage Measure Measure
Unauthorized actions Measure Measure
Average latency Measure Measure
Token consumption Measure Measure
Cost per successful task Measure Measure

Don’t fill in those numbers from intuition.

Run the tests.

If the two-agent version is more accurate, easier to debug, or substantially better in another important way, the added complexity may be justified.

If the results are essentially equivalent, keep the simpler architecture.

Even if the two-agent design looks more impressive.


13. Sometimes the best improvement is removing the model

Section titled “13. Sometimes the best improvement is removing the model”

Here’s another situation worth recognizing.

Suppose your agent uses an LLM to decide:

Invoice overdue by 14 days.
Grace period = 10 days.
Should a late fee apply?

Why are we asking the model that?

Python can answer:

late_fee_applies = (
invoice["days_past_due"]
> policy["grace_period_days"]
)

Now we have a deterministic result.

We can use the model for the part it genuinely helps with:

Explain this result clearly to the customer.

This is often a better design.

PYTHON:
calculations
validation
business rules
authorization
database updates
MODEL:
language understanding
classification
summarization
judgment where necessary
natural-language generation

This is not about minimizing AI usage for its own sake.

It’s about using each component for the work it does best.

One of the biggest mistakes in agent engineering is letting probabilistic reasoning replace deterministic rules that were already working.


Let’s return to our customer-support example one final time.

If I were building it for a real small business, my initial architecture might be:

CUSTOMER MESSAGE
|
v
+-------------+
| FASTAPI |
+------+------+
|
v
+-------------+
| PYTHON |
| load user |
| load facts |
+------+------+
|
v
+-------------+
| LLM |
| understand |
| + explain |
+------+------+
|
v
+-------------+
| PYDANTIC |
| CONTRACT |
+------+------+
|
v
+-------------+
| PYTHON |
| permissions |
| validation |
| approvals |
+------+------+
|
v
RESULT

One model call.

A small number of ordinary Python functions.

Explicit state.

Structured outputs.

Normal error handling.

Logging and evals.

That system could handle a surprisingly broad range of useful work.

If we later discover that it needs to explore account data dynamically, we can introduce tool calling.

If we discover that it needs iterative decisions, we can introduce an agent loop.

If we discover that separate research and writing contexts improve quality, we can test a second component.

But we wouldn’t start there.

Architecture should evolve in response to real requirements, not anticipated complexity.


Imagine you’re building software for a small content business.

You have these four requirements.

For each, choose the simplest architecture.

Every day at noon, publish all approved posts whose scheduled publication time has arrived.

What would you use?

Answer: Ordinary Python.

for post in get_due_approved_posts():
publish_post(post)

You still need production safeguards against duplicate publication, but there’s no need for model reasoning.

Read a customer review and classify it as positive, negative, or neutral.

Answer: One LLM call.

Return a structured classification.

No tools or agent loop required.

Investigate a support request by deciding whether to consult invoices, orders, or customer records, depending on what is discovered.

Answer: Potentially one agent with tools.

The model may need to choose different retrieval operations as information becomes available.

Investigate a complex company-policy document, identify relevant provisions across several sources, and prepare a customer-facing report.

Answer: Consider two specialized components.

Research and writing may benefit from separate contexts and contracts.

But test whether a single research agent followed by a normal report-generation call performs just as well.

Notice the pattern.

The number of agents follows the problem.

Not the other way around.


Let’s finish the series by considering the problems created when we choose an unnecessarily complicated architecture.

A task that needed one model call now requires five.

Latency increases.

Costs increase.

More API interactions can fail.

The additional calls might not improve quality.

Better approach: Measure whether each call contributes something valuable.

The researcher retrieves information.

The writer independently researches again.

The reviewer repeats both operations.

The system spends time and money rediscovering the same facts.

Better approach: Use explicit contracts and share validated results where appropriate.

The final output is incorrect.

Was the problem caused by the planner, researcher, writer, reviewer, or handoff?

Better approach: Minimize unnecessary components, log each meaningful stage, and evaluate components separately.

Instead of:

if not user.can_publish:
raise PermissionError()

the system relies on:

Agent, please remember not to publish
unless the user is authorized.

Better approach: Keep enforceable policies in Python.

5. More agents create more opportunities for unauthorized actions

Section titled “5. More agents create more opportunities for unauthorized actions”

Each component receives its own tools and context.

If capabilities are overly broad, additional agents may create new paths to sensitive information or destructive operations.

Better approach: Give every component the narrowest capabilities it needs and enforce permissions in the underlying services.

A small business-rule change requires updating five prompts, three schemas, and multiple handoffs.

Better approach: Keep business rules centralized in application code and use small, stable interfaces.

The developer spends weeks implementing agent coordination instead of delivering the functionality users actually need.

Better approach: Solve the requirement first. Introduce additional architecture only when an actual limitation justifies it.


We’ve now covered all ten lessons.

Here’s the complete architecture we’ve progressively developed. The diagram follows successful model responses; incomplete, refused, or empty responses stop through the failure paths explained earlier. Human rejection stops the proposed action, and execution still requires current permission:

USER TASK
|
v
+-------------+
| PYTHON |
| application |
+------+------+
|
v
+-------------+
| MODEL |
| reasoning |
+------+------+
|
tool needed?
/ \
YES NO
| |
v v
+----------+ ANSWER
| PYTHON |
| validate |
+----+-----+
|
v
AUTHORIZED?
/ \
NO YES
| |
REJECT v
APPROVAL?
/ \
NO YES
| |
| HUMAN
| |
| APPROVED?
| / \
| NO YES
| | |
| v |
| REJECT |
| + STOP |
| |
+----+----+
|
v
RECHECK PERMISSION
|
v
EXECUTE TOOL
|
v
RECORD RESULT
|
v
MODEL

Surrounding that core:

STATE
Application truth
CONTEXT
Information visible to the model
RETRIES
Controlled recovery
OBSERVABILITY
Record what happened
EVALS
Measure whether it worked
STRUCTURED CONTRACTS
Keep interfaces reliable

And perhaps the most important architectural rule:

WHEN PYTHON ALREADY KNOWS WHAT TO DO:
LET PYTHON DO IT
WHEN LANGUAGE UNDERSTANDING IS NEEDED:
CALL A MODEL
WHEN THE NEXT ACTION REQUIRES JUDGMENT:
CONSIDER AN AGENT LOOP
WHEN SEPARATE MODEL-DRIVEN RESPONSIBILITIES
PRODUCE MEASURABLY BETTER RESULTS:
CONSIDER MULTIPLE AGENTS

That is the decision process I want you to retain.


If I had to reduce this entire curriculum to one idea, it would be:

An agent is not a replacement for software engineering. It is a software-engineering pattern for incorporating model-driven decisions into an application.

Everything we’ve built uses familiar tools and principles.

Python functions.

HTTP API calls.

JSON.

Pydantic.

Loops.

Conditionals.

Databases.

Permissions.

Exceptions.

Logging.

Tests.

The LLM adds something powerful: the ability to make useful decisions in situations where ordinary deterministic code would require cumbersome or brittle rules.

But that capability doesn’t eliminate the need for engineering.

It increases the importance of understanding what happens underneath.

And this brings us back to the principle running through this course.

Understanding the system matters more than memorizing the framework.

Once you understand the underlying mechanisms, a framework becomes an optional implementation choice rather than something you depend on to understand how your software works.

You can look at almost any agent framework and recognize:

This is the model call.
This is the tool registry.
This is the execution loop.
This is state management.
This is context construction.
This is the approval boundary.
This is logging.
This is evaluation.

And you can decide whether that framework actually helps you.

That’s the level of understanding I wanted this series to develop.


We’ve covered the entire curriculum, from the first LLM call through multi-agent orchestration and the decision not to use it.

I’ll leave you with one final principle:

Build the smallest system that works reliably. Understand every moving part. Add complexity only when the evidence demands it.

That’s agent engineering done right.