-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcrewai-research-team.py
More file actions
62 lines (52 loc) · 1.96 KB
/
crewai-research-team.py
File metadata and controls
62 lines (52 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""
CrewAI Research Team — BrowseAI Dev Example
A multi-agent research team using CrewAI + BrowseAI Dev.
One agent researches, another analyzes and summarizes.
Usage:
pip install crewai-browseaidev crewai
python crewai-research-team.py
"""
from crewai import Agent, Task, Crew
from crewai_browseaidev import BrowseAIDevAnswerTool, BrowseAIDevSearchTool
# BrowseAI Dev as CrewAI tools
answer_tool = BrowseAIDevAnswerTool(api_key="bai_xxx")
search_tool = BrowseAIDevSearchTool(api_key="bai_xxx")
# Agent 1: Researcher — finds evidence-backed information
researcher = Agent(
role="Senior Research Analyst",
goal="Find accurate, evidence-backed information about the given topic",
backstory="You are a meticulous researcher who never makes claims without sources.",
tools=[answer_tool, search_tool],
verbose=True,
)
# Agent 2: Writer — synthesizes research into a report
writer = Agent(
role="Technical Writer",
goal="Create clear, well-structured reports from research findings",
backstory="You turn complex research into readable summaries with proper citations.",
verbose=True,
)
# Tasks
research_task = Task(
description="Research the current state of AI agent frameworks in 2025. "
"Find the top frameworks, their key features, and adoption trends. "
"Use BrowseAI Dev to get evidence-backed results with confidence scores.",
expected_output="Detailed research findings with sources and confidence scores",
agent=researcher,
)
report_task = Task(
description="Using the research findings, write a concise comparison report "
"of AI agent frameworks. Include pros, cons, and recommendations. "
"Cite all sources from the research.",
expected_output="A structured comparison report with citations",
agent=writer,
)
# Run the crew
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, report_task],
verbose=True,
)
result = crew.kickoff()
print("\n--- Final Report ---")
print(result)