What is the best way to create a flow, that uses multiple crews sharing common agents

Hi, I am trying to build a flow that has 3 possible routes. The user selects an intent (2 possbile - analyze query, specific-task-1.)

  1. Analyze Query : User has selected analyse query the, the crew runs the agent - query_analyser and task- query_analyser_task to find : query_intent, query_complexity, query_reformulation etc.,

  2. specific-task-1: user selected specific-task-1, then a different crew is triggered but this crew uses the same query_analyser agent and query_analyser_task task.

How do I implement this without repeating the definitions for common agents and tasks? It doesn’t work when I try to use one common agent.yaml and task.yaml

Hi,

Did you try to create 2 different crews with the agents and tasks you need? No matter if you have common agents.

If so, then for each route, you will kick off the corresponding crew.

It doesn’t work when I try to use one common agent.yaml and task.yaml

What do you mean by this?

I’m sure you can create multiple crews in the same file using the same yaml files. You can then import these crews and use them in your flow as usual