crewAI
crewAI copied to clipboard
How do I pass the result of an Agent as an Input to the Next Agents.
I about for different Agents collaborating on a different Task, the Agents are dependent on one another, and each output is meant to be an input to the next Agents.
Any example of how to achieve this?
The Process.sequential
,where one task is executed after the other and the outcome of one is passed as extra content into this next.
you can arrange your workflow into tasks that will execute one after another and assign agents to the tasks as you want , so the agent execute the current task then pass the outcome to the agent assigned to the next task
@sc00rpi0n There is a lot of information passed from the previous onto the next, I Agent setup, Task, tools and output. I only need the output, how can I access that
If you want to only pass the output (which I assume is the final answer part ) you can make two crews the first crew will do the task that you want to pass its output and the second crew will run the agent that need this output , save the output of the first crew into a variable and then pass it to the task in the second crew as input , this example is doing a similar idea: https://github.com/joaomdmoura/crewAI-examples/tree/main/instagram_post
Yup, also the only information that one agent passes to the next is the previous task output, so you should be good on that front already. For more complex flow multiple crews might be the ideal. You can also check individual task results by doing taks.output
once the crew finishes running
Thanks for the response. @joaomdmoura @sc00rpi0n