Pydantic AI adds ConversationStore to prevent concurrent chat saves from overwriting each other

samuelcolvin · x · 2026-11-04

Pydantic AI shipped ConversationStore, fixing a real concurrency bug in agent apps: two tabs on one chat both send a message, and if each save rewrites the conversation, the second silently replaces the first.

New behavior: each message is stored once, saves append only the new turn, and conflicting saves raise ConversationConflict instead of overwriting — callers reload and retry. Full code examples with InMemoryConversationStore and custom subclasses are in the docs.

Essentially optimistic concurrency control for agent conversation persistence, built into the framework.

Original post →

More from coding & agent

coding & agent channel →