The Company Research Agent uses CrewAI to coordinate multiple AI agents in gathering and analyzing company information. This document details the implementation of the CompanyResearchCrew class.
@CrewBaseclass CompanyResearchCrew: """ @class CompanyResearchCrew @description Coordinates multiple AI agents for comprehensive company research @param actor - Apify Actor instance for web scraping operations """
@taskdef research_company(self) -> Task: """ @task Research company details using domain name @returns Task - Research task configuration """ return Task( description="""Research the company using their domain name: {domain}. Focus on key insights about the company's: 1. Overview and core business 2. Products and services 3. Market presence and performance 4. Key personnel and organization 5. Financial metrics and funding 6. Technology stack and digital presence 7. Recent developments and news 8. Major Competitors""", agent=self.researcher() )
@taskdef analyze_data(self) -> Task: """ @task Analyze gathered company data @returns Task - Analysis task configuration """ return Task( description="""Analyze the research findings to extract key insights about: 1. business focus, 2. product lineup, 3. market and demographic details, 4. funding rounds, 5. notable executives, 6. social media profiles, 7. a list of major competitors""", agent=self.data_analyst() )
@taskdef compile_report(self) -> Task: """ @task Compile findings into a structured report @returns Task - Report compilation task configuration """ return Task( description="""Create a comprehensive report combining all research and analysis. Structure the information clearly and highlight key findings.""", expected_output="Final structured report in JSON format", agent=self.content_compiler() )
# Initialize the crew with an Apify actor instanceresearch_crew = CompanyResearchCrew(actor=actor)# Start the research processresult = research_crew.crew().kickoff( inputs={'domain': 'example.com'})