This directory contains basic examples of using the Capyswarm library.
-
hackernews.py
- Demonstrates how to scrape Hacker News using an Orchestrator and a specialized Agent.
- Usage: Scrapes the top 5 posts from Hacker News.
-
hn_analysis.py
- Demonstrates a hand-off between agents, where one agent collects data and another waits for that data and then analyzes it.
- Usage: Collects and analyzes the top 5 posts from Hacker News.
-
weather.py
- Another demonstration of how to coordinate two agents, where one agent collects data and another waits for that data and then analyzes it.
- Usage: Gets the weather forecast for Tokyo and recommends suitable outdoor activities for the next 3 days.
Click to view demo video 📽️
weather.webm
-
hn_mal.py
- Demonstrates how to scrape two different websites in parallel in two separate instances using an Orchestrator and two specialized Agents.
- Usage: Scrapes the top 5 posts from Hacker News and the top 5 anime from MyAnimeList.
- Note: This example requires you to have two different Scrapybara instances running before you run the example.
Click to view demo video 📽️
hn_mal.webm
-
github_analysis.py
- Shows how two agents can collaborate on a shared goal simultaneously, analyzing different aspects of a GitHub repository.
- Usage: Performs a comprehensive analysis of the FastAPI repository with agents sharing insights.
- Note: Doesn't always work as expected.
-
repl.py (WIP)
- Shows how to use context variables within an agent.
- Usage: Demonstrates maintaining state between agent interactions.
-
Set up your environment:
export SCRAPYBARA_API_KEY="your_api_key"
-
Run the example:
uv run examples/basic/<example_name>.py