> ## 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.

# Remote Agent as Team Member

> Example demonstrating how to use RemoteAgent as a Team member.

```python remote_agent_as_team_member.py theme={null}
"""
Example demonstrating how to use RemoteAgent as a Team member.

This shows how to include agents from another AgentOS server as members
in a local Team, enabling cross-service agent orchestration.

Prerequisites:
1. Start the server:
   python cookbook/05_agent_os/remote/server.py

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

2. 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_summarizer = Agent(
    name="Summarizer",
    role="You synthesize information into clear, concise summaries.",
    model=OpenAIResponses(id="gpt-5-mini"),
)

# ---------------------------------------------------------------------------
# Create Remote Members
# ---------------------------------------------------------------------------

remote_assistant = RemoteAgent(
    base_url="http://localhost:7778",
    agent_id="assistant-agent",
)

remote_researcher = RemoteAgent(
    base_url="http://localhost:7778",
    agent_id="researcher-agent",
)

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

hybrid_team = Team(
    name="Hybrid Research Team",
    model=OpenAIResponses(id="gpt-5-mini"),
    members=[
        local_summarizer,
        remote_assistant,
        remote_researcher,
    ],
    instructions=[
        "You lead a hybrid team with local and remote agents.",
        "Delegate math questions to the remote Assistant.",
        "Delegate research questions to the remote Researcher.",
        "Use the local Summarizer for final synthesis.",
    ],
    markdown=True,
    show_members_responses=True,
)

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

if __name__ == "__main__":
    asyncio.run(
        hybrid_team.aprint_response(
            "Calculate 15 * 23, then summarize what multiplication is.",
            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 `remote_agent_as_team_member.py`, then run:

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

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