Haytham Abuelfutuh · CTO, Union AI
Haytham Abuelfutuh认为,生产环境智能体的难点不仅在于提示词和工具,还在于围绕长时运行、容易出错的会话的运营基底。演讲围绕动态执行、持久恢复和防御性沙箱三个维度构建了生产就绪性的框架,并以人类旅行社为例,说明了中断处理、状态保持和恢复比一个干净的演示循环更为重要。
Show of hands at the conference: many built an agent. Almost no hands stayed up for "shipped to production."
Most of your time goes into prompts and tools. Most of your crashes come from infrastructure you ignored.
A first-principles platform spec: Dynamic, Durable, Defended.
The pitch is not "no failures." It is "make recovery from failure cheap."
Dragonfly: 250,000 products indexed by a four-tier agent fleet, prototype to production in one session.
Researchers and ML engineers wanting to own infrastructure, and platform teams learning to let them.
Haytham opens with a story from his honeymoon planning, "many many many moons ago, about 18 years ago actually."
"Never once did the agent ask me to, you know, repeat everything I said... we had many email exchanges, phone calls, dropped phone calls."
The human travel agent kept state for weeks. Dropped calls? She called back and continued. No re-prompting. No "context too long."
That is the bar Haytham sets for the agents we build today.
"That's really the whole point. If you have built one, you know it takes very time-consuming to get... the right context and the right prompts to get LLMs to do what you want, and the guardrails around them, and the API calls, and the tools, this and that."
You spend almost all your time on the top layer. You crash because of the bottom one.
Top — semantic & logical
prompts, tools, guardrails — your IP, your innovation. Mostly iterated on a laptop.
Bottom — infrastructure
"agents crash, you know, you run out of memory, the tools are not scaling... you get API limits and throttling, and just all kinds of production issues."
And these manifest as "corrupt context. You have to restart sessions" — terrible UX for users.
"agents do fail and they will fail in production... instead of trying to really prevent that, or like trying to design the perfect agent that will never fail when you put it in production, you should be building agents that tolerate that, that know how to react when failure is happening."
The job is not preventing failure. The job is making the agent survive it.
A first-principles spec for the platform that runs your agents.
Dynamic — no DSL. Just write the agent like normal Python: loops, try/except, async.
Durable — sessions can run for weeks. When something crashes, recover where you left off without re-asking the user.
Defended — when the agent wants to write and run custom code, sandbox it; when it gives up, hand back to a human.
for, if, try/except, async"There is no DSL required. You're just running your code on that infrastructure."
"if it doesn't know that, oh, I allocated a 32 GB RAM for this task... when you get an out of memory error, it will have no idea what to do with it because it didn't even know that it was running on a 32 GB machine in the first place."
Declare the environment in the code. Memory, CPUs, GPU type — all sit next to the function that needs them.
If it fails, you can:
作者概括: your code controls both the infrastructure and the logic running on it — that's the only way the recovery loop can be smart.
try/except can't catchtry/except catchesThe escape: tell the platform "I want this job retried" or "rerun on a different piece of hardware." External, declarative retries — not user code.
Why spot? "they're cheaper, you get a cheaper GPU, or you're running on a new cloud, so you can get actual GPUs because you can't find them otherwise."
"the problem with agents is they're long-running, right? You can have a session open with a user for weeks at end. So, something bad is going to happen while this session is going."
crash and restart. People even deploy "chaos monkeys" to kill services on purpose.
a 2-hour user session that dies halfway through cannot just start over.
the platform has to record every action the agent took and replay through them on recovery.
The platform records every external action. On recovery, you don't re-do them — you replay the recorded outcomes.
Two things you especially don't want to repeat:
LLM calls. "if you're calling an LLM, you know, 2 days ago, if I call it again today with the same prompt, it's probably not going to give you the same response."
User prompts. "if I ask a user for something in the beginning of the session... and the session crashes and recovers, you don't want to ask the user the same question again, right?"
Imagine the travel agent forgetting and asking your budget again two weeks later. Annoying.
"having the ability and the power from the platform to decide that for certain things I'm okay caching... is very powerful."
"if there's one thing I would love everyone to agree with is that failures will happen and it's not about... preventing failures. It's about how we deal with these failures when they do happen — and you want them to be cheap."
Cheap recovery
no full restart
Recorded actions
replay, don't redo
Tolerable failures
declare what to retry
"It's like metadata about metadata really."
"you will get to a point where the agent will look at 100 tool you gave it and says none of these really do the job. I want to run this custom, you know, travel flight lookup... I want to write code and you want that. You want this sort of escape hatch in a lot of cases."
1. Sandbox it
network-isolated, host-isolated
2. Run it
collect output and errors
3. React
iterate, retry, or bail
Shout-out: Pydantic's Monty project — "low-level Python environment that is sandboxed."
A "naive" but effective recipe:
1. agent writes code → run in sandbox
2. error? feed it back: "I tried to run this, I got this error, iterate."
3. "Usually the LLMs got a lot better at building code that runs, and compiling it beforehand... eventually, you will get code that does the thing you want it to do."
4. if not — "give it your best shot, try five times" — then bail to the human.
"you want a human in the loop capability. You want to be able to say, 'Hey, I tried to build this tool or tried to do this thing and I can't. Tell me what to do next.' Or maybe it gives you a few options, and you want to ask the user, 'Which one would you prefer?'"
When? After bounded retries fail. Or when the agent has multiple defensible options and no preference.
What it buys you: clean handoff back to a person, then the agent picks up the answer and continues — no restart, no lost context.
You want to add an HR tool, or an issue tracker. There are thousands. Which one fits your stack?
The hard part wasn't "can an agent give a recommendation." It was: can a fleet of agents keep a catalog of a quarter-million products fresh, queryable, and reliable in production?
A four-tier system, all coordinated, all traced, all auditable.
Tier 1 — Calling agents. Always running. Decide what to research next.
Tier 2 — Coordinators. Smart enough to notice "you look like you're doing the same things — let me stop one of you."
Tier 3 — Researchers. One job: research a specific product end-to-end.
Tier 4 — Tools. Web search, doc indexing, whatever a researcher needs.
"they took this from a sort of a prototype they were building on their laptop to do the thing they're trying to do to a running thing in production in one session sitting with him. It's like a couple of hours — and it was running already on the system that can scale."
"we use Python for the our SDK. This is the user-facing how you develop the agents."
"the system in the back is all built on Go and Rust services. So, even the Python SDK has a Rust component that is running the coordination is super fast."
"But, we're not using Erlang, no."
The split is deliberate: ergonomic surface for the agent author, hard-engineered coordination layer underneath.
"How do you deal with companies that are a little bit more on the side of not wanting to change that and get the developers wanting to start thinking about those things? Essentially shifting left that piece of component there."
Platform team was historically the sole owner of anything that runs in the cloud. Researchers had to package, Helm-chart, deploy through them.
"if you want to sell that promise... I would really show them how fast it is for them to iterate. They cannot get the same speed if there is another hop."
"I could see it in people's eyes once they experiment with the platform."
"agents do fail and they will fail in production... you should be building agents that tolerate that, that know how to react when failure is happening."
"Never once did the agent ask me to, you know, repeat everything I said... we had many email exchanges, phone calls, dropped phone calls."
"the problem with agents is they're long-running. You can have a session open with a user for weeks at end."
"It's not about... preventing failures. It's about how we deal with these failures when they do happen — and you want them to be cheap."
"the agent will look at 100 tool you gave it and says none of these really do the job... you want this sort of escape hatch."
"I could see it in people's eyes once they experiment with the platform."
Haytham Abuelfutuh · Union AI / Flyte
MLOps Community · AI Agents 2026 · Seattle