DEV Community

Cover image for CrewAI Agent is not a team player. It craves a conveyor, not a crew
Pavel Koryagin
Pavel Koryagin

Posted on

CrewAI Agent is not a team player. It craves a conveyor, not a crew

I like CrewAI, but I must admit its name has fooled me.

Problems with AI frameworks start before you’ve even chosen one. There are a ton of frameworks already, so we guess their properties based on very fragmented knowledge.

ℹ️ This post is part of the “Crew AI Caveats” series, which I create to fill in the gaps left by official courses and to help you master CrewAI faster and easier.

How did the name of CrewAI fool me? I imagined agents interacting like a crew, but in practice, it turned out to be built for sequential processes, and the behavior that you expect for a virtual crew—resembling a human crew—is either not working or is absent completely.

What is already available

Objecting to this thesis, CrewAI offers asynchronous tasks and hierarchical processes, but these features are underwhelming.

Asynchronous tasks only optimize execution time without affecting the outcomes.

The hierarchical process is buggy and poorly documented. For instance, tasks calling other tasks often produce errors, and the manager meant to dispatch tasks sometimes mishandles them. Telemetry reveals bizarre interactions, like a Frankenstein-style combination of a task definition with a wrong agent. Join my topic to see the research I conducted.

Artifacts in task calling by LLM, caused by insufficiency of the internal prompt

What is a “crew,” according to my intuition

The agents should decide what they do and what they don’t. The tasks and task dependencies should be a set of best practices rather than a strict to-do list. Agents or their dispatcher should decide which sub-tasks (or predefined processes) are relevant to the current request and which are not.

This isn’t available right now in CrewAI. All the tasks in a crew are mandatory. The sequential process is the only type that works reliably.

Can I implement it manually?

Look, the process in CrewAI is a sort of state machine. And CrewAI also comes with an explicit state machine—the Flow class. It might be the base for DIY solutions.

I’m going to experiment with a LangGraph example where CrewAI is only a node in a LangGraph state machine. Also, I found how to run a single CrewAI task (with its agent) out of the Crew and Process—will see if it helps or not.

Wrapping up, if you want something more complex than a sequential process with CrewAI, implement it yourself. Do you know a framework that allows agents to decide which task definitions are relevant to the current user request? Please share.

Stay tuned

In the next post: You are probably getting CrewAI’s Task object wrong, as I did. Let’s clarify how it physically works.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay