Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlogWritingCrew Banner

BlogWritingCrew

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.

Python 3.10+ CrewAI License: MIT


Overview

BlogWritingCrew automates the entire blog creation pipeline using four specialized AI agents working in sequence:

  1. Researcher — Gathers key facts, trends, and insights
  2. Writer — Crafts an engaging, well-structured blog post
  3. Editor — Polishes grammar, clarity, flow, and readability
  4. Social Media Manager — Creates Twitter/X threads and LinkedIn posts

Feed it a topic, get publication-ready content — zero manual intervention.


Features

  • 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

Architecture

┌─────────────────────────────────────────────────────────┐
│                    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                                    │
└─────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

  • Python 3.10 or higher
  • An OpenAI API key (or compatible LLM provider)

Installation

# Clone the repository
git clone https://github.com/ronakmunjapara/BlogWritingCrew.git
cd BlogWritingCrew

# Install uv (if not already installed)
pip install uv

# Install dependencies
crewai install

Configuration

Create a .env file in the project root:

OPENAI_API_KEY=your-api-key-here

Run

crewai run

You'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.


Configuration

Agents (config/agents.yaml)

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 (config/tasks.yaml)

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.md

Project Structure

blog_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

Available Commands

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

Output

After running, check the output/ directory:

  • blog_post.md — A polished 800-1000 word blog post with title, introduction, 3-4 sections, and conclusion
  • social_posts.md — A Twitter/X thread (5-7 tweets) and LinkedIn post summary

Customization

Adding Tools

Install the tools package:

uv add crewai-tools

Then 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
    )

Changing the LLM

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
    )

Using Reviewed X/Twitter Source Context

The crew can read optional X/Twitter source notes from knowledge/x_source_context.txt before the researcher starts. Use this for approved public post URLs, audience questions, tone notes, and claims that should shape the blog post and social thread.

You can write the note manually or collect reviewed source evidence with TweetClaw. Keep the note short and source-focused:

Goal: Create a launch recap for an AI writing tool.
Audience: indie hackers and technical founders.
Approved URLs:
- https://x.com/example/status/123
Observed questions:
- How does the workflow keep social posts grounded?
Claims to avoid:
- Do not claim benchmark results.
Tone notes:
- Practical, specific, no hype.

Leave knowledge/x_source_context.txt absent when the crew should use only the entered topic.


Requirements

  • Python >=3.10, <3.14
  • crewai[tools] == 1.14.7

See pyproject.toml for full dependency list.


Author

@ronakmunjapara


Acknowledgments

  • Built with CrewAI — the framework for orchestrating role-playing AI agents
  • Powered by OpenAI GPT models

License

This project is licensed under the MIT License. See LICENSE for details.

About

BlogWritingCrew - A CrewAI multi-agent blog writing system with 4 agents: - Researcher - Finds key facts and trends - Writer - Creates blog content - Editor - Polishes and refines - Social Media Manager - Creates Twitter/LinkedIn posts

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages