ContextGuides

Pydantic AI

A toolset that grows as skills load, rebuilt from the message history every step.

Python only. In TypeScript, see the Vercel AI SDK guide.

skills = context.load_skills("../quickstart/skills", tools=[lookup_order, issue_refund, search_docs])
prompt = "My order A-1001 arrived damaged."

agent = Agent(FunctionModel(respond), toolsets=[with_skills(skills)])
result = await agent.run(prompt)

with_skills(skills) returns a toolset that offers load_skill plus the currently bound tools on every step and contributes Context's instructions. The session is rebuilt from the run's messages each step, so Pydantic AI's own message history is all the state there is. Pass state_from to read code or router loads from your deps. Tool calls in that history are never replayed, so a tool_called trigger fires only inside the call that triggered it and is not offered on later steps; use input triggers or code loads with this adapter.