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!