Why instead of detailed reports, agents produce kind of summarized outputs that lack details and depth?

Hi,

I’m working on a project to generate comprehensive company reports using CrewAI. I’ve designed a workflow with three agents: a company_researcher, a research_reviewer, and a report_writer. My goal is to produce detailed reports, but I’m consistently getting outputs that are too brief and lack the depth I’m aiming for.

Here’s a breakdown of my agents, tasks and code:

Agents:

  • company_researcher:

    • Role: Senior Company Research Analyst

    • Goal: Conduct thorough research on {company_name}.

    • Backstory: Experienced analyst with a knack for gathering information from diverse sources.

  • research_reviewer:

    • Role: Expert Research Reviewer and Editor

    • Goal: Critically evaluate and refine the research, ensuring accuracy and clarity.

    • Backstory: Meticulous editor with sharp analytical skills.

  • report_writer:

    • Role: Professional Report Writer

    • Goal: Compose a comprehensive report based on the reviewed research.

    • Backstory: Exceptional writer skilled at transforming complex information into engaging reports.

Tasks:

  • research_task:

    • Description: Conduct comprehensive research on {company_name} using internet resources. Focus on history, financials, market position, products/services, leadership, recent news, and events in 2024.

    • Expected Output: Detailed research document with sections on each aspect. Include at least five bullet points per section.

  • review_task:

    • Description: Review the research document, verify information, assess source credibility, identify gaps, and provide feedback.

    • Expected Output: Comprehensive review report with detailed feedback, including fact verification and recommendations for improvement.

  • writing_task:

    • Description: Compile a professional report based on reviewed research and feedback. Include executive summary, detailed analysis, and conclusion.

    • Expected Output: Comprehensive report in markdown format, providing a thorough understanding of the company’s status and prospects.

@CrewBase
class TestCrew():
“”“TestCrew crew”“”

	# Learn more about YAML configuration files here:
	# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
	# Tasks: https://docs.crewai.com/concepts/tasks#yaml-configuration-recommended
	agents_config = 'config/agents.yaml'
	tasks_config = 'config/tasks.yaml'

	# If you would like to add tools to your agents, you can learn more about it here:
	# https://docs.crewai.com/concepts/agents#agent-tools

@agent
def company_researcher(self) -> Agent:
	return Agent(
		config=self.agents_config['company_researcher'],
		verbose=True,
		tools=[SerperDevTool(), ScrapeWebsiteTool()],
	)

@agent
def research_reviewer(self) -> Agent:
	return Agent(
		config=self.agents_config['research_reviewer'],
		verbose=True
	)

@agent
def report_writer(self) -> Agent:
	return Agent(
		config=self.agents_config['report_writer'],
		verbose=True
	)

# To learn more about structured task outputs, 
# task dependencies, and task callbacks, check out the documentation:
# https://docs.crewai.com/concepts/tasks#overview-of-a-task
@task
def research_task(self) -> Task:
	return Task(
		config=self.tasks_config['research_task'],
	)

@task
def review_task(self) -> Task:
	return Task(
		config=self.tasks_config['review_task'],
	)

@task
def writing_task(self) -> Task:
	return Task(
		config=self.tasks_config['writing_task'],
		output_file='report.md'
	)

@crew
def crew(self) -> Crew:
	"""Creates the TestCrew crew"""
	# To learn how to add knowledge sources to your crew, check out the documentation:
	# https://docs.crewai.com/concepts/knowledge#what-is-knowledge

	return Crew(
		agents=self.agents, # Automatically created by the @agent decorator
		tasks=self.tasks, # Automatically created by the @task decorator
		process=Process.hierarchical,
		planning=True,
		verbose=True,
		manager_llm=(ChatOpenAI(model_name='gpt-4o',temperature=0)),   
		# process=Process.hierarchical, # In case you wanna use that instead https://docs.crewai.com/how-to/Hierarchical/
	)

The default llm model is gpt-4o-mini.
Despite this setup, the generated reports are consistently too short and lack the desired level of detail.
Any help or guidance would be greatly appreciated! Thank you very much!

@Dragos_Viorel The fact is that every agent in your workflow will modify the output to some extent. That’s why you get kind of summarized outputs that lack details. The solution is to force tool output as a result by setting the result_as_answer parameter to True to the agent(s). As stated in the docs:

This parameter ensures that the tool output is captured and returned as the task result, without any modifications by the agent.

You do this as follows:

my_agent = Agent(
    ...,
    tools=[YourTool(result_as_answer=True)],
)
1 Like

Hi @rokbenko,

Thank you for your input! I understand that the result_as_answer=True parameter ensures that tool outputs are directly used as results without further agent modifications, but I am using tools like SerperDevTool and ScrapeWebsiteTool, which pull raw data from external sources.
If I enable result_as_answer for these two tools, the agent will directly output the raw scraped data as the result.

Got it! I had this case in the past. What I did to improve the depth of the final answer was to improve the agent and task configurations. Unfortunately, I don’t have any specific suggestions for you other than to tweak your configurations and see if the final answer gets better in terms of what you want to achieve.

You can take a look at the Podcast Prepper, my past project, and see the final report, which was quite detailed compared to what the tools provided to agents. See the configurations for the first and second crew, if it helps.

1 Like