# Building Agents With Heroku AI and Pydantic AI

DevFeed: [Building Agents With Heroku AI and Pydantic AI](<https://devfeed.tech/articles/building-agents-with-heroku-ai-and-pydantic-ai-26380.md>)

Original publisher: [Read original article](<https://www.heroku.com/blog/building-agents-with-heroku-ai-and-pydantic-ai/>)

Author: Anush DSouza

Published: 2025-08-08T16:33:37Z

Content type: article

Language: en

Sources: [Heroku](<https://devfeed.tech/sources/heroku.md>)

Topics: [Heroku AI](<https://devfeed.tech/topics/heroku-ai.md>), [Managed Inference and Agents](<https://devfeed.tech/topics/managed-inference-and-agents.md>), [Microsoft Agent Framework](<https://devfeed.tech/topics/microsoft-agent-framework.md>), [agentic workflows](<https://devfeed.tech/topics/agentic-workflows.md>)

Tags: [a2a](<https://devfeed.tech/tags/a2a.md>), [a2a-protocol](<https://devfeed.tech/tags/a2a-protocol.md>), [advanced-ai-capabilities](<https://devfeed.tech/tags/advanced-ai-capabilities.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agent-framework](<https://devfeed.tech/tags/agent-framework.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-applications](<https://devfeed.tech/tags/ai-applications.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [applications](<https://devfeed.tech/tags/applications.md>), [claude](<https://devfeed.tech/tags/claude.md>), [heroku](<https://devfeed.tech/tags/heroku.md>), [heroku-ai](<https://devfeed.tech/tags/heroku-ai.md>), [inference](<https://devfeed.tech/tags/inference.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [large-language-models](<https://devfeed.tech/tags/large-language-models.md>), [managed-inference-and-agents](<https://devfeed.tech/tags/managed-inference-and-agents.md>), [mcp-on-heroku](<https://devfeed.tech/tags/mcp-on-heroku.md>), [news](<https://devfeed.tech/tags/news.md>), [product-features](<https://devfeed.tech/tags/product-features.md>), [production](<https://devfeed.tech/tags/production.md>), [pydantic](<https://devfeed.tech/tags/pydantic.md>), [pydantic-ai](<https://devfeed.tech/tags/pydantic-ai.md>)

## AI overview

The excerpt describes combining Heroku Managed Inference and Agents with Pydantic AI to build Python agents. Heroku provides model access, including Claude 4 Sonnet, built-in tools such as secure code execution, and an OpenAI-compatible API. The integration uses environment variables for the API key and base URL, which Pydantic AI reads automatically; the specific variable names and code are missing from the excerpt. Pydantic AI agents can connect to MCP servers as clients or be exposed as MCP servers themselves. They can also be exposed as A2A servers using the FastA2A library. The excerpt presents these protocol integrations as a way to support modular agent workflows, but does not provide implementation details or evaluate production tradeoffs.

## Source excerpt

Building production-grade AI applications can be complex, but with Heroku and Pydantic AI, developers gain a powerful and reliable solution for integrating advanced AI capabilities. Heroku makes it easy to integrate AI into your applications with Heroku Managed Inference and Agents. With a single click, you can attach powerful Large Language Models like Anthropic's Claude [...] The post Building Agents With Heroku AI and Pydantic AI appeared first on Heroku.