crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
19k stars 2.62k forks source link

How to mention one agent in another agents goal #1061

Closed pradeepdev-1995 closed 1 month ago

pradeepdev-1995 commented 1 month ago

I have two agents. Agent 1 and Agent 2. Example

senior_statistician_1 = Agent(
    role = "Agent 1 role",
    goal="""Agent 1 goal""",
    backstory=(
    "Agent 1 backstory"
    ),
    llm = llm,
    allow_delegation=True,
    verbose=True
)

senior_statistician_2 = Agent(
    role = "Agent 2 role",
    goal="""Agent 2 goal""",
    backstory=(
    "Agent 2 backstory"
    ),
    llm = llm,
    allow_delegation=True,
    verbose=True
)

similarly i have tasks also

statisticalAnalysis_phase_1= Task(
    description = (
     "task description 1"
  ),
    expected_output='expected output of task 1',
    agent = senior_statistician_1
)

statisticalAnalysis_phase_2= Task(
    description = (
     "task description 2"
  ),
    expected_output='expected output of task 2',
    agent = senior_statistician_2
)

I want to use the out of task 1 statisticalAnalysis_phase_1 in task 2 statisticalAnalysis_phase_2.

So how and where should i mention that, there are different ways

1 - should i mention about agent 1 in goal of agent 2 2 - should i mention about agent 1 in backstory of agent 2 3 - should i mention about task 1 in description of task 2 4 - should i mention about agent 1 in description of task 2 ..... ......etc

aslo what should i mention? the agent1s name , or agent1s role, task 1 s name,... ...??