factorio-learning-environment icon indicating copy to clipboard operation
factorio-learning-environment copied to clipboard

Support A2A protocol

Open kantneel opened this issue 7 months ago • 1 comments

The A2A protocol (https://github.com/google/A2A) is the emerging standard for agent-to-agent communication. FLE has excellent potential for being a community adoption for multi-agent evals, and so support for A2A specs will help with accessibility and interoperability. This is now implemented for the features that were existing in 0.2.0 in #198 , but the scope could be broadened, specifically for integrating with remote agents, clients and servers. Any thoughts on that would be helpful here.

kantneel avatar May 18 '25 13:05 kantneel

Full utilization of the A2A spec and sdk suggests having each agent run as an individual server as opposed to being merely clients which interface with a central server. This is how some of the more advanced features of the protocol i.e. server-sent events are enabled. An example is given here: https://github.com/google/A2A/blob/main/samples/python/agents/langgraph/main.py

The A2A sdk has classes like DefaultRequestHandler which are meant to be instantiated on an agent server. The suggested pattern is to use an AgentExecutor class which wraps the agent and determines how individual requests received by the server should be handled. The request handler also has its own TaskStore and PushNotifier attributes to facilitate server state and communication with clients.

If we were to fully adopt A2A then TrajectoryRunner would be a client that sends request objects with the conversation and environment response. The agent server's request handler would call the agent's step function inside of its execute() method. It would be a large change, and it's not clear we have a strong reason to go for this right now.

To keep it simple, #198 just starts using some of the a2a sdk classes such as Message and AgentCard, but the agents themselves are clients which communicate with a simple centralized server.

kantneel avatar May 26 '25 08:05 kantneel