Skip to main content
The transport layer provides the foundation for agent-to-agent communication. Base classes can be extended to create custom transports for different communication protocols.

Import


AgentTransport (Abstract Base Class)

Abstract base class for all agent transport implementations. Defines the contract for agent communication.

Abstract Methods

invoke

Send a request to another agent and wait for response.
Parameters
str
required
Target agent’s identifier.
dict[str, Any]
required
Request payload to send.
float
default:"30.0"
Maximum time to wait for response in seconds.
Returns
Raises
  • TimeoutError: If the agent doesn’t respond within timeout.
  • RuntimeError: If the agent cannot be reached.

LocalTransport

In-process transport that communicates with agents running in the same process via the AgentServer.

Constructor

Parameters

AgentServer
required
The AgentServer instance managing the local agents.

Methods

invoke

Implementation that resolves agents via the server’s registry and executes them locally.

Behavior

  1. Resolve Target: Uses server.registry.resolve(agent_id) to find the target
  2. Route to Transport: If target is a transport, delegates to it
  3. Local Execution: If target is a class, instantiates and executes locally
  4. Queue Processing: Enqueues request and waits for response with timeout

Custom Transport Examples

Redis Transport

WebSocket Transport

gRPC Transport


Integration Examples

Multi-Transport Registry

Transport Selection Strategy

Transport with Retry Logic


Performance Considerations

Connection Pooling

Batching Transport

Custom transports enable you to optimize for specific use cases, integrate with existing infrastructure, and implement advanced communication patterns while maintaining the unified agent interface.