Overview
This project implements a multi-agent system for conducting research, generating reports, and creating blog content. The system is powered by OpenAI's GPT models, the Tavily API for web scraping, and the Swarm library for agent collaboration. The agents work collaboratively to handle user queries, perform research, and produce high-quality content.
Features
Multi-Agent Design: Three specialized agents interact and collaborate:
User Interface Agent: Manages user interactions and delegates tasks to other agents.
Researcher Agent: Performs web-based research using the Tavily API and generates detailed research reports.
Blogger Agent: Converts research reports into concise and compelling blog content.
Web Integration: Uses Tavily API for secure web scraping and data retrieval.
Asynchronous Operations: Employs Python's asyncio for efficient and non-blocking workflows.
Interactive Demo Loop: Enables dynamic interactions for testing and usage.
Prerequisites
Python 3.7+
API Keys for:
OpenAI (GPT models)
Tavily (Web scraping)
Libraries:
openai
swarm
gpt_researcher
nest_asyncio
Install dependencies using pip for the above libraries.
How It Works
Agents
User Interface Agent:
Manages interactions with the user.
Prompts for a topic or query to research.
Delegates tasks to the Researcher Agent.
Researcher Agent:
Uses Tavily API for web searches and scraping.
Generates research reports using the gpt_researcher library.
Collects additional details like sources, images, and costs.
Handoff completed research to the Blogger Agent.
Blogger Agent:
Converts research reports into concise, high-quality blog content.
Tailored for technical and professional blogging.
Workflow
User Query: The User Interface Agent prompts the user for a research topic.
Research:
The Researcher Agent conducts web-based research using Tavily.
Generates a structured report and gathers supplementary details.
Content Creation: The Blogger Agent converts the research report into a blog post.
Usage
Run the Script:
Execute the script in your Python environment.
Provide a Query: Enter a topic or question for the User Interface Agent.
View Outputs:
Research reports generated by the Researcher Agent.
Blog content created by the Blogger Agent.
Extending the System
Add More Agents: Define new agents for additional tasks or integrations.
Change Models: Update configurations to use different OpenAI models.
Enhance Research: Use advanced scraping or APIs for richer data.
Credits
OpenAI: For GPT models and API.
Swarm Library: For agent-based architecture.
Tavily API: For web searching/scrapping capabilities.