Pydantic AI 2.77: What's New for Agent Developers

Pydantic AI 2.77.0 adds SQLite, Postgres and MongoDB conversation stores, a compaction hook, softer skill loading and stricter subagent authority.

By Esha Sabir · November 28, 2026 · 8 min read · How we write

Pydantic AI 2.77.0 shipped on 27 November 2026 with four changes that matter if you build agents on it: conversation stores for SQLite, PostgreSQL and MongoDB, a compact_history() hook with RunContext.request_compaction(), skill libraries that no longer fail a run when a folder is missing, and subagent definition files that now need 'operator' authority to load.

The facts below come from the v2.77.0 release notes on GitHub (published 2026-11-27 23:32 UTC) and the PyPI page (files uploaded 2026-11-28 00:01 UTC), as of 2026-11-28. The companion package pydantic-ai-harness went to 0.77.0 at the same time, per its PyPI page. Nothing in this post was installed or run; every code block is quoted or adapted from the official docs and says which.

The release in one table

AreaBefore 2.77In 2.77.0Do you need to act?
Conversation storageNo database backends listed; the name SqliteConversationStore belonged to the Pax session-browser storeSqliteConversationStore, PostgresConversationStore, MongoConversationStore for any app; the Pax store is renamed SqliteSessionStoreOnly if you imported the old Pax names (they still import, with a deprecation warning)
CompactionBuilt-in strategies such as SummarizingCompactionNew compact_history() hook, RunContext.request_compaction(), CompactionStartEvent and CompactionEndEventOnly if you match exhaustively on AgentStreamEvent
Compaction receiptsSent to the model as a UserPromptPartSent as a CompactionReceiptPart in the application's voiceIf you read receipts out of saved history
SkillsA missing or unreadable skill library failed the runSkipped with a warning by default; missing_directories='error' keeps the old behaviourIf you relied on the failure
Subagents from diskNo 'operator' authority floor for definition filesFiles below 'operator' authority are skipped with a warningYes, if your subagents live in a low-authority workspace
StreamingLast yield could look complete after a cut-off streamstate='incomplete' when an Anthropic, Google or OpenAI Responses stream ends earlyIf you check state == 'complete'
Stdio MCP serversPlain agent.run() could keep them aliveThey stop once the agent and toolset go out of scopeIf a sampling callback expected the run context

Source for every row: the v2.77.0 release notes, read 2026-11-28.

Conversation stores: chat history in SQLite, Postgres or MongoDB

For app builders, the main change is ready-made database backends for saving a chat between runs. The Conversation Stores docs describe three backends that implement Pydantic AI's ConversationStore:

  • Each message's JSON is stored once, keyed by its SHA-256, however many conversations hold it.
  • Continuing a conversation appends only the new messages, and a fork shares history instead of copying it.
  • A save is checked against the conversation's revision. If someone else saved in between, save raises ConversationConflict instead of overwriting.

One detail worth reading twice: the docs say a conversation's scope filters what the store returns, but isolating tenants stays with your application. If you run a multi-tenant agent, keep your own access checks.

The Pax coding agent's own session store was renamed to SqliteSessionStore (and ConversationConflict there to SessionConflict). The old names still import with a HarnessDeprecationWarning, per the release notes.

Compaction you can trigger: context engineering in the run loop

Compaction is how an agent keeps a long conversation inside the context window by trimming or summarizing older messages, one of the main tools of context engineering. Pydantic AI already shipped ready-made strategies. Version 2.77.0 adds a compact_history() capability hook and RunContext.request_compaction(), so your code, or the model through a tool, can ask for compaction at a moment it chooses.

The release notes say the new CompactionStartEvent and CompactionEndEvent only appear when something calls request_compaction() or a compact_history hook exists, so existing streams do not change. The catch is typing: an exhaustive match over AgentStreamEvent with assert_never stops type-checking until you handle the two new events.

