Scenario-Based AI Engineering Questions

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

ControlHow it worksStrength
Partition toolsOnly one agent has each capabilityPhysical: an agent cannot use a tool it lacks
Explicit contextPass every upstream result a task needsLater agents build on work instead of redoing it
Delegation offallow_delegation=False (the current default) unless neededStops 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 agentsOne agent instead of two overlapping onesOften the right answer
Python
researcher = Agent(role="Researcher", goal="Collect sourced facts about {topic}",                   backstory="You gather facts. You never compute metrics.",                   tools=[web_search, doc_search], allow_delegation=False)analyst = Agent(role="Analyst", goal="Compute metrics from the researcher's facts",                backstory="You never search; you work only from facts you are given.",                tools=[sql_query], allow_delegation=False)analysis = Task(description="Compute growth and margin trends.", expected_output="...",                agent=analyst, context=[research_task])        # builds on research explicitly

Measure 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.