Course Content
Scenario-Based AI Engineering Questions
26 sections · 146 lessons
Scenario – 2: Redundant Agent Contributions
What you need to know
The scenario: in a four-agent crew, two agents research the same facts and the writer repeats both, doubling cost and producing a repetitive report.
Why agents overlap
Agents act on their role, goal and tools. If the analyst also has a web-search tool, it will search the web when unsure — duplicating the researcher. In a sequential crew, a task sees only the previous task's output unless you pass more with context, so a later agent may not know what an earlier one already found, and it rediscovers it.
The controls, strongest first
| Control | How it works | Strength |
|---|---|---|
| Partition tools | Only one agent has each capability | Physical: an agent cannot use a tool it lacks |
Explicit context | Pass every upstream result a task needs | Later agents build on work instead of redoing it |
| Delegation off | allow_delegation=False (the current default) unless needed | Stops agents handing work to each other and back |
| Exclusive role text | "You analyse; you do not research. The researcher owns sources." | Helpful, but only persuasion |
| Merge agents | One agent instead of two overlapping ones | Often the right answer |
1researcher = Agent(role="Researcher", goal="Collect sourced facts about {topic}",2 backstory="You gather facts. You never compute metrics.",3 tools=[web_search, doc_search], allow_delegation=False)4analyst = Agent(role="Analyst", goal="Compute metrics from the researcher's facts",5 backstory="You never search; you work only from facts you are given.",6 tools=[sql_query], allow_delegation=False)78analysis = Task(description="Compute growth and margin trends.", expected_output="...",9 agent=analyst, context=[research_task]) # builds on research explicitlyMeasure it
Log tokens per task and compare the text of task outputs. If two outputs have embedding similarity above about 0.9, they are doing the same work: merge the agents or split their scope, then re-measure. If you cannot state an agent's unique contribution in one sentence, it probably should not exist.
A real-life example
Scenario, numbers made up. A marketing team's crew has a researcher, a "competitive analyst", a strategist and a writer. Both the researcher and the analyst have web search, and the analyst had delegation turned on. Traces show the analyst repeating 60% of the researcher's searches.
The team removes web search from the analyst, gives it a pricing-database tool instead, turns delegation off, and passes both upstream tasks to the writer through context. Tokens per run fall by 38%, and run time by about a third. Reviewers say the reports are shorter and less repetitive. A month later, they merge the strategist into the writer, whose outputs were 0.93 similar, saving another 15%.
Follow-up questions to expect
- "When is delegation useful?" — In hierarchical crews, where a manager assigns work; in sequential crews with clear roles, it mostly adds loops and duplication.
- "Why is tool partitioning stronger than role text?" — Role text asks the model to behave; tool access decides what it can do.
- "How do you know an agent is unnecessary?" — Remove it in a test run and compare quality on your regression set; if nothing drops, it goes.