> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# A2A Agent as Team Member

> Example demonstrating how to use a remote A2A agent as a Team member.

```python a2a_agent_as_team_member.py theme={null}
"""
Example demonstrating how to use a remote A2A agent as a Team member.

This shows how to include agents from an A2A-compatible server as members
in a local Team, enabling cross-framework agent orchestration.

Prerequisites:
1. Install A2A SDK:
   pip install a2a-sdk

2. Start the A2A server:
   python cookbook/05_agent_os/remote/agno_a2a_server.py

   The server will run on http://localhost:7779

3. Set your OPENAI_API_KEY environment variable
"""

import asyncio

from agno.agent import Agent, RemoteAgent
from agno.models.openai import OpenAIResponses
from agno.team import Team

# ---------------------------------------------------------------------------
# Create Local Member
# ---------------------------------------------------------------------------

local_calculator = Agent(
    name="Calculator",
    role="You perform mathematical calculations and explain the steps.",
    model=OpenAIResponses(id="gpt-5-mini"),
    instructions=["Show your work step by step.", "Be precise with numbers."],
)

# ---------------------------------------------------------------------------
# Create Remote A2A Member
# ---------------------------------------------------------------------------

remote_researcher = RemoteAgent(
    base_url="http://localhost:7779/a2a/agents/researcher-agent-2",
    agent_id="researcher-agent-2",
    protocol="a2a",
    a2a_protocol="rest",
)

# ---------------------------------------------------------------------------
# Create Team with Local + A2A Members
# ---------------------------------------------------------------------------

research_team = Team(
    name="Cross-Framework Research Team",
    model=OpenAIResponses(id="gpt-5-mini"),
    members=[
        local_calculator,
        remote_researcher,
    ],
    instructions=[
        "You lead a cross-framework team.",
        "Delegate math questions to the Calculator.",
        "Delegate research questions to the remote Researcher.",
        "Synthesize responses from all members.",
    ],
    markdown=True,
    show_members_responses=True,
)

# ---------------------------------------------------------------------------
# Run
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    asyncio.run(
        research_team.aprint_response(
            "Research the Pythagorean theorem and calculate 3^2 + 4^2",
            stream=True,
        )
    )
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `a2a_agent_as_team_member.py`, then run:

    ```bash theme={null}
    python a2a_agent_as_team_member.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/remote/07\_a2a\_agent\_as\_team\_member.py](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/remote/07_a2a_agent_as_team_member.py)
