I have mutiple task and multiple agents in a crew. For each invoke I want to run just one of these tasks and get response

I have a crew
compliance

This has two agents and two tasks respectively
RAG Research (research task) (has rag tools)
Compliance Details Getter (compliance task) (has custom tools)

Now when i ask “What is the meaning of x?”
I want it to go to just the rag agent and get me the response.
But what is happing is it runs both task irrespective of the Process(seq/hierar)

Once it goes to compliance agents either it bring incorrect data or gets stuck in a loop.

I have tried
planning true
creating a manager agent
both does not work.

agent.yaml

complaince_details:
  role: >
    Compliance Details Getter
  goal: >
    Answer user message using the tools provided.
  backstory: >

research_agent:
  role: >
    Researcher
  goal: >
    Use the information retrieved from the vectorstore to answer the question.
  backstory: >

manager_agent:
  role: >
    Manager
  goal: >
    Chat History:
    `{complete_chat_history}`
    
    User query:
    `{user_msg}`
    
    ### Steps to follow:
    STEP 1
    Decide wether user question can be answered by the tools available. (YES/NO)

    STEP 2
    If YES
      ONLY use Compliance Details Getter (task: get_compliance_details) to get the answer and return the response
    If NO
      ONLY use Researcher (task: research_task) to get the answer and return the response

    STEP 3
    Verify the answer if it is relevent and correct to the question.

  backstory: >

Which LLM are you using for the manager agent? I figure you might need a srong/intelligent agent to be able to to this.

For such cases I would use a flow with a classifier step that determines which crew/agent to call. It would work this way:

  1. User sends a query which kicks off the flow
  2. the classifier step uses an LLM call to determine the type of query
  3. A router step routes the query to either a RAG research crew or Complience Details crew step
  4. Return the result to the user.

This is a bit more deterministic. You have more control over what is called compared to using 1 crew and multiple agents.

It becomes way more deterministic than I want. And don’t want to have routers because I will need to explain everything to router again.
Although I read about Conditional Task so i am trying the to run the rourter task and then the other task.

Again the problem is
Even if condition is false it still run BUT does not return in output. I dont want it to run that task.

1 Like