Pydantic AI
Add Suprflo long-term memory to Pydantic AI agents. Ships in the Python SDK.
Install
bash
pip install "suprflo[pydantic-ai]"What you get
All built on the Python SDK MemoryClient:
SuprfloDeps— an agent dependency carrying theclientand theuser_idthe tools operate on.save_memory/search_memory— tool functions that read those deps off theRunContext.memory_tools()— both wrapped as Pydantic AITools.
Tools for an agent
python
from pydantic_ai import Agent
from suprflo import MemoryClient
from suprflo.integrations.pydantic_ai import SuprfloDeps, memory_tools
client = MemoryClient(api_key="YOUR_API_KEY")
agent = Agent(
"openai:gpt-4o",
deps_type=SuprfloDeps,
tools=memory_tools(),
)
result = await agent.run(
"What do you know about my hobbies?",
deps=SuprfloDeps(client=client, user_id="alice", top_k=5),
)Because the subject arrives through deps rather than a closure, one agent definition serves every user — pass different SuprfloDeps per run.
Tools only
Pydantic AI has no memory or history-store plugin contract to implement — tools plus deps are its real extension points, and that is the whole integration surface. There's deliberately no SuprfloMemory class here; there'd be nothing for it to plug into.
If
pydantic-aiisn't installed, importing this module raises a clearImportErrortelling you topip install "suprflo[pydantic-ai]".