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

# Collaborate Team

> All members work in parallel, leader synthesizes.

Build a team where all members receive the same task and work in parallel.

<Steps>
  <Step title="Create the team">
    ```python collaborate_team.py theme={null}
    import asyncio
    from definable.agent import Agent
    from definable.agent.team import Team, TeamMode

    optimist = Agent(
        model="gpt-4o",
        instructions="You are an optimistic analyst. Focus on opportunities and positive trends.",
    )
    pessimist = Agent(
        model="gpt-4o",
        instructions="You are a cautious analyst. Focus on risks, challenges, and potential downsides.",
    )
    realist = Agent(
        model="gpt-4o",
        instructions="You are a balanced analyst. Weigh both opportunities and risks pragmatically.",
    )

    team = Team(
        name="analysis-team",
        model="gpt-4o",
        members=[optimist, pessimist, realist],
        mode=TeamMode.collaborate,
        instructions="Synthesize all perspectives into a balanced analysis.",
    )

    async def main():
        result = await team.arun("Analyze the impact of AI on software engineering jobs.")
        print(result.content)

    asyncio.run(main())
    ```
  </Step>

  <Step title="Install and run">
    <Snippet file="install-definable.mdx" />

    ```bash theme={null}
    python collaborate_team.py
    ```

    All three analysts run in parallel. The leader synthesizes their responses into a balanced analysis.
  </Step>
</Steps>
