migrating-agno-to-pydantic-ai
Skill144 starsChanged 31 days agoMITView on GitHub
Migrate Python Agno applications to Pydantic AI and, only when needed, Pydantic AI Harness. Use when source code imports `agno` or relies on Agno agents, teams, workflows, sessions, memory, knowledge, tools, hooks, guardrails, approvals, skills, streaming, or AgentOS.
1 other project uses a version of this.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- pydantic/pydantic-aiword for word, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 1
- pydantic/pydantic-ai★ 21k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- building-pydantic-ai-agentsSkill
- migrating-agno-to-pydantic-aiSkill
- migrating-claude-agent-sdk-to-pydantic-aiSkill
- migrating-google-adk-to-pydantic-aiSkill
- migrating-langchain-to-pydantic-aiSkill
- migrating-mastra-to-pydantic-aiSkill
- migrating-openai-agents-sdk-to-pydantic-aiSkill
- migrating-pi-to-pydantic-aiSkill
- migrating-vercel-ai-sdk-and-eve-to-pydantic-aiSkill
- logfire-codex-connectionSkill
- logfire-coding-agentsSkill
- logfire-evalsSkill
- logfire-frontendSkill
- logfire-gatewaySkill
- logfire-infrastructureSkill
- logfire-instrumentationSkill
- logfire-querySkill
- logfire-setupSkill
- logfire-uiSkill
- migrating-deep-agents-to-pydantic-ai-harnessSkill
- pydantic-ai-harnessSkill
- pydanticSkill
- building-pydantic-ai-agentsSkill
- logfire-coding-agentsSkill
- logfire-evalsSkill
- logfire-frontendSkill
- logfire-gatewaySkill
- logfire-infrastructureSkill
- logfire-instrumentationSkill
- logfire-querySkill
- logfire-setupSkill
- logfire-uiSkill
- migrating-claude-agent-sdk-to-pydantic-aiSkill
- migrating-deep-agents-to-pydantic-ai-harnessSkill
- migrating-google-adk-to-pydantic-aiSkill
- migrating-langchain-to-pydantic-aiSkill
- migrating-mastra-to-pydantic-aiSkill
- migrating-openai-agents-sdk-to-pydantic-aiSkill
- migrating-pi-to-pydantic-aiSkill
- migrating-vercel-ai-sdk-and-eve-to-pydantic-aiSkill
- pydantic-ai-harnessSkill
- pydanticSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Read repository instructions, dependencies, tests, and the runtime entrypoint.
- Distinctive: line 22
Read Research and concept mapping for the detected features.
- Very specific: line 26
Core: use pydantic_ai.Agent for the agent loop, typed dependencies, tools, outputs, normalized messages, generic hooks, streaming, MCP …
- Very specific: line 27
Graph: use pydantic_graph only when explicit typed nodes, branches, and joins remain useful.
- Very specific: line 28
Harness: add pydantic-ai-harness only for observed reusable policy such as memory notebooks, planning, model-directed subagents, Agent …
- Very specific: line 29
Evals: add the separate pydantic-evals package for observed datasets and evaluators.
- Very specific: line 40
Keep Agno Workflow steps, conditions, routers, loops, and parallel joins deterministic.
- Very specific: line 51
Start core-only. Add pydantic_graph, Harness, Evals, or a durable runtime only after a source contract requires it.
- Distinctive: line 52
Test inputs, typed outputs, errors, event order, tool arguments/results, hook decisions, state across turns, and side effects at that …
- Very specific: line 54
Remove agno, AgentOS setup, and Agno storage or event adapters only after no retained path needs them.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migrate Agno to Pydantic AI
Preserve observable behavior, not Agno's object model. Migrate the smallest complete caller path and keep application infrastructure in place.
Trace the source before choosing a target
- Read repository instructions, dependencies, tests, and the runtime entrypoint. Record the installed Agno, Pydantic AI, and Harness versions.
- Trace one real request from
Agent.run()/arun(),Team.run()/arun(), aWorkflow, or an AgentOS endpoint through instructions, model and tool calls, hooks, session loading, memory or knowledge retrieval, events, results, state, and side effects. Establish a focused baseline or characterization test. - Separate these source contracts when present:
- trusted dependencies, model-chosen tool input, session state, and workflow state;
- conversation history, session summaries, user memories, knowledge retrieval, workflow checkpoints, and model-owned plans;
- final content, structured output, token deltas, run events, pauses, and terminal status;
- confirmation, user input, external tool execution, authenticated authorization, and process isolation;
- team delegation, deterministic workflow control, AgentOS transport, queues, and deployment.
- Record each observed contract, its owner, semantic difference, and executable proof. An unused Agno feature is not migration scope.
Read Research and concept mapping for the detected features. Read Verification and cutover before implementation.
Choose the smallest target
- Core: use
pydantic_ai.Agentfor the agent loop, typed dependencies, tools, outputs, normalized messages, generic hooks, streaming, MCP clients, approvals, usage limits, instrumentation, realtime, and durable-runtime integrations. - Graph: use
pydantic_graphonly when explicit typed nodes, branches, and joins remain useful; use plain async Python for simple fixed control flow. - Harness: add
pydantic-ai-harnessonly for observed reusable policy such as memory notebooks, planning, model-directed subagents, Agent Skills, coding tools, guardrails, model-agnostic compaction, or step persistence. Harness capabilities compose through the core agent loop; Harness is not a second runtime. - Evals: add the separate
pydantic-evalspackage for observed datasets and evaluators. - Application: retain authentication, databases, vector search, queues, AgentOS/API routes, storage schemas, deployment, product state, and UI transports unless the requested slice includes them.
- Gap: name behavior that no supported public seam preserves, explain its impact, and test a bounded adapter. Do not rebuild Agno's registry, database abstraction, event taxonomy, or AgentOS merely to hide a difference.
The normal migration is one reusable Agent, application services supplied through typed dependencies, typed tools and output, and application-owned storage of serialized result.all_messages() for later turns. Preserve an existing HTTP, job, or UI boundary with a small adapter and its current field names.
Apply high-risk gates
- Agno
dependencies,user_id,session_id, and authenticated identity are trusted runtime context, not model arguments. Put them in typed dependencies and authorize storage or effects in application code. - Agno sessions combine distinct owners. Map chat history to serialized Pydantic AI messages; keep mutable product/session state in an application store; treat summaries, user memories, knowledge retrieval, workflow checkpoints, and Harness
Memoryas separate contracts. Choose and test record conversion, a read-through adapter, or starting fresh as an accepted change. - Inspect a
Team's actual delegation mode and caller-visible member events. Use HarnessSubAgentsonly for model-directed, isolated task delegation. Keep routing, broadcast, deterministic fan-out, shared-context collaboration, aggregation, and retries in application or graph code unless parity is proved. - Keep Agno
Workflowsteps, conditions, routers, loops, and parallel joins deterministic. Do not move them into an agent prompt. Graph state alone is not a persisted checkpoint. - Agno pauses for confirmation, user input, and external execution have different payloads and owners. Core deferred tools can preserve pending model tool calls; the application still owns identity, authorization, UI, audit, persistence, correlation, and idempotency. Prove restart when the source pause survives one.
- Map pre/post hooks, tool hooks, and guardrails by firing point, mutation, short-circuit behavior, ordering, retries, streaming visibility, and persistence. Similar hook names do not prove lifecycle parity.
- Map consumer intent for streaming. Pydantic AI output streaming, run-event streaming, capability events, UI adapters, and graph iteration are different surfaces; none promises Agno's run-event taxonomy or resume cursor.
- Agno Skills can expose instructions, references, and scripts. Harness
SkillsloadsSKILL.mdinstructions on demand but does not load bundled resources or execute scripts; add explicitFileSystem,Shell, or application tools only for observed, trusted behavior. - AgentOS routes, auth, session APIs, telemetry, control plane, database selection, and deployment are product infrastructure. Keep or replace each deliberately rather than treating an agent port as an AgentOS port.
- Tool allowlists, path checks, and guardrails are policy, not OS isolation. Use a container, VM, or cloud sandbox when untrusted execution is in scope.
Implement and prove one vertical slice
- Preserve the supported caller boundary and replace only agent-owned internals.
- Start core-only. Add
pydantic_graph, Harness, Evals, or a durable runtime only after a source contract requires it. - Test inputs, typed outputs, errors, event order, tool arguments/results, hook decisions, state across turns, and side effects at that boundary. Use deterministic models and fake application services offline; add a focused recorded or live test only when provider behavior is the contract.
- For persistence, pauses, concurrent workflows, or external effects, test interruption and restart, lineage, authorization, failure aggregation, and idempotency at the exact boundary Agno promised.
- Remove
agno, AgentOS setup, and Agno storage or event adapters only after no retained path needs them.
Explain any consequential semantic change before implementing it: state the source behavior, target behavior, caller impact, recommended choice, and remaining risk.
Completion
Apply the completion criterion in Verification and cutover. Label evidence from fakes, recordings, live providers, and operational tests accurately.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

