Skip to content

Marvin Teams/Swarm feature is currently broken (~3.1.5) #1218

@romans127

Description

@romans127

The current examples of Marvin Team's in the documentation return errors.
As it stands the Team feature is not functional.
Other attempts such as creating a basic team, using only 2 agents and using the alternative team types have also failed.
https://askmarvin.ai/concepts/teams

Example 1: [What are teams](https://askmarvin.ai/concepts/teams#what-are-teams) ``` import marvin from marvin import Agent, Swarm

Create specialized agents

researcher = Agent(name="Researcher", instructions="Find and analyze information thoroughly")
writer = Agent(name="Writer", instructions="Create engaging, clear content")
editor = Agent(name="Editor", instructions="Improve and refine content for clarity and accuracy")

Form a team

content_team = Swarm([researcher, writer, editor])

Use the team to complete a task

article = content_team.run("Create an article about quantum computing")
print(article)



**Example 1 Results **
```sh
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "<redacted>/src/flows/team_test.py", line 12, in <module>
    result = team.run("Write a report about AI")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/agents/actor.py", line 163, in run
    return marvin.utilities.asyncio.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/utilities/asyncio.py", line 42, in run_sync
    return ctx.run(loop.run_until_complete, coro)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/agents/actor.py", line 142, in run_async
    return await marvin.run_async(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/fns/run.py", line 109, in run_async
    await run_tasks_async(
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/fns/run.py", line 29, in run_tasks_async
    await orchestrator.run(raise_on_failure=raise_on_failure)
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/engine/orchestrator.py", line 263, in run
    result = await self.run_once(
             ^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/engine/orchestrator.py", line 173, in run_once
    agentlet = await actor.get_agentlet(
                     ^^^^^^^^^^^^^^^^^^^
TypeError: Team.get_agentlet() got an unexpected keyword argument 'active_mcp_servers'
Example 2: [Types of teams](https://askmarvin.ai/concepts/teams#types-of-teams) ```python from marvin import Agent from marvin.agents.team import RoundRobinTeam

agents = [
Agent(name="Brainstormer", instructions="Generate initial ideas"),
Agent(name="Developer", instructions="Expand on ideas with details"),
Agent(name="Critic", instructions="Identify potential issues")
]

team = RoundRobinTeam(members=agents)
result = team.run("Develop a strategy for reducing plastic waste")


**Example 2 Results**
_Fixed the original import error_
```sh
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "<redacted>/src/flows/team_test.py", line 11, in <module>
    result = team.run("Evaluate this business proposal")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/agents/actor.py", line 163, in run
    return marvin.utilities.asyncio.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/utilities/asyncio.py", line 42, in run_sync
    return ctx.run(loop.run_until_complete, coro)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/agents/actor.py", line 142, in run_async
    return await marvin.run_async(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/fns/run.py", line 109, in run_async
    await run_tasks_async(
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/fns/run.py", line 29, in run_tasks_async
    await orchestrator.run(raise_on_failure=raise_on_failure)
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/engine/orchestrator.py", line 263, in run
    result = await self.run_once(
             ^^^^^^^^^^^^^^^^^^^^
  File "<redacted>/.venv/lib/python3.12/site-packages/marvin/engine/orchestrator.py", line 173, in run_once
    agentlet = await actor.get_agentlet(
                     ^^^^^^^^^^^^^^^^^^^
TypeError: Team.get_agentlet() got an unexpected keyword argument 'active_mcp_servers'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions