What You’ll Learn
By building this team, you’ll understand:- How to integrate multiple data sources (HackerNews API, web search, article readers)
- How to define structured output schemas using Pydantic models
- How to coordinate agents with specific instructions for complex workflows
- How to combine real-time data with web research for comprehensive analysis
Use Cases
Build news aggregation platforms, trend analysis systems, content curation tools, or automated newsletter generators.How It Works
The team coordinates three specialized agents to create detailed articles:- Discover: HackerNews researcher finds trending stories from HackerNews
- Read: Article reader extracts full content from story URLs
- Research: Web searcher finds additional context and related information
- Synthesize: Team combines all findings into structured articles with summaries and references
Code
hackernews_team.py
What to Expect
The team will research HackerNews stories, read the full articles, and search for additional context. Each agent contributes their specialized capability: finding stories, extracting article content, and web research. The output is a structured Article object with a title, comprehensive summary, and reference links. You’ll see responses from all team members showing how they collaborate to gather and synthesize information.Usage
1
Create a virtual environment
Open the
Terminal and create a python virtual environment.2
Set your API key
3
Install libraries
4
Run Team
Next Steps
- Modify the query to track specific topics or keywords on HackerNews
- Adjust the
Articleschema to include additional fields like categories or sentiment - Change the number of stories analyzed in the prompt
- Explore Input & Output for custom data schemas