a2a - #17
Conversation
Haven't looked at any of the code here yet but this sounds like it would be a perfect use-case for Wormhole. |
bgunnar5
left a comment
There was a problem hiding this comment.
Nice work, this will definitely help to expand MADA outreach and usability in the future. In addition to the comments I left, here are some additional requests:
- Add documentation on the
mada-a2acommand. - Can we group a2a examples in a subfolder under
examples/? - If we don't implement the
A2AAgentfrom Microsoft Agent Framework, then we should add tests for the new a2a_client.py file.
@Mamorri there may be some modifications you need to add to your magentic implementation to support A2A.
Don't need you to do this but I'm putting this here to remind myself to create a bunch of tutorials for MADA. We should definitely use the example scripts you put together for a full A2A tutorial. It would also be a good idea to have a tutorial for starting URSA and connecting it via A2A with MADA. This could lead to a concrete agent card for MADA x URSA collaboration that we could keep in our repo as well.
| """ | ||
| Agent-to-Agent HTTP interface for MADA Orchestrator. | ||
|
|
||
| This module exposes the configured MADA planning agent as an A2A-compatible | ||
| JSON-RPC service. The MADA agent card is available under the standard | ||
| `/.well-known/agent-card.json` path. | ||
|
|
||
| This is the server-side A2A entry point: use it when another A2A client or | ||
| agent needs to discover MADA and send work to MADA. The client-side support | ||
| for MADA calling other A2A agents lives in `mada.core.a2a_client` and is wired | ||
| through the `a2a_agents` configuration block. | ||
| """ |
There was a problem hiding this comment.
so this is only starting the planning agent as an A2A-compatible service? Would it make more sense to do something like mada-a2a config.json and then every agent defined in the config file is started as an A2A-compatible service?
There was a problem hiding this comment.
This should start the orchestrator which then has access to all the other agents listed in the config, including mcp tools. So its a central entry point for mada. Up to you, what do you prefer?
await orchestrator.initialize_orchestrator(
self.config.agents,
self.config.mcp_servers,
getattr(self.config, "a2a_agents", {}),
)There was a problem hiding this comment.
This is probably fine for now. Just not sure how this will behave with @Mamorri's orchestration updates, specifically for sequential which likely won't need a planning agent.
There was a problem hiding this comment.
I went ahead and merged these changes into my branch, not too many conflicts directly. Functionality wise, there may be some overlap. It looks like for magentic there was a small breakage just in how the new arguments were set up, but it should be a fairly small adjustment. However, once restored A2A should complement the dynamic orchestration functionality.
For sequential, if remote A2A agents are only implemented as planner tools, sequential would need its own way to include them as steps. My best thought here would be a “participant/callable agent” interface that local specialists and remote A2A agents both implement. Then agent-as-tool, magentic, and sequential could each decide how to use the same pool.
For now I think it should be fine.
|
@jmoreno45 I think I missed that on the first review, that's fine. |
bgunnar5
left a comment
There was a problem hiding this comment.
This LG2M but I'd like to hear Michael's thoughts on some of my comments that I tagged him in.
| card = self._a2a_agent_cards.get(agent_name, {}) | ||
| description = self._remote_a2a_description( | ||
| card["description"], | ||
| card, |
There was a problem hiding this comment.
After merging my changes it looks like this presented a potential issue:
remote A2A cards are indexed withcard["description"]. If a remote card omits description or serializes differently, orchestrator initialization fails with KeyError. I think agent_as_tool_strategy.py and other orchestration strategies would require a method to parse the remote description:
description = orchestrator._remote_a2a_base_description(agent_name, card)
labels.append(f"A2A: {agent_name} - {description}")
I can go ahead and add this to my commits, if it makes more sense than fixing in this merge
There was a problem hiding this comment.
Yes, please add it to your commits.
Adds A2A capability with some example agents.
Can also be exposed as an A2A agent
Run MADA in A2A mode on the same port advertised in the card:
mada-a2a --port 9120 /g/g20/moreno45/Projects/GITHUB-MADA/mada/configs/example_a2a_agents.jsonOther A2A agents can discover it at:
http://localhost:9120/.well-known/agent-card.jsonIf another machine/agent needs to reach it, use
--public-urlwith the externally reachable URL:mada-a2a --port 9120 --public-url http://hostname:9120/ /g/g20/moreno45/Projects/GITHUB-MADA/mada/configs/example_a2a_agents.jsonCLI
Gradio