# Agent framework integrations

**Any Python-based agent framework works with Union.ai.** Union.ai doesn't replace your framework — it provides the production layer around it. You write your agent with whatever framework you prefer, then invoke it from inside an `@env.task`, where it runs in a container with durable checkpointing and full observability. Each LLM call, tool call, and routing decision can be captured as a span in the Union.ai dashboard.

Because the framework drives the loop and Union.ai wraps it, you don't need a dedicated plugin for a framework to use it — if it runs in Python, it runs on Union.ai.

> **📝 Note**
>
> The `flyte` SDK provides a [native agent harness](https://www.union.ai/docs/v2/union/user-guide/build-agent/flyte-agents/page.md) that you can use to build your own agent loop.

## How much control does the framework give you?

Frameworks differ in how much of the agent loop they own, which determines how you integrate them with Union.ai:

| Level of control | What it means | Example | Integration pattern |
|------------------|---------------|---------|---------------------|
| **You own the loop** | The framework gives you primitives (graph nodes, tools) and you wire the control flow | [LangGraph](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/langgraph/page.md) | Decorate nodes with `@flyte.trace`; run the compiled graph inside a task |
| **The framework owns the loop, you own the tools** | The framework runs the tool-calling loop; you provide tools as plain functions | [PydanticAI](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/pydantic-ai/page.md) | Have tools delegate to durable `@env.task`s |
| **First-party tool adapter** | Union.ai ships a decorator that turns a task into a framework tool | [OpenAI Agents SDK](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/openai-agents-sdk/page.md) | Stack `function_tool` on `@env.task` |

Whichever model your framework uses, the integration is the same in spirit: the framework decides *what* the agent does next, and Union.ai decides *where and how durably* each step runs.

## Supported frameworks

- [**LangGraph**](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/langgraph/page.md) — run compiled graphs inside tasks and fan them out in parallel.
- [**PydanticAI**](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/pydantic-ai/page.md) — type-safe agents whose tools delegate to durable tasks.
- [**OpenAI Agents SDK**](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/openai-agents-sdk/page.md) — expose durable tasks as Agents SDK tools with `flyteplugins-openai`.

Don't see your framework? The same pattern — invoke the framework from inside an `@env.task` and trace its calls — applies to any Python agent library. See [Bring your own framework](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/bring-your-own-framework/page.md) for a framework-agnostic template.

## Next steps

- [Deploy an agent as a service](https://www.union.ai/docs/v2/union/user-guide/build-agent/deploy-agent-as-service/page.md): run your agent on a schedule or behind a webhook.
- [Build an agent with pure Python](https://www.union.ai/docs/v2/union/user-guide/build-agent/python-agents/page.md): roll the loop yourself with no framework at all.
- [The Flyte Agent harness](https://www.union.ai/docs/v2/union/user-guide/build-agent/flyte-agents/page.md): the built-in, batteries-included agent loop.

## Subpages

- [LangGraph agents](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/langgraph/page.md)
  - A single LangGraph agent in a task
  - Plan-and-Execute: fan out LangGraph agents in parallel
  - Next steps
- [PydanticAI agents](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/pydantic-ai/page.md)
  - A PydanticAI agent in a task
  - Parallel agents
  - Next steps
- [OpenAI agents](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/openai-agents-sdk/page.md)
  - Tools that are also durable tasks
  - Next steps
- [Bring your own framework](https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/bring-your-own-framework/page.md)
  - The core pattern
  - Make tools durable
  - Trace the framework's internals
  - Fan out across containers
  - Checklist
  - Next steps

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/user-guide/agent-framework-integrations/_index.md
**HTML**: https://www.union.ai/docs/v2/union/user-guide/agent-framework-integrations/
