pydantic_ai.Agent you have already written and serve it as an A2A-compatible server without modifying your agent code. The PydanticAIAgentExecutor handles tool injection, model configuration, and request routing so you can focus on agent logic rather than infrastructure.
Installation
Quick example
Define your pydantic-ai agent in a regular Python module and pointflokoa run at it. The executor discovers and wraps the agent object automatically.
my_agent.py
http://localhost:8080 and is ready to accept A2A requests immediately.
PydanticAIAgentExecutor
flokoa.integrations.pydantic_ai.agent_executor.PydanticAIAgentExecutor wraps a pydantic_ai.Agent and implements the A2A AgentExecutor interface. You rarely need to instantiate it directly — flokoa run does that for you — but understanding what it provides helps you design agents that work well with the operator.
- Automatic tool injection — Tools defined as
AgentToolCRDs are mounted at/etc/flokoa/tools/inside the container and loaded automatically on each request. - TTL-based caching — Tool definitions and model configuration are cached (default: 60 seconds) to avoid re-reading the filesystem on every request. Control the TTL with the
FLOKOA_CACHE_TTL_SECONDSenvironment variable. - Change detection — The executor compares file modification times before deciding whether to rebuild the
FunctionToolset. If nothing changed, the cached toolset is reused at zero cost. - Explicit cache invalidation — Call
executor.invalidate_caches()to force a full reload on the next request.
Automatic tool injection
When your agent runs inside Kubernetes, the Flokoa operator mounts tool configurations fromAgentTool CRDs as files at /etc/flokoa/tools/. The executor reads those files at request time and builds a FunctionToolset from them — you do not list tools in your agent code at all.
Tool injection is only active when the operator mounts the tool files. During local development with
flokoa run, no files are mounted, so the agent runs with only the tools you define directly on the Agent object.mtime), or when the cache TTL expires. This means the operator can update an AgentTool CRD and the running agent will pick up the new tool without a pod restart.
OpenAPI tools
The pydantic-ai integration supports theopenapi tool type. When the operator mounts an OpenAPI tool definition, the executor creates an OpenAPIToolset from the spec and adds its tools to the FunctionToolset used for that request.
AgentTool CRD and the executor handles the rest.
Model configuration
When an Agent CR references a Model CR, the operator writes the model configuration to the container at runtime. The executor reads that configuration and constructs the appropriate pydantic-aiModel and Provider objects before each request, so the agent always uses the operator-specified model without any code changes.
Agent object itself, the executor raises a ProviderNotConfiguredError before attempting to run the agent.
Running in Kubernetes
Build a container image with your agent andflokoa[pydantic-ai] installed, then declare an Agent CR with framework: pydantic-ai. The operator handles everything else.
