# Why (Senior) Engineers Struggle to Build AI Agents

Philipp Schmid

AI Engineer Europe 2026

[Talk page](https://ai.engineer/talks/3_gYbhABcAE-why-senior-engineers-struggle-build-ai-agents) · [Video](https://www.youtube.com/watch?v=3_gYbhABcAE)

## Why (Senior) Engineers Struggle to Build AI Agents

Building reliable agents means preserving intent, letting plans change, recovering from failures, and evaluating outcomes instead of prescribing every step.

Familiarity with API calls, application state, and software tests is helpful; no particular agent framework is required.

### From prescribed steps to delegated goals

[0:15](https://www.youtube.com/watch?v=3_gYbhABcAE&t=15s)

What changes when the software you build chooses how to carry out a task? Philipp Schmid, who introduces himself as working at DeepMind on agents with **Gemini** and the Gemini API, identifies five shifts from his experience with engineers inside and outside Google. The starting point is a familiar development sequence: write a specification or PRD, implement it, test it, deploy it, and let users use it.

Agent development makes observation part of the implementation loop. Define instructions, run the agent, inspect its behavior, adjust the prompt or tools, and run it again. You are improving a system’s ability to reach an outcome, including behavior you did not explicitly write.

Schmid compares the change to moving from traffic controller to dispatcher. A traffic controller regulates lights, speeds, and available roads. A dispatcher specifies a destination: get from Germany to London. The traveler might take a train, fly, or drive through the tunnel. **The goal stays fixed while the route can vary.** A coding agent can likewise take surprising intermediate actions and still deliver the requested result. That distinction—between specifying the outcome and prescribing every step—underlies the five examples that follow.

![Slide titled “Traffic Controller vs. Dispatcher” with three explanatory bullets and blue and green illustrations of traffic control and dispatch.](https://ai.engineer/api/talk-essay-media/bd4e5aa427042b4690864f2e8b2dc879a695263759b56779b000bc2c177991e6)

Traffic controller versus dispatcher: two mindsets for building software and agents.

### Text as state

[2:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=125s)

A research agent proposes a plan. An interface with only accept and deny buttons treats the next interaction as a Boolean decision. But the user may want to approve the plan and modify its scope in the same response: approve the market research, focus on the US, and exclude California. The language carries both authorization to proceed and a constraint on the work.

If the interface cannot preserve both meanings, the user may have to reject the plan, answer a follow-up question, and wait for a replacement. A useful state representation instead retains the approval together with the additional instruction. For example, the response `Approve the plan; focus on the US market and exclude California.` should leave the research pending, with the plan approved and its scope constrained. Approval is not evidence that research has already happened.

Approve the plan and preserve the constraint
One response changes approval and scope while leaving execution pending.
Constructed example: The exact response wording, record labels, and explicit pending execution state are teaching details constructed from the research-plan example.
User response — unchanged: Approve the plan; focus on the US market and exclude California.
Operation: Record approval and the additional scope instruction without marking the research as completed.
- Task
  - Before: Proposed plan: Market research
  - After: Approved plan, research still pending: Market research
- Plan approval
  - Before: Proposed plan: Awaiting user response
  - After: Approved plan, research still pending: Approved
- Additional scope instruction
  - Before: Proposed plan: Not present
  - After: Approved plan, research still pending: Focus on the US market and exclude California.
- Research execution
  - Before: Proposed plan: Pending
  - After: Approved plan, research still pending: Pending
One response changes approval and scope while leaving execution pending.

Personalization has the same problem. A user may generally prefer Celsius but want Fahrenheit for cooking. A single `use_fahrenheit` flag loses the conditional preference; a location flag such as `is_europe` cannot supply it either.

| Input | What a single flag loses |
|---|---|
| Approve, but exclude California | Approval and a scope change together |
| Celsius generally; Fahrenheit for cooking | A default with a contextual exception |

Structured storage can hold these preferences. The design mistake is reducing their meaning to a structure too narrow to express them. **Preserve the context the model needs to interpret the next request.**

### Let intent change during the conversation

[3:42](https://www.youtube.com/watch?v=3_gYbhABcAE&t=222s)

Context is not limited to text: images, video, and audio can also shape what the agent should do. The next shift concerns who chooses the response. In a traditional customer-support pipeline, a cancellation request goes through an intent classifier, receives a churn label, and enters a predefined retention or cancellation workflow.

Now suppose the agent explores the request and offers an alternative. The user accepts and changes their mind about canceling. The initial classification no longer describes the conversation’s goal. An agent needs to respond to the updated meaning, rather than continue along the cancellation path because that was the first label assigned. Enumerating every offer, response, and change of intent as a stateful workflow becomes difficult. Delegating some control lets the next action follow the conversation as it develops.

![Slide with trap, collision, and fix bullets beside a customer support conversation showing a cancellation request, an offer, and acceptance, labeled churn and retention.](https://ai.engineer/api/talk-essay-media/4ba7ce898869555a6c673a103b86942d66104de6d9a4ee9e71779e2a43323bb1)

A cancellation request becomes retention in the “Hand Over Control” example.

### Return errors to the agent

[4:53](https://www.youtube.com/watch?v=3_gYbhABcAE&t=293s)

Handing over control means leaving a purely deterministic workflow. It also changes how failures should enter that workflow: **an error is another input the agent can reason about.** Schmid uses Go as an analogy. Go functions commonly return an ordinary result alongside an error value, and the caller checks and handles the error explicitly. A failed tool call can similarly produce information for the next decision instead of terminating the entire task.

Retrying a cheap HTTP request or product search may be acceptable. Restarting a long agent run has different consequences. Schmid asks us to imagine an agent that has already worked for five or fifteen minutes: starting over repeats the preceding computation and may discard useful context. Feed the failure back to the model so it can consider a workaround or an additional check while retaining the work already done.

A small Go adapter can make both outcomes available to the surrounding agent loop:

```go
package agent

type SearchInput struct {
    Query string
}

type SearchObservation struct {
    Input   SearchInput
    Results []string
    Error   string
}

func ObserveSearch(
    input SearchInput,
    search func(string) ([]string, error),
) SearchObservation {
    results, err := search(input.Query)
    observation := SearchObservation{
        Input:   input,
        Results: results,
    }
    if err != nil {
        observation.Error = err.Error()
    }
    return observation
}
```

The caller adds this observation to the existing context. The failed query remains visible, any returned results remain available, and the error becomes material for choosing the next action. Recovery still requires a decision; returning an error as data does not itself repair the failure. The purpose is to continue from the current state instead of automatically restarting.

### Trace the route, grade the outcome

[6:13](https://www.youtube.com/watch?v=3_gYbhABcAE&t=373s)

Traditional unit, integration, and smoke tests often check a deterministic relationship: input A passed through code B produces output C. An agent can take different steps and produce different results from the same input. Evaluating it therefore requires asking how often it succeeds, not just whether one run passed an assertion.

Schmid’s hypothetical customer agent succeeds on the same prompt only one out of ten times—too flaky to release. This is an illustration of the reliability question, not a measured benchmark or a proposed universal release threshold.

Success also depends on the task. A research report and a customer-feedback response may need different qualitative criteria, assessed by an **LLM judge** or a human expert. Trace what the agent does so its behavior can be inspected, but grade whether its output satisfies the request. One user’s report might require four additional research steps and more tokens than another’s. The longer route can still be the successful one; matching a single expected sequence would miss that distinction.

### Make the tool contract carry the meaning

[7:47](https://www.youtube.com/watch?v=3_gYbhABcAE&t=467s)

Schmid’s fifth shift starts with a mismatch: agents evolve, while existing APIs retain assumptions built for their human developers. In a product microservice, `delete_item(id)` may feel self-explanatory to someone who has worked on the service for years. The agent has none of that accumulated context.

What does `id` identify? What happens when deletion fails? A developer familiar with the implementation may already know. Initially, the agent sees function schemas, docstrings, and tool definitions—not the code behind them. Those exposed surfaces must carry the information needed to choose and use the operation.

- **Semantic names:** Identify the operation and the kind of object it acts on.
- **Parameter descriptions:** Explain what an identifier refers to, rather than merely labeling it `id`.
- **Failure behavior:** Describe what the caller receives when the operation cannot complete.

The interface should be understandable without the experience of the team that built it. Delegating tool selection does not remove the application’s responsibility to validate an operation before executing it.

![“Agents Evolve, APIs Don’t” slide contrasts a yellow Human-Grade API panel with a green Agent-Ready API panel, including code examples and semantic naming, verbose docstrings, and just-in-time adaptation labels.](https://ai.engineer/api/talk-essay-media/11858494eb675f081a84c3e831bead024d7eb00bf8880d710c9b9a60bc6a4145)

Human-grade and agent-ready APIs compared side by side.

### Choose what reliability must mean before release

[9:04](https://www.youtube.com/watch?v=3_gYbhABcAE&t=544s)

Trusting the model and verifying its work are complementary responsibilities. Avoid forcing every request through one fixed sequence merely because that sequence is familiar. Preserve the meaning in the context and provide a way to recover when something goes wrong. Longer runs make recovery especially consequential: imperfect models can encounter unexpected situations well after useful work has accumulated.

The release decision then becomes an explicit reliability judgment. An assertion about one successful run is insufficient. Determine how frequently the agent must succeed for the user-facing task, and evaluate against that requirement. Schmid gives no single percentage that makes every agent ready; choosing the acceptable level is part of engineering the product.

### Build to delete

[9:53](https://www.youtube.com/watch?v=3_gYbhABcAE&t=593s)

The final implication concerns the lifetime of the software itself. Invoking [The Bitter Lesson](https://www.cs.utexas.edu/~eunsol/courses/data/bitter_lesson.pdf), Schmid argues that better models and agents will lead engineers to rebuild the same capabilities repeatedly. **Build to delete** is his engineering interpretation: expect some of today’s software to become disposable as the underlying capabilities improve.

![Summary slide with five numbered cards: Stop Fighting the Model, Preserve Meaning, Design for Recovery, Evaluate Don’t Assert, and Build to Delete.](https://ai.engineer/api/talk-essay-media/db79274bfbb81f9509923d8da4b7d920062b5ce4687b551beb27270d334900af)

“Trust, but Verify” closes with five principles, including “Build to Delete.”

Schmid closes by pointing readers to his [companion article](https://www.philschmid.de/why-engineers-struggle-building-agents) for a deeper treatment and code examples. The enduring responsibility is to make the current agent useful and reliable while remaining willing to replace the implementation that gets it there.

## Resources

- [Why (Senior) Engineers Struggle to Build AI Agents](https://www.philschmid.de/why-engineers-struggle-building-agents) — Schmid’s companion essay develops the five engineering shifts with examples of contextual state, recovery, evaluation, and descriptive tool interfaces.
- [Gemini API function calling](https://ai.google.dev/gemini-api/docs/function-calling) — Current documentation for defining tools, handling function calls, and validating arguments, with Python and JavaScript examples.
- [The Bitter Lesson](https://www.cs.utexas.edu/~eunsol/courses/data/bitter_lesson.pdf) — Rich Sutton’s 2019 essay on why general methods that scale with computation prevail, reproduced in a university-hosted PDF.
- [Errors are values](https://go.dev/blog/errors-are-values) — Rob Pike explains how Go programs can manipulate error values and organize error handling without repetitive checks.

## Slides

### AI Engineer Europe

[0:00](https://www.youtube.com/watch?v=3_gYbhABcAE&t=0s) [AI Engineer Europe logo on a black background.](https://assets.ai.engineer/sites/aiecode2025/sha256/9bc84484548f4eb9f7b88a04e506953a7c2c2aed6778462cad0a5dc88fb1c4ab.webp)

AI Engineer
EUROPE

### Presenting Sponsor: Google DeepMind

Google DeepMind is the presenting sponsor.

[0:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=5s) [Google DeepMind presenting sponsor card.](https://assets.ai.engineer/sites/aiecode2025/sha256/7eab358dd46d1a3998b4a1f691d24334ce614d7adcc88aa2b2aa7f50a95bf70a.webp)

PRESENTING SPONSOR
Google DeepMind

### Platinum Sponsors

Braintrust, WorkOS, and OpenAI are the platinum sponsors.

[0:10](https://www.youtube.com/watch?v=3_gYbhABcAE&t=10s) [Platinum sponsor card featuring Braintrust, WorkOS and OpenAI.](https://assets.ai.engineer/sites/aiecode2025/sha256/cdf1a29d3e146ae1c56cb9547e8d27dd1d127a77ca89f3b2d3859a0436391e6e.webp)

PLATINUM SPONSORS

Braintrust
WorkOS
OpenAI

### Why (Senior) Engineers Struggle to Build AI Agents

Philipp Schmid frames five mental model collisions between traditional engineering instincts and agent behavior, where loops, recovery and contextual meaning meet probabilistic LLMs.

[0:35](https://www.youtube.com/watch?v=3_gYbhABcAE&t=35s) [Philipp Schmid's title slide contrasts engineering instincts with agent reality through a mental model collision.](https://assets.ai.engineer/sites/aiecode2025/sha256/6b01b7b76c9d518d7f2b36e0a7e3349485df304ce5110868600e1db5c276e432.webp)

PHILIPP SCHMID • GOOGLE DEEPMIND

Why (Senior) Engineers Struggle to Build AI Agents

5 mental model collisions from traditional engineering, and how to fix them.

TOP
Engineering Instincts
Strict Types, Determinism

BOTTLENECK
Mental Model Collision
Fighting the probability of LLMs

BOT
Agent Reality
Loops, Recovery, Contextual Meaning

1 / 9

AIE
AI Engineer EUROPE
2026

### Software vs. Agents

Traditional software moves from definition through deployment. Agent development loops: run the agent, observe its behavior, adjust prompts or tools, and run it again to improve reliability.

[0:43](https://www.youtube.com/watch?v=3_gYbhABcAE&t=43s) [Software follows define, code, test and deploy; agents follow instruct, observe, adapt and loop back.](https://assets.ai.engineer/sites/aiecode2025/sha256/eb3e49fda9b75b9b72cf44adc6b3117b5882c670fa5bb8827f78aa41679f7ad4.webp)

THE PARADOX
Software vs. Agents

SOFTWARE
Define
Code
Test
Deploy

AGENTS
Instruct
Observe
Adapt
Loop Back

2 / 9

Interface text:
AIE
AI Engineer EUROPE
2026

### Traffic Controller vs. Dispatcher

The speaker compares software engineers to traffic controllers who set the rules of the road. Agent engineers act more like dispatchers: they define a goal while the agent chooses how to reach it.

[1:21](https://www.youtube.com/watch?v=3_gYbhABcAE&t=81s) [The slide compares deterministic software engineering to traffic control and probabilistic agent engineering to dispatching.](https://assets.ai.engineer/sites/aiecode2025/sha256/24e366219290efd46ecd0899f37c27fe0738aa5a8fbb90b3f31cf827f10f4deb.webp)

THE PARADOX
Traffic Controller vs. Dispatcher

• Traffic Controller Mindset: Traditional software engineering is Deterministic. You own the roads, signals, and laws.
• Dispatcher Mindset: Agent engineering is Probabilistic. You give instructions to a driver tracking ambiguity.
• The Trap: The better the engineer, the harder they fight the model. They try to "code away" non-determinism with if-statements and rigid schemas.

3 / 9

Interface text:
AIE
AI Engineer EUROPE
2026

### Text is the New State

An approval string can carry a US-market focus and a request to ignore California. A temperature preference can distinguish weather from cooking, preserving context that fixed flags lose.

[2:04](https://www.youtube.com/watch?v=3_gYbhABcAE&t=124s) [Slide advocates preserving semantic context in text, with plan approval and temperature preference examples.](https://assets.ai.engineer/sites/aiecode2025/sha256/5887268f75f9cedbc01d404701befb4ce6869b948fe3a19d4a4599f3a2e7862d.webp)

PART 1
Text is the New State

The Trap: Treating the real world as enums and booleans because it feels safe.
The Collision: Forcing natural language intent into discrete booleans lobotomizes the context.
The Fix: Preserve semantic meaning through raw strings so the agent can adapt intelligently downstream.

# ❌ Software Eng: Lobotomizing intent
{"plan_id": "123", "status": "APPROVED"}

# ✅ Agent Eng: Preserving semantic meaning
{"plan_id": "123", "text": "Approved, but focus on the US market and ignore CA."}

# Another example: boolean vs. semantic preference
is_celsius: true                         # ❌ One-size-fits-all
"I prefer Celsius for weather, Fahrenheit for cooking." # ✅ Task-aware

4 / 9

Other visible text:
AIE
AI Engineer EUROPE 2026
Engineering the future of AI

### Hand Over Control

A customer asks to cancel, then accepts 50% off for three months. The example shows why an agent needs to follow changing intent instead of a fixed cancellation flow.

[3:50](https://www.youtube.com/watch?v=3_gYbhABcAE&t=230s) [Slide recommends letting an agent navigate changing user intent, illustrated by a subscription cancellation conversation that becomes a retention opportunity.](https://assets.ai.engineer/sites/aiecode2025/sha256/4287e1ce3985d18d0695093f383caa9c2f65492b6bd05d51919012827ee9b2f8.webp)

PART 2
Hand Over Control

• The Trap: In microservices, user intent maps to a route. We instinctively hard-code the flow.
• The Collision: Real interactions loop, backtrack, and pivot. Hard-coded paths lose customers.
• The Fix: Trust the agent to navigate. You're a dispatcher, not a traffic controller.

Key insight: Describe what you want, not the path to get there. Provide constraints, not procedures.

Customer Support
I want to cancel my subscription.
INTENT: CHURN
I understand. Before you go, I can offer you 50% off for the next 3 months.
Actually, yeah, that works.
INTENT: RETENTION

If you hard-coded the churn flow, you just lost a customer.

5 / 9

Interface text:
AIE
AI Engineer EUROPE 2026
Engineering the future of AI

### Errors Are Just Inputs

Returning a tool error to the agent lets it retry instead of restarting a five-minute, $0.50 run. Restarting also risks losing the context accumulated so far.

[5:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=305s) [Slide contrasts crashing an agent run with returning an error to the agent for recovery.](https://assets.ai.engineer/sites/aiecode2025/sha256/94cd453abb186c3106a0a4b8b7bef431a298c58376c37bf1d2c62d3140519ec1.webp)

PART 3
Errors Are Just Inputs

• The Trap: Failing fast and crashing the entire execution on a minor schema fault.
• The Collision: An agent run takes 5 minutes and costs $0.50. Crashing at step 4 of 5 is unacceptable.
• The Fix: Catch the error and feed it back so the agent self-corrects.

# ❌ Traditional: Fail Fast
raise RuntimeError(f"Failed: {e}") # 💀 Crash

# ✅ Agent: Feedback Loop
return f"Error: {e}. Try a different approach." # 🔄 Recover

LOOP
Agent Loop Running

FAULT
Tool Execution Error Occurs

Traditional Way
Crash run
$0.50 wasted 💀

Agent Way
Feed back as String
↓
Agent Retry & Succeed

6 / 9

Interface text:
AIE
AI Engineer EUROPE
2026

### From Unit Tests to Evals

Agent runs vary, so measure how often they succeed, test out-of-scope requests, and grade the result rather than the tools chosen. The slide illustrates readiness as 45/50 passes with a 4.5/5 quality score.

[6:12](https://www.youtube.com/watch?v=3_gYbhABcAE&t=372s) [Slide recommends repeated evaluations, negative cases, and grading outcomes, with a comparison of tests and evals.](https://assets.ai.engineer/sites/aiecode2025/sha256/ac6270c6f62e8b2c2302a3b1982b36be87255aaefc0b4fe916a483593366c56e.webp)

PART 4
From Unit Tests to Evals

• Evaluate, Don't Assert: Output is nondeterministic. Run 3–5 trials per prompt and measure the distribution.
• Negative Cases Matter: Test that your agent ignores requests outside its scope. Triggering blindly degrades everything.
• Grade Outcomes, Not Paths: Did the agent yield the correct result? Don't grade which tools it chose to get there.

EVAL FRAMEWORK
TESTS | EVALS
Question: "Did it work?" | "How often?"
Method: Binary assertion | Pass^k (50x)
Quality: N/A | LLM-as-Judge
Debug: Stack trace | Tracing

Ready: 45/50 passes with quality score 4.5/5. You're managing risk, not eliminating variance.
7 / 9

AIE
AI Engineer EUROPE 2026
Engineering the future of AI

[7:02](https://www.youtube.com/watch?v=3_gYbhABcAE&t=422s) [Slide recommending repeated evaluations, negative cases, and grading outcomes, with a comparison of tests and evals.](https://assets.ai.engineer/sites/aiecode2025/sha256/60d24716a6390ab6d4cc7c76ac6db058e797f2da3fde4d1d477fa2db299a1bce.webp)

PART 4
From Unit Tests to Evals

• Evaluate, Don't Assert: Output is nondeterministic. Run 3–5 trials per prompt and measure the distribution.
• Negative Cases Matter: Test that your agent ignores requests outside its scope. Triggering blindly degrades everything.
• Grade Outcomes, Not Paths: Did the agent yield the correct result? Don't grade which tools it chose to get there.

EVAL FRAMEWORK
TESTS | EVALS
Question: "Did it work?" | "How often?"
Method: Binary assertion | Pass^k (50x)
Quality: N/A | LLM-as-Judge
Debug: Stack trace | Tracing

Ready: 45/50 passes with quality score 4.5/5. You're managing risk, not eliminating variance.
7 / 9

AIE
AI Engineer EUROPE 2026
Engineering the future of AI

### Agents Evolve, APIs Don't

An agent lacks the API’s product context, so the slide replaces delete_item(id) with a UUID-specific, typed function that documents what happens when an item is missing.

[7:46](https://www.youtube.com/watch?v=3_gYbhABcAE&t=466s) [Comparison of a vague API with an agent-ready API using explicit naming, types, and documentation.](https://assets.ai.engineer/sites/aiecode2025/sha256/fa4bd953bff1ca372e27811fbf0b8fb5ec8a8ea7ad03f2cd90d6a0e4fcd98ae1.webp)

PART 5
Agents Evolve, APIs Don't

Human-Grade API
Agents are literalists and will hallucinate ambiguous parameters.

delete_item(id)
No type, no description. Agent guesses id format.

# Vague implementation
def delete_item(id):
    pass

Agent-Ready API
Explicit, self-documenting semantic interfaces.

delete_item_by_uuid(uuid: str)
"Deletes an item by UUID. Returns error if not found."

# Explicit, verbose, typed
def delete_item_by_uuid(uuid: str):
    """Deletes an item by its UUID.
    Returns error if not found."""

Semantic Naming
Verbose Docstrings
Just-In-Time Adaptation

8 / 9

Interface text:
AIE
AI Engineer EUROPE
AI Engineer EUROPE 2026

### Trust, but Verify

Give models room to find a path, preserve context, and recover from errors. Evaluate unreliable runs and keep agent harnesses modular as models improve.

[9:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=545s) [Summary of five principles: give models flexibility, preserve meaning, design for recovery, evaluate outcomes, and build modular systems.](https://assets.ai.engineer/sites/aiecode2025/sha256/3435246f3c7db1e2c787fabd4bd42d47280fa46b58fb72af9c94ab112d68dc77.webp)

SUMMARY
Trust, but Verify

1. Stop Fighting the Model
You're a dispatcher now. Give instructions, let it pathfind.

2. Preserve Meaning
Text is greater than booleans. Context is everything.

3. Design for Recovery
Errors are inputs in a long-running execution loop.

4. Evaluate Don't Assert
Manage risk through Pass^k and LLM-as-judge.

5. Build to Delete
The Bitter Lesson: every harness gets rewritten. Make yours modular.

“You cannot code away the probability. You must manage it through evals and self-correction.”

Blog philschmid.de/why-engineers-struggle-building-agents
Philipp Schmid @_philschmid

9 / 9

Interface text:
AIE
AI Engineer EUROPE 2026
Engineering the future of AI

[9:39](https://www.youtube.com/watch?v=3_gYbhABcAE&t=579s) [Summary slide presenting five principles for building agents: stop fighting the model, preserve meaning, design for recovery, evaluate rather than only assert, and build to delete.](https://assets.ai.engineer/sites/aiecode2025/sha256/740b1283dcbac8c002ef2beaf0498b3d26d33fdba2ae6ae1d4c1e13a3c5c3e67.webp)

SUMMARY
Trust, but Verify

1. Stop Fighting the Model
You're a dispatcher now. Give instructions, let it pathfind.

2. Preserve Meaning
Text is greater than booleans. Context is everything.

3. Design for Recovery
Errors are inputs in a long-running execution loop.

4. Evaluate Don't Assert
Manage risk through Pass^k and LLM-as-judge.

5. Build to Delete
The Bitter Lesson: every harness gets rewritten. Make yours modular.

“You cannot code away the probability. You must manage it through evals and self-correction.”

Blog philschmid.de/why-engineers-struggle-building-agents
Philipp Schmid @_philschmid

9 / 9

Interface text:
AIE
AI Engineer EUROPE 2026
Engineering the future of AI

## Full transcript

[0:00](https://www.youtube.com/watch?v=3_gYbhABcAE&t=0s) [upbeat music] Okay, cool.

[0:15](https://www.youtube.com/watch?v=3_gYbhABcAE&t=15s) Awesome. Hi. Hi, everyone. Uh, my name is Philipp. I work at DeepMind, uh, everything related to agents on Gemini or Gemini API. So if you have some questions afterwards, some concerns, some bugs, some issue, please let me know.

[0:28](https://www.youtube.com/watch?v=3_gYbhABcAE&t=28s) Uh, we're going to talk today ten minutes about why engineers struggle to build agents. And I see this every day internally at Google, but also externally at Google. And I brought five example on, like, what's really different to how we built traditional software a few years ago and to now how we build agents.

[0:44](https://www.youtube.com/watch?v=3_gYbhABcAE&t=44s) And if we, like, on a high level compare them, right? When we wrote software, uh, we created a spec, a PRD, wrote code, sometimes created tests to make sure our code works.

[0:56](https://www.youtube.com/watch?v=3_gYbhABcAE&t=56s) We deployed it, and then our user used it. And when building agents, things are a little bit different. Uh, we define instructions on what we want our agent to do.

[1:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=65s) We run it, we observe what it does. We maybe adjust our prompts, maybe we adjust our tools. We run it again, and we have, like, this iterative loop of how can we improve and make our agent way more reliable, which is very different to how we build software.

[1:21](https://www.youtube.com/watch?v=3_gYbhABcAE&t=81s) And, like, something I like to compare it to is, like, traditional software is more like we acted as a traffic controller, right? We had control over the streetlights, over how fast you can go, which road you can use, basically how the car drives.

[1:34](https://www.youtube.com/watch?v=3_gYbhABcAE&t=94s) And now with agents, we are more of a dispatcher. We tell the agent, "Hey, I want to go to London," and I'm from, like, Germany. I could use the train, I could u-- fly, I could use my car and go, like, under the water.

[1:47](https://www.youtube.com/watch?v=3_gYbhABcAE&t=107s) And it's more about, okay, we define the goal on what we want the agent to do, but we don't define the exact step the agent needs to take to achieve that goal.

[1:55](https://www.youtube.com/watch?v=3_gYbhABcAE&t=115s) And I mean, every one of you has probably seen in their coding agent that sometimes it does something very weird, but at the end it achieves the outcome, and that's what we want to do.

[2:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=125s) So starting with the first example, text is our new state. I mean, traditionally we had data structures, and everything was kinda mapped to Boolean or to, like, flags we could check.

[2:16](https://www.youtube.com/watch?v=3_gYbhABcAE&t=136s) So initially, when we created, for example, a deep research agent, a deep research agent returns a plan to you. "Okay, I'm going to research this and that." In traditional software, we might have had an accept plan, uh, or deny plan, but we couldn't catch semantic meaning.

[2:35](https://www.youtube.com/watch?v=3_gYbhABcAE&t=155s) And now what we have with LLMs is they can understand the semantic meaning. So for example, if I have a deep research, um, request on, like, doing some market research, I can approve the initial plan, but I can also on the same time provide additional information.

[2:50](https://www.youtube.com/watch?v=3_gYbhABcAE&t=170s) So maybe I want to focus on, like, the US market and ignore California. Uh, maybe I want to provide something additional and not have, like, this multiple steps, right?

[2:59](https://www.youtube.com/watch?v=3_gYbhABcAE&t=179s) Traditionally, I would probably said decline, and then it has a follow-up. I m-might need to provide more input, create a new plan and continue. And another good example is everything related to memory and person-personalization we do cannot really be mapped to data structures, right?

[3:16](https://www.youtube.com/watch?v=3_gYbhABcAE&t=196s) The example I here-- I have is, like, um, I'm from Europe, so I mostly use Celsius. But what if I would like to use Fahrenheit for cooking, right? Previously, we might had some flags on, like, the user profile.

[3:29](https://www.youtube.com/watch?v=3_gYbhABcAE&t=209s) Is Celsius or is Europe or use Fahrenheit? But I couldn't, like, dynamically adjust based on the user preference, based on what they provide. So really it's all about text and context.

[3:42](https://www.youtube.com/watch?v=3_gYbhABcAE&t=222s) I mean, could be images, video or audio as well. But we no longer are really operating in those clear structured data concepts. The other thing is we should start handing over control and the, the trap or the example which we might had from, like, previous customer support is, like, when a user reached out, "Hey, I want to

[4:05](https://www.youtube.com/watch?v=3_gYbhABcAE&t=245s) cancel my subscription," I might have had a classification model which kinda classified the intent. Okay, the user wants to churn. And then I had a predefined workflow of, okay, do you try to sell it?

[4:18](https://www.youtube.com/watch?v=3_gYbhABcAE&t=258s) Do you cancel the subscription? But there was no, like, dynamic kinda option to, to react to it dynamically. And maybe instead of, like, um, going through the subscription cancel flow, what if your agent, like, kinda tries to understand the meaning and, like, offers something, uh, in-- except to, like, the, the subscription and the user changes their mind

[4:41](https://www.youtube.com/watch?v=3_gYbhABcAE&t=281s) and now you have, like, a whole different intent. And it's very hard to model all of those differences and uniqueness and to, to, like, all of those stateful workflows we had before.

[4:53](https://www.youtube.com/watch?v=3_gYbhABcAE&t=293s) So we need to, like, trust into the LLM or, like, hand over control that we are no longer working in those purely deterministic, um, environments. The third one is errors are just inputs.

[5:08](https://www.youtube.com/watch?v=3_gYbhABcAE&t=308s) So if something in your agent flow fails, we need to treat it as a normal input, as very similar to a user input. In Go, we already do this, right?

[5:18](https://www.youtube.com/watch?v=3_gYbhABcAE&t=318s) A function call can be an error or can be a value, and we treat them kinda equally, and we have to do this for agents very similarly. In the past, HTTP requests were very cheap.

[5:29](https://www.youtube.com/watch?v=3_gYbhABcAE&t=329s) When some search, some product search failed, you just rerun your request. You redid all of the work, which was okay. But now if you have, like, an agent which takes five minutes, fifteen minutes, and something in the flow breaks and you would start o-all over, you would need to sp- [coughs] You need to spend a lot of compute

[5:49](https://www.youtube.com/watch?v=3_gYbhABcAE&t=349s) again to, like, do all of the previous steps, and you also might lose the existing context. So we cannot, like, just start over the whole process. We need to kinda understand and treat errors differently, provide them back to the model, maybe have some other workaround, some additional checks that we-

[6:06](https://www.youtube.com/watch?v=3_gYbhABcAE&t=366s) Basically keep going forward in the flow and not like starting over from the beginning.

[6:13](https://www.youtube.com/watch?v=3_gYbhABcAE&t=373s) The fourth, uh, example or step is like we need to move from unit tests to evals. So when building software before, right, we wrote integration tests, unit tests, smoke tests, and all kind of different tests.

[6:25](https://www.youtube.com/watch?v=3_gYbhABcAE&t=385s) And we assume that when we provide input A for our code B, we will always get C as an output. And that's no longer the case with agent. Agents are non-deterministic.

[6:36](https://www.youtube.com/watch?v=3_gYbhABcAE&t=396s) We cannot always guarantee that the same input will lead to the same steps and the same result. So we need to move from unit tests to eval. We need to test how often something works because agents are only successful if they are really reliable, right?

[6:51](https://www.youtube.com/watch?v=3_gYbhABcAE&t=411s) If you have a customer agent and the same prompt only works one out of 10 times, it's nothing really you want to put in production, and it becomes very flaky.

[7:00](https://www.youtube.com/watch?v=3_gYbhABcAE&t=420s) So we need to test on evals, on how many times it passes. And compared to traditional software, results are very subjective, right? An outcome can be very different if you ask it to create a research report, if you ask it to create a customer feedback kind of scenario.

[7:18](https://www.youtube.com/watch?v=3_gYbhABcAE&t=438s) And we need more like qualitative, uh, feedback. Um, LLM-as-a-judge or human expert, for example, is a good way. And we always need to trace what the agent is doing, but we need to grade on the output.

[7:29](https://www.youtube.com/watch?v=3_gYbhABcAE&t=449s) We-- Maybe the agent decides for like one user it needs to do like four more steps to do more research than for the other user. It consumes maybe a few more tokens, but at the end, the outcome is really what we need to measure and want to measure in terms of, uh, success.

[7:47](https://www.youtube.com/watch?v=3_gYbhABcAE&t=467s) And then the last part is, uh, agents evolve and APIs don't. And if you have worked on the back end, and if you have built an API, you might have seen a lot of methods, API endpoints which feel very self-explaining to you, like delete item feels very self-explaining if you're working on like the product API.

[8:10](https://www.youtube.com/watch?v=3_gYbhABcAE&t=490s) But an agent doesn't see the code. An agent doesn't have the context and the background from all those years from you working on the API. So we need to build APIs or tools which are really agent ready, which are self-documenting with semantic interfaces.

[8:27](https://www.youtube.com/watch?v=3_gYbhABcAE&t=507s) I would assume if you have like a product microservice and you have a delete item endpoint with an ID, you don't need to like define a docstring what the ID is or what happens if something fails.

[8:40](https://www.youtube.com/watch?v=3_gYbhABcAE&t=520s) But our agents only see like the function schemas and the docstrings and the tool definitions. So on the first look, they don't really see what the delete item method does.

[8:50](https://www.youtube.com/watch?v=3_gYbhABcAE&t=530s) That's why we need to really adjust to, hey, we need methods, tools which are written for agents to be used and not assume long year developer expertise and people who have built the API.

[9:04](https://www.youtube.com/watch?v=3_gYbhABcAE&t=544s) So to, to summarize everything, we need to give trust, but we also verify. We should stop fighting the model. You should not like try to force the model into this one specific workflow with step one, do this, step two, do the other thing.

[9:19](https://www.youtube.com/watch?v=3_gYbhABcAE&t=559s) We need to preserve meaning. Um, everything is a context now. We no longer have those very well-defined data structures for all of our applications. We need to design for recovery.

[9:31](https://www.youtube.com/watch?v=3_gYbhABcAE&t=571s) Models are not perfect. Agents are not perfect, especially if we have longer running agents. There will be some very weird things happening, so you need to design for recovery.

[9:41](https://www.youtube.com/watch?v=3_gYbhABcAE&t=581s) We need to evaluate and don't, don't only assert. Agents are not one hundred percent reliable. We need to find the right balance between how many times our run need to be successful to provide it to the user.

[9:53](https://www.youtube.com/watch?v=3_gYbhABcAE&t=593s) And last but not least, build to delete. Um, the bitter lesson is what every one of us is learning is like software is disposable. We are going to rebuild many, many times the same things with better models, better agents.

[10:08](https://www.youtube.com/watch?v=3_gYbhABcAE&t=608s) Things will change. And, um, yes, um, it's also available on my blog. So if you want to like look a bit deeper with some code examples. And if not, if you have any questions, feel free to, to reach out to me and perfect on time.

[10:22](https://www.youtube.com/watch?v=3_gYbhABcAE&t=622s) Thanks. [clapping] [outro jingle]
