Skip to main content

Agent Utilities for Pydantic AI Agents

Project description

Agent Utilities - Pydantic AI Utilities

PyPI - Version MCP Server PyPI - Downloads GitHub Repo stars GitHub forks GitHub contributors PyPI - License GitHub

GitHub last commit (by committer) GitHub pull requests GitHub closed pull requests GitHub issues

GitHub top language GitHub language count GitHub repo size GitHub repo file count (file type) PyPI - Wheel PyPI - Implementation

Version: 0.2.33

Overview

Agent Utilities provides a robust foundation for building production-ready Pydantic AI Agents. It simplifies agent creation, adds multi-agent supervisor patterns, and provides essential "operating system" tools for agents, including workspace management, scheduling, and discovery.

Key Features

  • Agent Creation: Streamlined create_agent function that handles MCP servers, skills, and model configuration automatically.
  • Graph Orchestration: Robust pydantic-graph based create_graph_agent_server mapping tools to generic domain nodes to isolate context and prevent hallucination.
  • Multi-Agent Support: Native support for the supervisor pattern, allowing complex tasks to be delegated to specialized child agents.
  • Agent Server: Built-in FastAPI server (create_agent_server and create_graph_agent_server) with SSE support for easy integration into web UIs and A2A networks.
  • Elicitation Support: Built-in flow for handling structured user input requests from MCP servers, seamlessly integrated with the Web UI.
  • Workspace Management: Automated management of agent state through standard markdown files (IDENTITY.md, MEMORY.md, USER.md).
  • A2A Integration: Seamless discovery and communication between agents in a distributed network.
  • Periodic Scheduler: In-memory task scheduler for running background agent jobs.
  • Lightweight & Lazy: Core utilities are lightweight. Heavy dependencies like FastAPI or LlamaIndex are lazy-loaded only when requested via optional extras.

General Graph Architecture

agent-utilities implements a standardized graph structure via pydantic-graph to build context-efficient specialized agents.

graph TD
  User([User Query]) --> RouterNode
  RouterNode -- "Classifies into matching domain" --> DomainNode
  RouterNode -- "Fails/Low Confidence" --> EndNode([End with Error])

  subgraph Generic Domain Architecture
      DomainNode -- "Applies OS Env Var Gates" --> ContextIsolation
      ContextIsolation -- "Launches localized agent" --> DomainTools[Restricted Tool Context]
  end
  DomainTools --> EndNode2([End with Result])

Installation

# Core utilities only
pip install agent-utilities

# With full agent support (recommended)
pip install agent-utilities[agent]

# With MCP server support
pip install agent-utilities[mcp]

# With embedding/vector support
pip install agent-utilities[embeddings]

Quick Start

from agent_utilities import create_agent

# Create a simple agent with workspace tools
agent = create_agent(name="MyAgent")

# Or create a multi-agent supervisor
agent = create_agent(
    name="Supervisor",
    agent_definitions=[{"name": "Researcher", "description": "Search the web"}]
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_utilities-0.2.33.tar.gz (62.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_utilities-0.2.33-py3-none-any.whl (65.8 kB view details)

Uploaded Python 3

File details

Details for the file agent_utilities-0.2.33.tar.gz.

File metadata

  • Download URL: agent_utilities-0.2.33.tar.gz
  • Upload date:
  • Size: 62.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agent_utilities-0.2.33.tar.gz
Algorithm Hash digest
SHA256 9323a4b07ed5fecc6cc171a9082c3afafc3494eadebca85a8dda2fda04f0eff4
MD5 1b7b7179a35485a87e79e07312c89775
BLAKE2b-256 6e03790063b39e2643ed14efae5ccbffce36744d0a92d03aa6acb866a367884d

See more details on using hashes here.

File details

Details for the file agent_utilities-0.2.33-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_utilities-0.2.33-py3-none-any.whl
Algorithm Hash digest
SHA256 b32913f7b9c2a75bc6c6a0bafde17826d83032dc61c7c7709a45526971ad9058
MD5 81f9dda79b156949b353fbdd6e75ba49
BLAKE2b-256 452c015e0a939817a920acc797ac2cfc9ff9e1e19aa3b2f97c6ea14192c780f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page