An autonomous multi-agent system built with the Qwen-Agent framework that researches, writes, reviews, and illustrates a complete blog post from a single topic prompt.
- Multi-Agent Collaboration: Utilizes a team of four specialized AI agents (Outliner, Writer, Reviewer, Image Generator) that work in sequence to produce a final article.
- Dynamic Research: The Writer Agent uses the Tavily Search API to gather real-time, relevant information, ensuring the content is timely and factual.
- Autonomous Workflow: The entire content creation pipeline is orchestrated from a single input topic, demonstrating end-to-end automation.
- Custom Tool Integration: Features a custom-built search tool (
TavilySearchTool
) to replace a buggy default, showcasing practical problem-solving and framework extension. - Interactive UI: A user-friendly web interface built with Gradio allows for easy interaction without needing to use the command line.
This project uses a pipeline architecture where the output of one agent becomes the input for the next.
[User Topic] -> [OutlineAgent] -> [Outline]
|
v
+------------------+------------------+
| | |
[WriterAgent] [WriterAgent] [WriterAgent] (Runs for each outline section)
| | |
+------------------+------------------+
|
v
[Combined Draft]
|
v
[ReviewerAgent]
|
v
[Polished Text]
|
v
[ImageAgent] -> [Image URL] -> [Final Article Assembly] -> [Save to .md file]
Follow these steps to set up and run the project locally.
- Python 3.10+
uv
(orpip
) for package installation- API keys for:
- Alibaba Cloud Dashscope (for the Qwen LLM)
- Tavily Search API (for web research)
git clone [your-github-repo-url]
cd ai_content_team
Create a virtual environment:
# Using uv
uv venv
# Activate it (on Windows)
.\.venv\Scripts\activate
uv pip install -r requirements.txt
Create a .env
file in the project root and add your API keys:
DASHSCOPE_API_KEY="sk-your-dashscope-key"
TAVILY_API_KEY="tvly-your-tavily-key"
You can run the project in two ways:
Launch the Gradio application:
python app.py
Open your browser to the local URL provided (e.g., http://127.0.0.1:7860
).
Run the entire workflow from your terminal:
python main.py --topic "Your chosen topic here"
The final article will be saved as a markdown file in the /outputs
directory.