Software Engineering Daily
Episode: Pydantic AI with Samuel Colvin
Date: December 4, 2025
Host: Gregor Van
Guest: Samuel Colvin (Creator of Pydantic & Pydantic AI)
Overview
In this episode, Gregor Van sits down with Samuel Colvin, the creator of Pydantic and Pydantic AI, to discuss the evolution of Pydantic from a genre-defining type safety and data validation library for Python, to a broader company delivering core infrastructure for modern AI applications. They cover the origins of Pydantic, the philosophy and engineering behind type safety, the development of the Logfire observability platform, the challenges in agentic AI frameworks, and the upcoming Pydantic AI Gateway. The discussion is rich with technical insights, open source reflections, and practical advice for engineering reliable AI systems.
Origins of Pydantic
Samuel Colvin’s Background:
- Originally a mechanical engineer; became a software engineer in 2014.
- Shifted to open source around 2016-2017.
- Pydantic emerged from frustration with Python’s type hints not being enforced at runtime.
- Goal: “Could we... enforce those types at runtime? It obviously worked spectacularly well relative to my initial experiment.” (Samuel, 02:36)
Growth & Impact:
- Massive adoption: “...about 460 million downloads a month now. Just hoping to cross the like half a billion downloads a month sometime...” (Samuel, 03:57)
- Used by major organizations: “All the companies who are writing Python and they're using it somewhere.” (Samuel, 04:18)
Type Safety in Python & Pydantic’s Philosophy
Controversial Beginnings:
- Types arrived late in Python’s evolution, primarily for static analysis and documentation.
- Samuel underscores the uniqueness of Python: “It’s the only language where you can do this trick effectively.” (Samuel, 05:15)
On Constraints & Runtime Types:
- Tradeoff between static flexibility and runtime utility.
- “Once people like me started using them at runtime and once they were found to be really useful, it did limit what you can go and do with them in static typing time... But I think it’s incredibly valuable.” (Samuel, 04:28)
Pydantic V3 and Engineering Roadmap
Transitioning Versions:
- V2 transition was “quite painful for a lot of people.” (Samuel, 05:38)
- V3 promises smoother migration: “...mostly changing some config defaults... The biggest change coming soon...a new primitive type in Pydantic, probably used as a decorator...under the hood, the data will be held as a Rust type...” (Samuel, 05:50)
- Ambition: major performance boosts (~3x over current) via Rust integration.
- Exploring direct conversion into Parquet, possible protobuf serialization.
“Pydantic is already very, very fast. It’s 50ish times faster than Pydantic V1.” (Samuel, 06:28)
Logfire: Observability for Python & AI
Genesis:
- Built after Pydantic raised its first venture round (backed by Sequoia, early 2023).
- Samuel: “I had felt that logging...or tracing in Python, was...nothing like as nice as it should be.” (Samuel, 07:50)
Product Scope and Differentiators:
- Intuitive, Pythonic instrumentation; leverages OpenTelemetry but makes the user experience easier.
- “The nicest way of doing tracing in Python that’s just emitting OpenTelemetry data.” (Samuel, 09:15)
- Serializes complex Python objects (e.g., dataclasses, datetimes) natively—improvement over vanilla OpenTelemetry.
- Backend (Logfire platform) is a closed-source SaaS, with a generous free tier.
AI & Observability:
- Logfire treats all data as traces; supports full SQL queries, which is appealing for AI ("AI as SRE") and makes LLM-based debugging practical.
- “The best experience I have seen for that is connect Claude code to Logfire via MCP...” (Samuel, 11:23)
- First-class support for AI observability: token usage, pricing, evals.
Pydantic AI: Type Safe Agentic Tooling for Python
Genesis and Motivation
- Unlike competitors, Pydantic team “...were reasonably cynical about some of the AI stuff for a long time... probably turned out to be a good decision because we waited for the patterns to settle...” (Samuel, 13:06)
- Many agentic/LLM frameworks use Pydantic, but Samuel found “...they’re not type safe. I think type safety is incredibly important and only getting more important with AI's writing code.” (Samuel, 13:47)
- The goal: “...relatively unopinionated and low level...do the things you definitely don’t want to have to reimplement again...” (Samuel, 14:44)
Scope & Features
- Can call LLMs, create agents, function calling, evals, orchestration graphs.
- Keeps focus on type-safety throughout: “...we have some of the most advanced support for different ways of doing structured outputs...” (Samuel, 17:23)
- Supports dependency injection and type-safe graphs, inspired by FastAPI but leveraging new typing strategies.
- “Agent is generic in the output type... we also guarantee it’s an instance of that at runtime...” (Samuel, 17:23)
Design Patterns in Agentic Systems
On Number of Agent Tools
- The much-discussed upper bound: “People talk about 10 to 15 max. I think it’s interesting that that number has not moved this year... our idea of how big an agent should be has decreased this year.” (Samuel, 19:37)
- Three definitions of “agent”:
- LLM calling tools in a loop
- Engineering (microservice)
- Joke/business (replaces employee)
Evolving Patterns:
- Early notions: large monolithic agents handling everything.
- Current best practice: breaking up complex logic into “multiple different agents that you piece together to give some constraints on what your application is able to do...” (Samuel, 20:36)
- Emphasis on traceability, modularity, easier debugging, and swapping subcomponents (e.g., different LLMs per subtask).
On "Swarms"/Teams:
- Dismisses buzzwords: “Most of these terms are pretty much bullshit.” (Samuel, 22:48)
- “AI is still just engineering...how do we go and use that? We apply the engineering principles that we have learned and improved on over the last 20 years, 40 years...” (Samuel, 22:54)
Practical Development Principles for AI Engineering
Experimentation and Refactoring
- “You’re going to have to go and try a bunch of things and throw stuff out and try again.” (Samuel, 24:21)
- Type safety enables easier (& safer) refactoring, and using AI assistants for code changes is much more reliable when type safety is present.
Observability and Evals
- “Observability is not something that you shoehorn into your application the day before launch... It’s genuinely useful from day one.” (Samuel, 24:41)
- “Evals are important. Evals are a powerful mechanism to...systematically improving, rather than kind of random walk” (Samuel, 24:53)
LLM Context Handling
- LLMs struggle with tabular data (CSVs/Markdown tables) compared to key-value (JSON/XML):
“...if you give it access to basically XML or JSON where it has the key each time, it’ll do way better. But that’s just one example...” (Samuel, 25:32)
Multi-Agent Systems, Memory, and State Management
Agent Decomposition & Shared Memory
- “If you have an isolated task and you can take the context...move that into a separate agent...it can be a great way of reducing the amount of context that the main agent has.” (Samuel, 27:32)
- Reduces context window size, makes debugging easier, and improves modularity.
Memory/State
- Simple examples: “...record memory tool and a retrieve memory tool... just recording all messages and then doing a bit of work to cut off some older messages when you like, if you have very long running conversations...” (Samuel, 38:07)
- Pydantic AI offers primitives for you to build your own rather than high-level, “magic” memory frameworks.
Graph Theory & Durable Execution
DAGs vs. Loops vs. Durable Execution
- Jury is out on complex graphs: “Someone said to me recently that the most useful thing that graphs do is make people who want graphs happy... How much value are they after that? I think not that much.” (Samuel, 30:12)
- Emphasizes agent loops (LLMs calling tools in a loop) as the powerful primitive adopted recently.
- Durable execution (e.g. temporal, debo) allows for long-running, resumable, fault-tolerant workflows:
“Our approach is different. We support durable execution frameworks like temporal...that is a much, much more powerful way of getting the longevity part of long running agents.” (Samuel, 32:16)
Developer Experience and Open Source Philosophy
Principles Learned
- “We’re battle scarred by introducing the wrong API and having to maintain it for a long time...we’re very careful about the surface area...” (Samuel, 34:09)
- Stick to universal, low-level foundations instead of “batteries included” high-level abstractions, to allow broad usage.
Community Contributions
- “It’s amazing how powerful agents can be if you just hook them up to a SQL connection and let them retry a bunch when they get the SQL wrong.” (Samuel, 36:19)
- Many features (AGUI, Vercel AI Elements) community-driven.
Open Standards
- “Pydantic AI emits standard compliant OpenTelemetry data... there are about 13 different observability platforms that support Pydantic AI one way or another. We obviously think Logfire is the best of those, but... not trying to lock you in.” (Samuel, 40:23)
Sustainability & The Reality of Commercial Open Source
On Dual Focus and Critique:
- “Go and look at the top 100 most downloaded Python packages... per head, per dollar... we are one of the most impactful companies in terms of how much open source we do. But we have to make money, right? We’re a startup.” (Samuel, 48:01)
- Candid about the need for commercial arms to support the open source work.
“The reason we’re trying to make money is so that those things don’t happen... I am not going to go and maintain Pydantic on my own for the rest of my life...” (Samuel, 50:16)
Pydantic AI Gateway
Purpose:
- A unified LLM gateway for enterprises.
- “Are you going to give everyone in the company an OpenAI key, where technically they can spend $5 million...? Obviously not.” (Samuel, 42:32)
Features:
- Centralizes access/observability/caching/security across multiple LLM providers (OpenAI, Anthropic, Gemini, Mistral, Grok, etc.).
- Easy integration with Pydantic AI: “...your one API key will then let you connect to all of those different models...” (Samuel, 43:33)
- Open source gateway, closed-source management console.
- Can emit OpenTelemetry from within the gateway, supporting enterprise-level audit and security workflows.
- Targeted release: late October 2025. (44:51)
Advice & Reflections
On Open Source Careers:
- Samuel encourages meaningful open source contributions as a pathway to opportunities, but emphasizes it's a marathon, not a shortcut:
“How long does it take to get 10 years of experience? It takes 10 years...” (Samuel, 52:29)
On the Impact of AI on Software Engineering:
- LLMs multiply productivity but don’t remove the need for foundational skills:
“You still fundamentally need a truck driver in that truck to reverse around the corner, even if they spend a bunch of their time in cruise control.” (Samuel, 54:06)
Personal Inspiration:
- Samuel cites Guido van Rossum, creator of Python, for his humility and vision:
“He got so much stuff right long before his time, in terms of realising that... programming languages are for humans to use, not for computers to use, and prioritising the human bit.” (Samuel, 55:20)
Notable Quotes
- On why type safety matters in AI frameworks:
“I think type safety is incredibly important and only getting more important with AI's writing code.” (Samuel, 13:50) - On AI patterns and engineering:
“AI is still just engineering...we apply the engineering principles that we have learned and improved on over the last 20 years, 40 years…” (Samuel, 22:54) - On open source sustainability:
“We have to make money, right? We’re a startup.” (Samuel, 48:05) - On staying responsive:
“One of us will reply to your message on public Slack almost always within an hour or two in most time zones. We’ve been there, we’re developers.” (Samuel, 46:51) - On Python’s community-driven ascent:
“Python had one random Dutch guy and an amazing community.” (Samuel, 55:20)
Timestamps for Key Segments
- [02:36] — Samuel’s path to Pydantic & type hints philosophy
- [03:57] — Pydantic by the numbers: half a billion monthly downloads
- [05:38] — The V1→V2→V3 journey and Rustification
- [07:50] — Origin and purpose of Logfire
- [09:15] — Making observability/telemetry accessible and AI-ready
- [13:06] — Rationale behind building Pydantic AI agent framework
- [19:37] — Evolution of agent orchestration: small, modular over monolithic
- [24:21] — The importance of observability/experimentation/evals in AI
- [30:12] — On graphs vs loops and the power of durable execution
- [38:07] — State management and memory approaches in Pydantic AI
- [40:23] — Commitment to open standards in observability
- [42:32] — Rationale and features for Pydantic AI Gateway
- [46:01] — On striking the right balance between abstraction and control
- [48:01] — Open source sustainability and commercial realities
- [55:20] — Personal inspiration from Guido van Rossum
Tone & Engagement
Samuel is candid, technical, pragmatic, and sometimes wry — insisting on engineering fundamentals amid rapidly evolving AI trends and community buzzwords. The episode emphasizes practicality, long-term sustainability, and the central importance of type safety and observability in production AI systems.
This summary captured all critical concepts, memorable moments, and direct quotes for listeners who want a detailed but digestible account of the episode — without the fluff.
