Skip to content

Crews

A Crew is a group of Agents executing one or more Tasks in a coordinated manner.

Represents a collaborative group of Agents and the Tasks they must complete.

Source code in fsdk/anote-sdk.py
class Crew:
    """
    Represents a collaborative group of Agents and the Tasks they must complete.
    """

    def __init__(
        self,
        agents: Optional[List[Agent]] = None,
        tasks: Optional[List[Task]] = None,
        verbose: bool = False
    ):
        """
        Args:
            agents (list of Agent, optional): Agents that will collaborate on Tasks.
            tasks (list of Task, optional): Tasks to be completed by these Agents.
            verbose (bool): If True, logs more details during execution.
        """
        self.agents = agents or []
        self.tasks = tasks or []
        self.verbose = verbose

    def __repr__(self):
        return f"<Crew agents={len(self.agents)} tasks={len(self.tasks)} verbose={self.verbose}>"

    def kickoff(self, inputs: Dict[str, Any] = None):
        """
        Starts or orchestrates the tasks in some manner.
        Customize as needed for your logic (sequential, parallel, hierarchical, etc.).
        """
        if self.verbose:
            print(f"[Crew] Kicking off with inputs: {inputs}")
        # Example: Just prints out each task's instructions
        for task in self.tasks:
            if self.verbose:
                print(f"[Crew] Running task: {task.instructions}")
        return {"status": "completed", "inputs_used": inputs}

__init__(agents=None, tasks=None, verbose=False)

Parameters:

Name Type Description Default
agents list of Agent

Agents that will collaborate on Tasks.

None
tasks list of Task

Tasks to be completed by these Agents.

None
verbose bool

If True, logs more details during execution.

False
Source code in fsdk/anote-sdk.py
def __init__(
    self,
    agents: Optional[List[Agent]] = None,
    tasks: Optional[List[Task]] = None,
    verbose: bool = False
):
    """
    Args:
        agents (list of Agent, optional): Agents that will collaborate on Tasks.
        tasks (list of Task, optional): Tasks to be completed by these Agents.
        verbose (bool): If True, logs more details during execution.
    """
    self.agents = agents or []
    self.tasks = tasks or []
    self.verbose = verbose

kickoff(inputs=None)

Starts or orchestrates the tasks in some manner. Customize as needed for your logic (sequential, parallel, hierarchical, etc.).

Source code in fsdk/anote-sdk.py
def kickoff(self, inputs: Dict[str, Any] = None):
    """
    Starts or orchestrates the tasks in some manner.
    Customize as needed for your logic (sequential, parallel, hierarchical, etc.).
    """
    if self.verbose:
        print(f"[Crew] Kicking off with inputs: {inputs}")
    # Example: Just prints out each task's instructions
    for task in self.tasks:
        if self.verbose:
            print(f"[Crew] Running task: {task.instructions}")
    return {"status": "completed", "inputs_used": inputs}

Crews Fields

  • agents: All the Agents that will collaborate (list of Agent objects).
  • tasks: The tasks to be completed by these Agents (list of Task objects).
  • verbose: If True, logs show more details during execution.

Example 1:

from anote_agents import Crew

crew = Crew(
    agents=[venue_coordinator, logistics_manager],
    tasks=[venue_task, logistics_task],
    verbose=True
)

Crew Composition

Crews can be composed of:

  • Multiple Agents (e.g., marketing agent, finance agent, research agent)

  • One or more Tasks (e.g., "Conduct market research," "Prepare financial analysis")

The execution flow of a crew can look like the following:

  • Initialization: The Crew binds each Task to the correct Agent.

  • Kickoff: Passes input data (if any) into tasks that contain placeholders.

  • Orchestration: Tasks may run sequentially or in parallel, depending on workflow.

  • Results: The Crew collects outputs from each Task.

Example 2:

from anote_agents import Crew

team_crew = Crew(
    agents=[marketing_agent, finance_agent],
    tasks=[research_task, analysis_task],
    verbose=True
)

# Kick off the tasks
results = team_crew.kickoff(inputs={"industry": "Renewable Energy"})

Key Benefits

  • Centralized management for complex multi-agent workflows.

  • Clear separation of responsibilities among Agents.

  • Reusability of Agents and Tasks across different Crews if desired.