Skip to content

[FEATURE] Add better coworkers context for crews with managers #2095

@Saicheg

Description

@Saicheg

Feature Area

Agent capabilities

Is your feature request related to a an existing bug? Please link it here.

NA

Describe the solution you'd like

Hi there!

Before making a suggestion just let me take a quick work and thank you for this amazing framework. I fall in love with simplicity and power of it a minute I found it.

Lately I am wrapping my head around crews with managers. Recently I discovered that the way "management" is done is just by assigning two tools in order to allow manager to delegate a work.

Tool Name: Delegate work to coworker
Tool Arguments: {'task': {'description': 'The task to delegate', 'type': 'str'}, 'context': {'description': 'The context for the task', 'type': 'str'}, 'coworker': {'description': 'The role/name of the coworker to delegate to', 'type': 'str'}}
Tool Description: Delegate a specific task to one of the following coworkers: News and Trend Researcher, Assistant, Topic Researcher
The input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.

Tool Name: Ask question to coworker
Tool Arguments: {'question': {'description': 'The question to ask', 'type': 'str'}, 'context': {'description': 'The context for the question', 'type': 'str'}, 'coworker': {'description': 'The role/name of the coworker to ask', 'type': 'str'}}
Tool Description: Ask a specific question to one of the following coworkers: News and Trend Researcher, Assistant, Topic Researcher

Problem for me was that in current implementation default manager can only understand which coworker to ask by their name. There is no additional context about coworkers goals/descriptions which will affect manager description. This means if you have 3 agents ( Researcher, Quick Researcher, Deep Researcher ) for example - manager will be very confused.

I would love to have a way to describe coworkers to manager with better context other that just name. It could be by including their descriptions /goals or having additional field for manager like manager_notes:.

Describe alternatives you've considered

The way I am solving this right now is by creating fully-custom manager with JSON description for each of my agents. But it is a little messy and I believe should be something by default in framework:

    @property
    def manager(self) -> Agent:
        return Agent(
            allow_delegation=True,
            role="Crew Manager",
            goal="Manage the team to complete the task in the best way possible.",
            backstory=dedent(
                """
                You are a seasoned manager with a knack for getting the best out of your team.
                You are also known for your ability to delegate work to the right coworkers, and to ask the right questions to get the best out of your team.
                Even though you don't perform tasks by yourself, you have a lot of experience in the field, which allows you to properly evaluate the work of your team members.

                Below is JSON description for your coworkwers abilities:
                {coworkers_prompt}
                """
            ).format(coworkers_prompt=self.coworkers_prompt).strip(),
        )

Additional context

No response

Willingness to Contribute

Yes, I'd be happy to submit a pull request

Metadata

Metadata

Assignees

No one assigned

    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