An AI-powered multi-agent blog writing system built with CrewAI. Just enter a topic and get a fully researched, edited blog post + social media content — automatically.
BlogWritingCrew automates the entire blog creation pipeline using four specialized AI agents working in sequence:
- Researcher — Gathers key facts, trends, and insights
- Writer — Crafts an engaging, well-structured blog post
- Editor — Polishes grammar, clarity, flow, and readability
- Social Media Manager — Creates Twitter/X threads and LinkedIn posts
Feed it a topic, get publication-ready content — zero manual intervention.
- Interactive topic input — just type what you want a blog about
- 4-agent pipeline — research, writing, editing, social media
- Sequential execution — each agent builds on the previous agent's output
- Auto-generated outputs — blog post + social media posts saved to
output/ - Trainable — improve agent performance over iterations
- Testable — evaluate crew quality with built-in test commands
┌─────────────────────────────────────────────────────────┐
│ User Input │
│ (Enter Topic) │
└────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Researcher Agent │
│ • Investigates topic thoroughly │
│ • Produces structured research brief │
└────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Writer Agent │
│ • Crafts blog post from research brief │
│ • 800-1000 words with sections & subheadings │
└────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Editor Agent │
│ • Polishes for clarity, grammar, flow │
│ • Ensures publication-ready output │
└────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Social Media Manager Agent │
│ • Twitter/X thread (5-7 tweets) │
│ • LinkedIn post summary │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ output/ │
│ ├── blog_post.md │
│ └── social_posts.md │
└─────────────────────────────────────────────────────────┘
- Python 3.10 or higher
- An OpenAI API key (or compatible LLM provider)
# Clone the repository
git clone https://github.com/ronakmunjapara/CrewAIBlogPost.git
cd CrewAIBlogPost/blog_writing_crew
# Install uv (if not already installed)
pip install uv
# Install dependencies
crewai installCreate a .env file in the project root:
OPENAI_API_KEY=your-api-key-herecrewai runYou'll be prompted to enter a topic:
Enter the blog topic: How AI is transforming healthcare
The crew will research, write, edit, and generate social media content automatically. Results are saved in the output/ directory.
Each agent is defined with a role, goal, and backstory. Agents use {topic} variables that get populated from your input:
researcher:
role: "{topic} Research Analyst"
goal: "Find the most important information about {topic}"
backstory: "You are a thorough researcher who digs deep into any subject."
writer:
role: "{topic} Blog Writer"
goal: "Write an engaging blog post about {topic}"
backstory: "You turn complex research into compelling blog content."Tasks define what each agent does and what output is expected:
research_task:
description: "Research {topic} thoroughly..."
expected_output: "A structured research brief with 8-10 key points..."
agent: researcher
editing_task:
description: "Review and polish the blog post..."
expected_output: "A final, polished blog post ready for publication..."
agent: editor
output_file: output/blog_post.mdblog_writing_crew/
├── src/blog_writing_crew/
│ ├── config/
│ │ ├── agents.yaml # Agent definitions
│ │ └── tasks.yaml # Task definitions
│ ├── tools/
│ │ └── custom_tool.py # Custom tool implementations
│ ├── crew.py # Crew orchestration
│ └── main.py # Entry point
├── knowledge/
│ └── user_preference.txt # User knowledge base
├── output/
│ ├── blog_post.md # Generated blog posts
│ └── social_posts.md # Generated social content
├── .env # API keys (not committed)
├── pyproject.toml # Project configuration
└── README.md
| Command | Description |
|---|---|
crewai run |
Run the blog writing crew interactively |
crewai train <n> <file> |
Train the crew for n iterations |
crewai test <n> <model> |
Test crew execution n times |
crewai replay <task_id> |
Replay from a specific task |
crewai reset-memories -a |
Reset all crew memories |
After running, check the output/ directory:
blog_post.md— A polished 800-1000 word blog post with title, introduction, 3-4 sections, and conclusionsocial_posts.md— A Twitter/X thread (5-7 tweets) and LinkedIn post summary
Install the tools package:
uv add crewai-toolsThen add tools to agents in crew.py:
from crewai_tools import SerperDevTool
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher'],
tools=[SerperDevTool()],
verbose=True
)Update the model in crew.py or use the llm parameter:
from crewai import LLM
@agent
def writer(self) -> Agent:
return Agent(
config=self.agents_config['writer'],
llm=LLM(model="anthropic/claude-sonnet-4-20250514"),
verbose=True
)- Python >=3.10, <3.14
- crewai[tools] == 1.14.7
See pyproject.toml for full dependency list.
- Built with CrewAI — the framework for orchestrating role-playing AI agents
- Powered by OpenAI GPT models
This project is licensed under the MIT License. See LICENSE for details.