MILabs
Tools

Pydantic AI for business agents, tools and workflows

Pydantic AI is an open-source Python framework for building AI agents. Here is what businesses use it for and how MILabs sets it up.

Updated 2026-10-09

What Pydantic AI is

Pydantic AI is an open-source framework for building AI agents in Python, the programs that pair a language model with instructions and outside tools. It was created by the team behind Pydantic, a data validation library that many Python projects already rely on. Within the framework, a developer declares an agent's model, its instructions, the tools it may call and the structure its answer must take. Results are checked against Python types, so the software receives data in a predictable shape rather than loose text. Several model providers are supported, which lets a team switch models without rewriting the code around them. Pydantic AI also offers dependency injection, a way to hand resources such as database connections to an agent run, and it can connect to external tool servers through the Model Context Protocol. Because it is a library, the agent lives inside your own application, and the team that runs that application decides how data moves through it.

Pydantic: official site

Pydantic AI in plain language

On its own, a language model answers one message at a time and knows nothing about the business. An agent adds structure around that model: a set of instructions, a list of actions it is allowed to take and an expected shape for its reply. When the model judges that an action would help, the agent runs a function such as fetching a customer record or checking stock, takes in the result and continues. That cycle is what turns a model into an agent.

Building that cycle by hand means rewriting the same plumbing. Each provider returns data in its own format, errors surface in different places, and a reply that looks correct can still lack a field the next system needs. A framework handles these details so the team can focus on purpose.

Pydantic AI treats an agent's output as a typed value. Before a result leaves the agent, it is checked against the declared structure, and a failed check can prompt the model to try again. Tool arguments get the same treatment. For a business, this means fewer silent format errors reaching the CRM or job board, and a clear trail of what each step received and returned.

What businesses use it for

  • Drafting replies to enquiries that a staff member reviews before anything is sent
  • Searching the firm's own policies and price lists to answer staff questions
  • Turning emails and web forms into structured records for the CRM or job system
  • Checking incoming quote requests against set rules before anyone responds
  • Flagging overdue invoices and expiring licences on a scheduled run

Who it suits

  • Owners of professional services firms who want consistent answers to enquiries and documents
  • Teams with an in-house developer or IT contact who will look after the code
  • Businesses that want an agent acting on their own systems rather than only chatting

How MILabs sets it up

Setup starts with a conversation between MILabs and the owner or team lead about the work the agent should take on, the systems it must reach and the decisions it should never make alone. We agree the model provider and plan together. We then connect the tools the business already runs, such as its inbox, CRM or document store, using the access those systems offer. Permissions limit the agent to reading what it needs and writing to the fields it should change. Before launch, we agree who maintains the code, who reviews outputs and who receives an alert when a run fails. The owner stays in charge throughout. MILabs is based in Sydney and delivers this work remotely for businesses elsewhere.

Builds it fits

Industries it fits

Pydantic AI in practice

In a typical setup, the agent sits between a channel the business already uses and the systems that hold its records. A message arrives through a web form or inbox, and the agent reads it next to the matching customer details. It then returns a structured summary with a suggested reply. Because the summary has fixed fields, the next step, whether a CRM update or a task in a job system, can be built against a known layout instead of free text.

Most of the design work goes into the boundaries. The team decides which tools the agent may call, which fields it may write and which actions wait for a person. A quote might be drafted automatically while an estimator confirms the price. Logs record each tool call and each validation failure, so a staff member who questions a result can trace how it was produced.

The working version changes over time. Early builds handle one narrow intake path, and later versions add a second source or check once the team has confidence in the first. Prompts and tool descriptions are refined as real messages expose gaps, and the code sits in version control so every change can be reviewed.

good questions, straight answers

Frequently asked questions

What is Pydantic AI?
Pydantic AI is a Python framework for building agents, the programs that pair a language model with instructions and the tools it can call. It was built by the team behind Pydantic, and it uses Python type definitions to shape what an agent returns. Businesses reach for it when a chat window is too narrow and the AI must read from or write to their own software.
Can I self-host Pydantic AI?
Yes. Because Pydantic AI is a library, it runs inside the application you deploy, on servers you manage. Requests to a model still travel to the provider you connect, and that provider's terms govern them. If you want the model itself running on your own hardware, that is a separate decision about the model and its hosting, and MILabs can walk through the options during setup.
How does Pydantic AI compare with other tools for the same job?
Pydantic AI is a framework for writing agent code, which suits a team that wants to control the logic in Python. Platforms such as Zapier, Make and n8n let a business assemble automations with less code. LangGraph and CrewAI also organise multi-step agent work, so the right pick depends on how much a team wants to write itself. MILabs weighs these options against the business's systems and skills before recommending one.
How do I get my team to use Pydantic AI?
Staff use the finished tool built on Pydantic AI rather than the library itself. A useful start is choosing one task the team repeats, and letting the agent prepare a draft for a person to check. Staff come to trust the tool when they can see where an answer came from and know how to flag a mistake. MILabs builds that review step in and includes a short written guide at handover.
Which builds work well with Pydantic AI?
Builds that read documents, answer enquiries or sort incoming messages suit Pydantic AI well, because typed output keeps each result in a predictable shape. Good examples include a lead intake assistant, a document question answering service on a private server, and an email triage automation. Builds that move money or change client records are designed around clear approval points, which MILabs agrees with the owner during setup.
let's make something happen

Workflow automation: how we can help

Choose how you want to work on this with MILabs. Both options start with an enquiry.

Discovery is free, no obligation from the first chat.

Let us build it for you

We build it and look after it.

Build it yourself, we'll help

You build it with our direction, teaching and a weekly check-in.