A simple multi-agent AI system built using CrewAI that automatically:
- Researches a topic from the web 🌐
- Extracts key insights 🧠
- Generates a structured article ✍️
This project demonstrates how agent-based AI workflows can replace single-prompt LLM systems for better structure, modularity, and scalability.
crewai-learning/
│
├── config/
│ ├── agents.yaml # Agent definitions (role, goal, backstory)
│ └── tasks.yaml # Task definitions (description, output)
│
├── src/
│ ├── agents.py # Loads agents from YAML
│ ├── tasks.py # Loads tasks from YAML
│ ├── tools.py # Serper search tool setup
│ └── crew.py # Crew orchestration
│
├── outputs/
│ └── output.txt # Final generated article
│
├── screenshots/
│ └── example_run.png
│
└── requirements.txt
Given a topic like:
AI in Healthcare
The system automatically:
- Searches the internet for relevant information
- Extracts important trends and insights
- Structures the information
- Writes a clean, readable article
User Topic
↓
Research Agent (Web Search via Serper)
↓
Structured Research Output
↓
Writer Agent (Gemini LLM)
↓
Final Article (Markdown/Text)
- Searches the web for relevant information
- Identifies trends, risks, and opportunities
- Collects structured insights
Tool used: Serper API (Google Search)
- Uses research output
- Converts findings into a readable article
- Formats output in markdown/text
Tool used: Gemini 2.5 Flash LLM
Instead of hardcoding agents and tasks in Python, this project uses YAML configuration files.
- Cleaner code
- Easier to update prompts
- No need to modify Python logic
- Better scalability for new agents
researcher:
role: Senior Researcher
goal: Research and analyze {topic}
backstory: Expert in identifying tech trends and insights
writer:
role: Tech Writer
goal: Write engaging articles about {topic}
backstory: Skilled in simplifying complex technical ideasresearch_task:
description: Research latest trends in {topic}
expected_output: Structured research report
write_task:
description: Write article using research findings
expected_output: Markdown article with clear sections- 🧠 CrewAI — Multi-agent orchestration
- 🔎 Serper API — Google Search integration
- 🤖 Google Gemini — LLM for generation
- 🐍 Python — Core language
- 🔧 PyYAML — Configuration handling
- 📦 python-dotenv — Environment variable management
git clone <your-repo-url>
cd crewai-learningpip install -r requirements.txtCreate a .env file:
GEMINI_API_KEY=your_gemini_api_key
SERPER_API_KEY=your_serper_api_keypython src/crew.pyFinal generated article is saved in:
outputs/output.txt
It includes:
- Summary of topic
- Key trends
- Market insights
- Future outlook
Traditional LLM apps:
- Single prompt → single response
- Limited reasoning structure
- Hard to scale workflows
This project demonstrates:
✔ Multi-step reasoning ✔ Agent-based decomposition ✔ Tool usage (search + LLM) ✔ Real workflow orchestration
- Add Fact Checker Agent
- Add SEO Optimization Agent
- Switch fully to
@CrewBasearchitecture - Add vector database memory
- Deploy using FastAPI
- Add UI using Streamlit or Next.js
Built as a learning project for understanding CrewAI and agentic AI systems.