Two related fixes in the same release:

  • Compaction receipts now reach the model as a CompactionReceiptPart rather than a fake user message. Saved histories with old receipts are still recognized, and the notes say the next compaction "moves the cached prefix once", so expect one prompt-cache miss.
  • When automatic SummarizingCompaction fails, the default FallbackCompaction chain now recovers from UnexpectedModelBehavior instead of ending the parent run.

Skills: a missing folder no longer kills the run

Pydantic AI Harness loads Agent Skills (SKILL.md folders) with progressive disclosure: per the Skills docs, the model first sees each skill's name and description and loads the full instructions with a load_capability tool only when it needs them. If you are new to the format, our SKILL.md format guide walks through the file.

What changed in 2.77.0, from the release notes:

  • Skills(...) without missing_directories now skips a missing, non-library or unreadable library path instead of failing the run. Every case except a plain missing directory logs a warning.
  • An unreadable skill directory or SKILL.md is skipped with a warning instead of raising PermissionError.
  • Pass missing_directories='error' to keep the old fail-fast behaviour, which is useful in CI where a missing skill should be loud.
  • SkillCatalog.advice is new, and SkipReason gains a value, so an exhaustive match on it needs updating.

Subagents: authority now gates what loads from disk

This is the change most likely to surprise you after upgrading. The Subagents docs describe one delegate_task(agent_name, task) tool that runs a named child agent in its own run with its own message history. In 2.77.0, per the release notes:

  • SubAgents no longer loads a subagent definition file below 'operator' authority, such as any file in a workspace opened at authority='none'. It skips the file with a warning.
  • A working_directory= delegate's workspace is lowered to the lowest authority the parent gives that directory. A directory outside the parent's working directory is at 'none' unless a path_authority entry covers it.
  • The Pax Review specialist working on another checkout now reads that checkout's AGENTS.md as data, not as instructions.

In plain terms: a repository you point an agent at can no longer hand it new subagents or instructions just by containing the right files. That is a prompt injection guardrail, and it is the same idea behind our posts on prompt injection in tool-using agents and least privilege for AI agents. If your own subagent files stopped loading after the upgrade, add a path_authority entry for that directory.

The notes also flag durable runs: runs using SubAgents with agent_folders record one realpath per definition file at run start, so let in-flight runs finish (or use Temporal worker versioning or a new DBOS app version) before upgrading.

Smaller changes that can break code

From the release notes:

  • Thinking: a request that sets the unified thinking setting on Anthropic or Claude on Bedrock now sends thinking.display: 'summarized'. Newer Claude models then return summarized thinking instead of empty thinking, which the notes say can add a little latency before the first text token. The new thinking_summary setting returns readable thinking across providers.
  • Usage limits: requests made by XSearch and ImageGeneration fallback subagents now count toward the run's UsageLimits, including the default request_limit=50. A run near the limit can now raise UsageLimitExceeded.
  • OpenAI errors: OpenAIChatModel raises ModelRequestRejectedError before sending tools to GPT-5.4 and GPT-5.6 models with reasoning on, instead of the provider's 400. An except ModelHTTPError no longer catches it.
  • Image output: OpenAIChatModel on the OpenAI or Azure provider raises UserError for requests that allow image output.
  • Conversation search: search_conversation_history scans only the newest 2,000 in-scope messages by default (max_scanned_messages).
  • Costs: cost() raises ValueError instead of a bare AssertionError when the model name is missing.

The release before this one, v2.76.0 on 26 November 2026, added DeprecatedModelWarning on requests to gemini-2.5-pro and gemini-2.5-flash, so test suites that turn warnings into errors may already have flagged that.

How to upgrade and try the new pieces

Not run for this post. The install line is adapted from the installation docs, which write pip/uv-add pydantic-ai and require Python 3.11 or newer, and from the Skills docs, which install the skills extra of the harness:

pip install -U "pydantic-ai==2.77.0" "pydantic-ai-harness[skills]==0.77.0"

