Agent-to-Agent protocol support in adk-fluent — local, remote, and hybrid topologies
# Local: same process, direct call
coordinator.sub_agent(local_agent)
# Remote: separate process, A2A protocol
RemoteAgent(name="helper", url="http://...")
# State bridging: explicit send/receive contract
remote = (
RemoteAgent(name="analyzer", url="http://analyzer:8080")
.sends("document", "preferences") # local → remote
.receives("analysis", "confidence") # remote → local
)
Retry failed A2A calls with exponential backoff. Each attempt waits progressively longer before the next retry.
Stop calling a failing remote agent after N consecutive failures. Automatically resets after a cooldown period.
Time limit for remote agent responses. Raises a timeout error if the remote agent does not reply within the deadline.
Cache remote responses to reduce network calls. Identical requests within the TTL window return the cached result.
from adk_fluent import Agent, RemoteAgent
# A local agent — runs in the same process
local_writer = (
Agent("writer", "gemini-2.5-flash")
.instruct("Write content based on research.")
.isolate()
)
# A remote agent — communicates over A2A protocol
remote_researcher = (
RemoteAgent(name="researcher", url="http://research-service:8080")
.sends("topic")
.receives("findings")
)
# Coordinator mixes local + remote seamlessly
coordinator = (
Agent("coordinator", "gemini-2.5-flash")
.instruct("Coordinate research and writing.")
.sub_agent(local_writer)
.sub_agent(remote_researcher)
.middleware(M.a2a_retry(max=3) | M.a2a_timeout(seconds=30))
)
RemoteAgent(url="http://agent-service:8080")
RemoteAgent.discover(registry_url="http://registry:9090")
RemoteAgent.from_card(card)