Zenaique

Walk through where CrewAI hierarchical crews put extra latency that flat agents do not

Flashcard·Medium·4.0 · 0·~30s·Asked atPaytmPineconeStripe
Attempt it
TL;DR

Hierarchical crews add a manager LLM call before every delegation; manager spans on the trace timeline are where the extra latency lives.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine an office where every task has to go through a supervisor first. The supervisor reads the task, picks which worker should do it, hands it off, then reviews the result and decides what is next. In a flat office, the worker just does the task. The supervisor is helpful when tasks really do need routing, but every meeting with the supervisor takes real time. The supervisor in a CrewAI hierarchical crew is another LLM call. Look at the trace: each supervisor meeting is its own bar on the timeline, and they appear before and after the worker bars, so the whole task ends up looking like a back and forth zigzag instead of a clean line.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

CrewAI's hierarchical process puts a manager agent in front of worker agents. The manager reads each task, picks a worker, delegates, reviews the result, and either ends the task or delegates again. The pattern is powerful for genuinely heterogeneous teams of agents, but every step the manager takes is an LLM call, and that call has to happen serially before and after the work it routes. The result is a recurring latency tax that shows up clearly on the trace timeline if you know where to look.

This walkthrough breaks down what the extra latency actually is, how to spot it in a trace, what diagnostic numbers tell you whether the routing tax is reasonable or pathological, and the production patterns that keep hierarchical crews shipping at acceptable latency.

Mental model: in a hierarchical crew, the manager is not free overhead, it is another LLM call. Each delegation is at least two manager LLM calls glued around the worker call. The trace timeline shows this directly as a planner worker planner zigzag.

Anatomy of a hierarchical delegation in the trace

What gets traced

A single CrewAI hierarchical delegation produces a sequence of spans:

  1. Outer task span (the user-facing task).
  2. Manager generation span (router LLM call that picks the worker).
  3. Worker generation span (the worker actually doing the work).
  4. Second manager generation span (router decides whether to continue or end).

If the manager decides to delegate again, you get a fresh worker span and a fresh follow-up manager span. With three rounds across three workers, you can be looking at six or seven manager spans layered around three worker spans.

The ping-pong shape

On a trace timeline (Langfuse, Phoenix, LangSmith, Datadog), the visual pattern is:

  • Manager bar - Worker bar - Manager bar - Worker bar - Manager bar.

In a flat crew, the same conceptual work is one wide worker bar. The hierarchical version is a zigzag.

Span attributes that surface manager vs worker

CrewAI emits span attributes like crewai.agent.role, crewai.agent.id, crewai.task.delegated_to, and standard OTel GenAI attributes like gen_ai.request.model and gen_ai.usage.output_tokens. Group by crewai.agent.role in your observability backend to isolate manager spans and aggregate their cost.

Where the extra latency actually comes from
The diagnostic: manager to worker token-spend ratio
Fixes and when hierarchical is worth the tax
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • CrewAI itself documents the hierarchical-process pattern and ships span attributes that Langfuse and Phoenix render as a manager-worker tree.
  • Customer-support triage products (Intercom Fin, Sierra) use hierarchical-style routing with a small manager model in front of specialist worker agents.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you instrument a CrewAI hierarchical crew so manager vs worker cost is queryable?
A

Tag every span with crewai.agent.role ('manager' or specific worker name) and crewai.delegation_step. In Langfuse or Phoenix, group cost by agent role; alert when manager share crosses a threshold like 50 percent.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Blaming the worker model for slow crews. The manager router is usually the hidden tax; check manager span count and token spend first.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • What a manager span is in a CrewAI hierarchical crew

  • Why each delegation produces two extra generation spans

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Describe how end user thumbs up/down should flow back onto a trace
Flashcard·Easy