Saving a conversation between runs, quoted from the Conversation Stores docs with the model string replaced by a placeholder:

import sqlite3
from pydantic_ai import Agent, Conversation
from pydantic_ai_harness.conversation_store import SqliteConversationStore

store = SqliteConversationStore(connection=sqlite3.connect(':memory:', check_same_thread=False))
agent = Agent('openai:<model>')

async def chat(conversation_id: str, prompt: str) -> str:
    conversation = await store.load(conversation_id) or Conversation(conversation_id=conversation_id)
    result = await agent.run(prompt, conversation=conversation)
    await store.save(result.conversation)
    return result.output

Letting the model ask for compaction, quoted from the Compaction docs, placeholder model string:

from typing import Any
from pydantic_ai import Agent, RunContext
from pydantic_ai.capabilities import NativeCompaction

agent = Agent('anthropic:<model>', capabilities=[NativeCompaction()])

@agent.tool
def compact_conversation(ctx: RunContext[Any], focus: str | None = None) -> str:
    """Compact the conversation before your next turn."""
    ctx.request_compaction(reason='model_requested', focus=focus)
    return 'The conversation will be compacted before your next turn.'

Before you upgrade a production agent, search your code for assert_never over AgentStreamEvent or SkipReason, except ModelHTTPError around OpenAI calls, and state == 'complete' checks on streams. Those are the spots the release notes call out.

Who should care

  • Teams running chat agents: the conversation stores replace hand-written history tables, and the revision check catches two workers saving the same chat.
  • Anyone building long-running agents: the compaction hook makes context management something you control in the agent harness, not only something the provider does when a threshold is crossed.
  • Coding-agent and repo-agent builders: the authority change for subagents and AGENTS.md decides which files in a checkout count as instructions. Read it before pointing an agent at third-party code.

Find Pydantic AI agents and related tools

AGXmart lists open-source agents and MCP servers with a dated scan and a "What it can touch" section on each listing. Browse open-source AI agents, MCP servers, or search for Pydantic AI projects. For background on skills, read what agent skills are.

FAQ

What is new in Pydantic AI 2.77?

Pydantic AI 2.77.0, released 27 November 2026, adds SQLite, PostgreSQL and MongoDB conversation stores, a compact_history() hook with RunContext.request_compaction(), softer skill-library loading and an 'operator' authority requirement for subagent files loaded from disk. It also returns summarized thinking on newer Claude models and reports 'incomplete' for cut-off streams.

Does Pydantic AI 2.77 have breaking changes?

The release notes list them as compatibility notes rather than a major version. The ones most likely to bite are exhaustive match statements over AgentStreamEvent or SkipReason, subagent files in low-authority workspaces that no longer load, and ModelHTTPError handlers that no longer catch the new ModelRequestRejectedError.

How do I save Pydantic AI conversations to a database?

Use one of the conversation stores from pydantic_ai_harness.conversation_store: SqliteConversationStore, PostgresConversationStore or MongoConversationStore. Load the conversation by ID, pass it to agent.run(..., conversation=...), then save result.conversation, as in the docs example above.

Why did my Pydantic AI subagents stop loading after the upgrade?

From 2.77.0, SubAgents skips definition files below 'operator' authority and logs a warning. If the files are yours and you trust them, give their directory a path_authority entry at the right level so they load again.

What is the difference between pydantic-ai and pydantic-ai-harness?

pydantic-ai is the agent framework. pydantic-ai-harness (0.77.0 as of 2026-11-28) holds the ready-made capabilities such as Skills, SubAgents, compaction strategies and the conversation stores; its docs say its API may change between minor releases while it is on 0.x.

List your agent

Built something on Pydantic AI? List it on AGXmart: list it and start selling.

Built something, or looking for a tool?

Browse agents, MCP servers and skills on AGXmart, see what each can touch, and explore the newest standards on our agent protocol map. List yours and start selling.

More on AI Agents