MemorySync
Official SDK

Pydantic AI + MemorySync

One capability gives every run recalled context and success-only turn persistence — no history pollution.

Overview

Install pydantic-ai-memorysync and add MemorySyncCapability(user_id=...) to Agent(capabilities=[...]): recall injects through the framework’s instructions channel — never a conversation part, so message-history replay can never stack stale memory blocks — and turns persist in after_run, which fires only on success, so a failed run leaves no half-remembered turn. Identity resolves from your deps for multi-user servers. Five structured tools plus a typed search tool returning validated Pydantic models. The only memory integration built on pydantic-ai v2’s capability system.

Setup status and requirements

Supported version
pydantic-ai-memorysync 1.0.0 (PyPI)
Last setup review
2026-08-23
Permissions
A MemorySync API key with read and write scopes; the delete tool needs delete permission.
Limits
Requires pydantic-ai (or pydantic-ai-slim) >=2 <3 (Python 3.10+). Python only — TypeScript agents use the Vercel AI SDK or Mastra integrations.
Open setup documentation →

Capabilities

Quick Start

from pydantic_ai import Agent
from pydantic_ai_memorysync import MemorySyncCapability
agent = Agent(
"openai:gpt-5",
instructions="You are a helpful assistant.",
capabilities=[MemorySyncCapability(user_id="customer-7")],
)
result = await agent.run("What should I cook tonight?")

Use Cases

Pydantic AI agents that remember users across runs and deploys

Multi-user servers resolving identity from typed deps

Structured pipelines consuming typed memory search results

Explore More

Built for production AI systems

Build AI systems that remember

MemorySync provides the infrastructure layer for persistent memory, adaptive retrieval, and enterprise AI intelligence.

Start free. No credit card required.