flowgentic.agent¶
agent
¶
Framework-neutral agent components executed through AsyncFlow.
This module provides the inverse of an AsyncFlow-backed agent tool: it makes an agent-framework component callable as an AsyncFlow task. Applications can keep their orchestration and scientific state in ordinary Python and AsyncFlow while using LangGraph, CrewAI, Academy, or another framework only inside agents.
Each call of a bound agent is an OpenTelemetry invoke_agent span in the
caller's process, with the AsyncFlow task that ran it as a child.
Classes:
| Name | Description |
|---|---|
ModelDumpable |
Structured object exposing the Pydantic-compatible dump operation. |
AgentComponent |
Minimal interface implemented by an agent-framework component. |
AgentTask |
An addressable agent component placed on an AsyncFlow backend. |
Functions:
| Name | Description |
|---|---|
bind_agent |
Bind one framework-specific agent component to an AsyncFlow task. |
ModelDumpable
¶
Bases: Protocol
Structured object exposing the Pydantic-compatible dump operation.
Methods:
| Name | Description |
|---|---|
model_dump |
Return the structured decision as a plain mapping. |
AgentComponent
¶
AgentTask
dataclass
¶
bind_agent
¶
bind_agent(
flow: WorkflowEngine,
component: AgentComponent,
*,
identity: str,
framework: str,
backend: str = "ai",
) -> AgentTask
Bind one framework-specific agent component to an AsyncFlow task.
The surrounding application sees a stable, framework-neutral AgentTask.
The component remains free to use a LangGraph graph, CrewAI crew, Academy
actor, direct LLM call, or scripted rehearsal implementation internally.