Back to writing
AI DailyNov 29, 20261 min read

AI Daily - 2026-11-29: Pydantic AI makes long-running agents durable

Pydantic AI v2.77 adds database-backed conversations and first-party compaction, moving agent state from demo glue into a restartable product concern.

AgentsInfraModels

Why it matters

What changed Pydantic AI released on November 27 with a cluster of changes aimed at agents that need to survive more than one request.

What changed

Pydantic AI released v2.77.0 on November 27 with a cluster of changes aimed at agents that need to survive more than one request. The headline addition is first-party ConversationStore support for SQLite, PostgreSQL, and MongoDB, replacing the assumption that conversation state lives in process memory or a single local file.

The release also adds a compact_history() capability hook, RunContext.request_compaction(), and explicit CompactionStartEvent/CompactionEndEvent events. An agent can now ask for its history to be compressed before the next model request, while the underlying conversation store can retain the full log. Pydantic also added thinking_summary for readable cross-provider reasoning summaries, plus stricter authority checks for disk-loaded sub-agents and usage accounting for fallback search and image-generation requests.

Why it matters

Long-running agents usually fail at the boundary between a good demo and a real product: the process restarts, the transcript grows past the model context window, or two workers try to save the same conversation. Pydantic AI is turning those problems into explicit runtime surfaces. Its persistence guide describes a store that appends new messages, detects conflicting saves, supports branching and forking, and keeps failed runs recoverable.

The important design choice is separating durable state from model-visible context. The full conversation can remain available for audit, search, or later recovery, while a compaction capability decides what the next request actually needs. That makes context management a product behavior that can be observed and tested, not an emergency string-truncation patch hidden in middleware.

Builder takeaway

If an agent can take multiple turns, call tools, or resume after a deploy, treat conversation persistence and compaction as part of its core data model. Start with a real ConversationStore, add conflict handling around concurrent saves, and emit compaction events into your traces. Keep the full history for recovery, but make the compacted history explicit and testable before the context window becomes the incident.

Sources