CrewAI Web Research: Multi-Agent Tutorial
Create a team of AI agents that research and write content collaboratively using CrewAI and Tryb.
Alex Rivera
ML Engineer

CrewAI lets you orchestrate multiple AI agents working together. This tutorial shows you how to build a research crew with web access.
The Research Crew
- Researcher Agent: Searches and reads web sources
- Analyst Agent: Synthesizes and extracts insights
- Writer Agent: Produces final report
Setup
pip install crewai crewai-tools
Create Tryb Tools
from crewai_tools import BaseTool
import requests
class TrybSearchTool(BaseTool):
name: str = "Web Search"
description: str = "Search the web for information"
def _run(self, query: str) -> str:
response = requests.post(
"https://api.tryb.dev/v1/search",
headers={"Authorization": f"Bearer {os.getenv('TRYB_API_KEY')}"},
json={"query": query, "num_results": 5}
)
return str(response.json()["results"])
class TrybReadTool(BaseTool):
name: str = "Read Webpage"
description: str = "Read content from a URL"
def _run(self, url: str) -> str:
response = requests.post(
"https://api.tryb.dev/v1/read",
headers={"Authorization": f"Bearer {os.getenv('TRYB_API_KEY')}"},
json={"url": url}
)
return response.json()["data"]["markdown"]
Define Agents
from crewai import Agent, Task, Crew
researcher = Agent(
role="Research Specialist",
goal="Find comprehensive information on the given topic",
backstory="Expert at finding and extracting valuable information from the web",
tools=[TrybSearchTool(), TrybReadTool()],
verbose=True
)
analyst = Agent(
role="Data Analyst",
goal="Analyze research findings and extract key insights",
backstory="Skilled at identifying patterns and synthesizing information"
)
writer = Agent(
role="Content Writer",
goal="Create clear, engaging content from research",
backstory="Expert at transforming complex information into readable content"
)
Define Tasks
research_task = Task(
description="Research {topic} using web search and page reading",
expected_output="Comprehensive research notes with sources",
agent=researcher
)
analysis_task = Task(
description="Analyze research and extract 5 key insights",
expected_output="Bullet-point list of insights with evidence",
agent=analyst
)
writing_task = Task(
description="Write a 500-word article based on the analysis",
expected_output="Polished article ready for publication",
agent=writer
)
Run the Crew
crew = Crew(
agents=[researcher, analyst, writer],
tasks=[research_task, analysis_task, writing_task],
verbose=True
)
result = crew.kickoff(inputs={"topic": "Latest AI chip developments"})
Related Tutorials

Alex Rivera
ML Engineer at Tryb
Alex builds multi-agent AI systems.


