Skip to content

Pydantic AI vs Pi

Pi is a TypeScript coding agent from Earendil Works: a terminal agent you extend with hooks, skills and packages, or embed through createAgentSession. In Pydantic AI, a coding agent is one configuration of a general Agent, and the skills, sandbox and sub-agents are each a capability you can swap.

Pydantic AI is one part of a stack: the Harness SDK for capabilities and complete agents, Pax to run any of your agents in a coding terminal, Pydantic Evals for evaluation, Pydantic Graph for graph-based workflows, Pydantic Logfire for observability, and Pydantic itself for validation. The tables below cover the whole of it.

Already built on Pi? The migrating-pi-to-pydantic-ai skill ports an existing application to Pydantic AI one working path at a time, preserving behavior rather than translating API names.

Framework

PiPydantic AI and Harness SDK
LanguageTypeScriptPython
LicenseMITMIT
Model providersManyMany
ExtensibilityExtensions, skills, pi installCapabilities and toolsets; 100+ with the Harness SDK
HarnessesPi itself; extend it or embed itBuilt-in Coder and Researcher, or compose your own
ObservabilityTelemetry contract, no exporterOpenTelemetry, including Pydantic Logfire
Enterprise supportNone documentedFor the framework itself, no platform required
Durable executionNoNine integrations
InterfacesCLIPax coding terminal (pax --agent runs yours), legacy CLI (clai), web chat, AG-UI, Vercel AI, ACP (experimental), GitHub Agentic Workflows
Realtime voiceNoRealtime
EvalsNoPydantic Evals
Image generationNoImage Generation

Features

PiPydantic AI and Harness SDK
Multi-agentNoSubagents, delegation, or pydantic-graph
PlanningNoPlanning
SkillsYesSkills
MemoryNoMemory
CompactionYesCompaction
GuardrailsYes (tool_call hook)Guardrails
Code sandboxesNoYour machine, SSH and 11 sandboxes, with per-path authority
Browser useNoWeb & research, and computer use on a desktop in 11 sandboxes

FAQ

Can I build a coding agent like this in Python? Yes. Give your agent the Coder() capability, or start from the harness repository’s complete coding agent, built from the pieces Coder puts together.

Is there a terminal coding agent like Pi in Python? Yes: Pax. It runs Coder by default, pax --agent runs your own agent, and a Pax plugin can be any Pydantic AI capability, so the same class serves your terminal and your production agent.

Can I control which content my agent treats as instructions? Yes. What a capability tells the model mid-conversation is a typed part that records who wrote it (you, your user, or nobody you trust), and Pydantic AI speaks it in the voice that authority allows; what a capability enqueues can be lowered, never raised, as it moves through a run. Tool results and fetched pages stay data on every provider, and text that imitates the framework’s own frames is flagged to the model. A workspace’s files carry your authority unless you mark them untrusted, path by path. See Where the content came from for the source and authority table, Capability parts for how they are stored, and Marking who wrote the files.

Last checked: 2026-09-26

Sources