Agent Foundry
All Problems

#78. Researcher-Writer Crew

MediumMulti-Agent

The Problem

You have a two-agent crew for generating market reports: a researcher gathers industry data and a writer drafts an executive summary. The problem is that the writer ignores the researcher's output and generates a report from scratch. The result is a report full of generic or hallucinated statistics that don't match the research. Your task is to fix the context passing so the writer receives and uses the researcher's actual findings.

Examples

Example 1

User input: Industry: electric vehicles

Current (bad) output: The researcher finds specific EV market statistics (e.g., "global EV sales grew 35% in 2024"). The writer produces a report with completely different numbers it made up, ignoring the research.

Expected (good) output: The writer's report directly references the researcher's findings: "According to our research, global EV sales grew 35% in 2024…" and builds the executive summary around those data points.

Example 2

User input: Industry: cloud computing

Current (bad) output: The researcher identifies key players and market size. The writer drafts a generic cloud computing overview with no connection to the specific findings.

Expected (good) output: The writer's summary synthesizes the researcher's specific findings about key players and market size into a coherent executive report.

Your Task

Fix the starter code so that:

  • The researcher runs first and gathers market data.
  • The writer receives the researcher's output as explicit context/input.
  • The final report is grounded in the specific data points from the research, not generated independently.
  • Both agents remain separate with distinct roles.

Evaluation

Submissions are checked for the following:

  • Research context reaches the writer: The writer agent receives the researcher's output as input context.
  • Report grounded in research: The final report references specific data points and findings from the research step.
  • Roles remain separate: The researcher and writer are distinct agents with different responsibilities.
  • No hallucinated statistics: The writer does not invent data that was not present in the research output.

Constraints

  • The writer must use the researcher's actual output, not generate from scratch
  • Both agents must remain separate with distinct roles
  • You may not hard-code research findings into the writer's prompt
  • The final report must reference specific data points from the research
Starter Code
from crewai import Agent, Task, Crew, Process
from crewai import LLM

llm = LLM(model="gpt-4o-mini")

researcher = Agent(
    role="Market Researcher",
    goal="Find current market data and statistics about a given industry",
    backstory="You are a senior market analyst with 10 years of experience.",
    llm=llm,
)

writer = Agent(
    role="Report Writer",
    goal="Draft a professional market report from research data",
    backstory="You are a business writer who turns raw data into executive summaries.",
    llm=llm,
)

research_task = Task(
    description="Research current market trends and key statistics for the {industry} industry",
    expected_output="A detailed list of market trends, statistics, and key players",
    agent=researcher,
)

# BUG: The write_task has no context linking it to research_task
# TODO: Fix context passing so the writer uses the researcher's findings
write_task = Task(
    description="Write a professional market report for the {industry} industry",
    expected_output="A 300-word executive summary with data-backed insights",
    agent=writer,
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process=Process.sequential,
)

result = crew.kickoff(inputs={"industry": "electric vehicles"})
print(result)
Open in Google Colab
Evaluation Criteria0/4