cryogenic22 commited on
Commit
534fb78
·
verified ·
1 Parent(s): 20e7e83

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +38 -48
agents.py CHANGED
@@ -11,88 +11,78 @@ def create_research_crew(topic: str, questions: list):
11
  researcher = Agent(
12
  role='Market Researcher',
13
  goal=f"""Research the {topic} market comprehensively.
14
- Address these specific questions: {', '.join(questions)}""",
 
15
  backstory="""Expert market researcher with extensive experience in industry analysis.
16
  Skilled at finding and validating market data from multiple sources.""",
17
  tools=tools,
18
  llm=llm,
19
- max_iterations=2,
20
  verbose=True
21
  )
22
 
23
  analyst = Agent(
24
  role='Data Analyst',
25
- goal=f"""Analyze market data for {topic} focusing on:
26
- 1. Market size and growth calculations
27
- 2. Competitive analysis
28
- 3. Regional distribution
29
- 4. Trend analysis
30
- 5. Future projections
31
-
32
- Address these questions in your analysis: {', '.join(questions)}""",
33
  backstory="Senior data analyst specializing in market trends and competitive analysis",
34
  tools=tools,
35
  llm=llm,
36
- max_iterations=2,
37
  verbose=True
38
  )
39
 
40
  writer = Agent(
41
  role='Report Writer',
42
- goal=f"""Create a comprehensive report on {topic} that:
43
- 1. Addresses all user questions: {', '.join(questions)}
44
- 2. Incorporates research findings and analysis
45
- 3. Provides actionable insights
46
- 4. Includes visual data representations
47
- 5. Maintains professional tone and structure""",
48
  backstory="Professional report writer with expertise in market research",
49
  llm=llm,
50
- max_iterations=2,
51
  verbose=True
52
  )
53
 
54
  tasks = [
55
  Task(
56
- description=f"""Research {topic} addressing:
57
- - User Questions: {', '.join(questions)}
58
- - Current market size and growth
59
- - Competitive landscape
60
- - Regional analysis
61
- - Technology trends
62
- - Future outlook
63
 
64
- Use web search to find recent data and developments.
65
- Include specific numbers and statistics.""",
66
  agent=researcher,
67
- expected_output="Detailed market research data with specific metrics and findings"
68
  ),
69
  Task(
70
- description=f"""Analyze the research data for {topic}:
71
- 1. Calculate market metrics
72
- 2. Identify trends
73
- 3. Compare competitors
74
- 4. Analyze regional distribution
75
- 5. Project future growth
76
 
77
- Address user questions: {', '.join(questions)}
78
- Create visualizations for key metrics.""",
79
  agent=analyst,
80
- expected_output="Comprehensive market analysis with trends and insights"
81
  ),
82
  Task(
83
- description=f"""Write comprehensive report for {topic}:
84
- 1. Executive Summary
85
- 2. Market Overview
86
- 3. Competitive Analysis
87
- 4. Regional Analysis
88
- 5. Technology Trends
89
- 6. Future Outlook
90
- 7. Strategic Recommendations
 
91
 
92
- Ensure all user questions are answered: {', '.join(questions)}
93
- Include data visualizations and key metrics.""",
94
  agent=writer,
95
- expected_output="Complete market research report with analysis and recommendations"
96
  )
97
  ]
98
 
 
11
  researcher = Agent(
12
  role='Market Researcher',
13
  goal=f"""Research the {topic} market comprehensively.
14
+ Search for and collect real market data including market size, growth rates, key players, and trends.
15
+ Specifically address these questions: {', '.join(questions)}""",
16
  backstory="""Expert market researcher with extensive experience in industry analysis.
17
  Skilled at finding and validating market data from multiple sources.""",
18
  tools=tools,
19
  llm=llm,
20
+ max_iterations=2,
21
  verbose=True
22
  )
23
 
24
  analyst = Agent(
25
  role='Data Analyst',
26
+ goal=f"""Analyze the collected market data for {topic}.
27
+ Create insights from the research data.
28
+ Ensure to answer: {', '.join(questions)}""",
 
 
 
 
 
29
  backstory="Senior data analyst specializing in market trends and competitive analysis",
30
  tools=tools,
31
  llm=llm,
32
+ max_iterations=2,
33
  verbose=True
34
  )
35
 
36
  writer = Agent(
37
  role='Report Writer',
38
+ goal=f"""Create a comprehensive report on {topic} using the research and analysis provided.
39
+ Focus on answering: {', '.join(questions)}""",
 
 
 
 
40
  backstory="Professional report writer with expertise in market research",
41
  llm=llm,
42
+ max_iterations=2,
43
  verbose=True
44
  )
45
 
46
  tasks = [
47
  Task(
48
+ description=f"""Research the {topic} market:
49
+ 1. Use web search to find current market data
50
+ 2. Focus on recent market statistics and trends
51
+ 3. Find information about key players and their market shares
52
+ 4. Research regional market distribution
53
+ 5. Look for recent industry developments
54
+ 6. Address these specific questions: {', '.join(questions)}
55
 
56
+ Format the research with clear sections for market size, players, trends, and regional analysis.""",
 
57
  agent=researcher,
58
+ expected_output="Detailed market research data"
59
  ),
60
  Task(
61
+ description=f"""Analyze the research data:
62
+ 1. Process the market size and growth figures
63
+ 2. Analyze competitive landscape
64
+ 3. Identify key trends and patterns
65
+ 4. Create regional breakdown
66
+ 5. Address these questions: {', '.join(questions)}
67
 
68
+ Format the analysis with clear sections and data points.""",
 
69
  agent=analyst,
70
+ expected_output="Market analysis with insights"
71
  ),
72
  Task(
73
+ description=f"""Write a comprehensive report using the research and analysis:
74
+ 1. Create executive summary
75
+ 2. Detail market overview
76
+ 3. Describe competitive landscape
77
+ 4. Explain market trends
78
+ 5. Provide regional analysis
79
+ 6. Make future projections
80
+ 7. Add strategic recommendations
81
+ 8. Answer these questions: {', '.join(questions)}
82
 
83
+ Format as a professional report with clear sections.""",
 
84
  agent=writer,
85
+ expected_output="Final market research report"
86
  )
87
  ]
88