⚠️ ATTENTION: THIS PROJECT WAS MOVED HERE! ⚠️
NOTE: For a detailed walkthrough of this project, check out the full tutorial.
A demonstration of the MiniAgents framework showcasing an AI-powered web research system.
WebResearch is a multi-agent system that:
- Breaks down a user's question into search queries
- Executes searches in parallel
- Analyzes search results to identify relevant web pages
- Scrapes and extracts information from those pages
- Synthesizes a comprehensive answer
All built with procedural code simplicity while benefiting from MiniAgents' automatic parallelism.
This system demonstrates two key strengths of MiniAgents:
Every interaction between agents happens through message sequence promises:
web_search_agent.trigger()returns promises, not actual results- The final synthesis waits for the promises to be resolved
The system exhibits incredible parallelism with no special code:
- Multiple search queries are processed simultaneously
- Multiple web pages are scraped in parallel
- All without explicit thread or process management
MiniAgents uses the start_soon mode by default, allowing each agent to run in the background. The immutable message design ensures this parallelism is safe and efficient.
pip install -U -r requirements.txtFor the LLM we use OpenAI, for google searches we use Bright Data SERP API and for scraping we use Bright Data Scraping Browser. All are pay as you go services.
The websites referenced above will walk you through the process of setting respective products up and getting your API keys. After that you are ready to create a .env file with your API credentials:
OPENAI_API_KEY=your_openai_api_key
BRIGHTDATA_SERP_API_CREDS=username:password
BRIGHTDATA_SCRAPING_BROWSER_CREDS=username:password
NOTE: The credentials are specifically for Bright Data's SERP API and Scraping Browser products, not for your whole Bright Data account.
python web_research.pyThen enter your research question when prompted.
Example question:
I'm thinking of moving from Lviv to Kyiv — what should I know about the cost of living, neighborhoods, gyms, and, most importantly, finding an apartment if I have two cats?
The system consists of three main agents:
- Research Agent: Coordinates the workflow, breaks down questions into search queries
- Web Search Agent: Executes searches and identifies relevant web pages
- Page Scraper Agent: Extracts information from web pages
- Final Answer Agent: Synthesizes the final answer
All agents communicate asynchronously through MiniAgents' promise-based architecture.
MiniAgents is an open-source, async-first Python framework for building multi-agent AI systems with an innovative approach to parallelism. Key advantages:
- Write procedural code, get parallel execution: Unlike graph-based frameworks, MiniAgents lets you write straightforward sequential code.
- Nothing blocks until it's needed: With its promise-based architecture, agents execute in parallel and execution blocks only at points where specific agent messages are required.
- Immutable message philosophy: Uses immutable, Pydantic-based messages that eliminate race conditions and data corruption concerns.
Learn more: MiniAgents GitHub Repository