Lesson 09.10 · Phase 09 · Frameworks & SDKs

Porting between frameworks

A port isn't done when the new code runs. It's done when the new code makes the same tool calls with the same arguments on the same inputs. Describe the agent once in a framework-neutral spec, generate each framework's code from it, then replay recorded model replies through the old and new runtimes and diff the trajectories. Checking only final answers will pass a port that is badly broken.

Learning objectives

  • Write a framework-neutral agent spec: instructions, tools, approvals, output fields and budget.
  • Generate Pydantic AI, OpenAI Agents SDK and LangGraph code from the spec, carrying approvals and budgets across.
  • Replay recorded model replies through two runtimes and find the first divergence in their trajectories.
  • Explain why final-answer comparison misses porting bugs, and why framework-added prompt text needs a behaviour check.

You're moving an agent from a hand-written loop to a framework, or from one framework to another. The port compiles, the demo question gives the right answer, and you ship it. A week later finance notices refunds stopped going out. The new tool schema used orderId, the function still took orderid, every refund call failed, and the model politely told customers their refund was processed.

Loading the full lesson…