Decision making Algorithms used in CrewAI

Hello Team,

I wanted to check about the Decision making algorithm of Algorithm. Does CrewAI uses the Rule based system of Backward Chaining for decision making by the Agents or does they used any other ML algorithm?

Can someone please provide with more insights on this?

Thanks!

All the codebase is available on GitHub, you can see what it does there

1 Like

I understand the codebase is present on Github and I have been digging deep into the source code but couldn’t point to the ML algorithm or decision making function of the agent.

Could you Please point to the pointers in the code base where the agent decision making function is implemented.

Thank you and looking forward to your response.

I think it depends on what decision you are referring to. CrewAI agents use the LLM as their engine, so most of the decisions come from there. Obviously the input a user provides to the agent (such as the task or the tools) is considered as well. I’m not sure if this answers your question but as the other person replied above, dig into the source code in the repository and follow the flow of logic.

Yes, I dig deep in the agent execution and thought process, but it looks like the LLM call is being made by the agent with the max_iterations or until the conclusion is being made.

But here, I define the decision making as being once the output is received from the LLM call, how the agent determines whether the response received from the LLM call is the desired output or not.

Here, in the source code crewAI/src/crewai/agents/crew_agent_executor.py at main · crewAIInc/crewAI · GitHub, it looks like AgentAction and AgentFinish dataclass is being defined, but couldn’t figure out how the Agent thought process is actually implemented.

If you have more insights on this. Please provide with the pointer.

Here in this medium article Create a Blog Writer Multi-Agent System using Crewai and Ollama | by Plaban Nayak | The AI Forum | Medium, hence wondering if CrewAI internally uses the Rule based decision making for agents to provide with the desired output.

Crewai is a rule-based system designed to facilitate knowledge representation and reasoning. Its scalability makes it suitable for large-scale applications, such as expert systems, decision support systems, and intelligent agents. Advantages of using Crewai include its ability to represent complex knowledge structures and scalability. However, Crewai requires manual rule development and may not be suitable for complex scenarios.

The other query I have is around the delegation the manager agent makes in case of Hierarchical process for the completion of task.

Given a task, how does the manager agent makes decision on the delegation of tasks to the other agents. I understand it happens via the specific roles that are being assigned to the agents. But does the Manager agent passes the task description to the LLM and then after processing the output, delegates the task? Here I want to better understand the decision making process being made by the Manager agent.

Does CrewAI uses the ReAct prompting technique?

1 Like