An open API service indexing awesome lists of open source software.

https://github.com/tonykipkemboi/crewai-content-creator-flow


https://github.com/tonykipkemboi/crewai-content-creator-flow

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

          

# Content Creator Flow - AI-Powered Content Generation System

A sophisticated multi-agent AI system powered by [crewAI](https://crewai.com) that generates high-quality content across different formats. This project demonstrates advanced flow-based orchestration of specialized AI crews for research reports, blog posts, and LinkedIn content creation.

## 🏗️ Architecture Overview

```mermaid
flowchart TB
Start([User Input]) --> Router{Content Type
Router}

Router -->|"1. Blog Post"| BloggerCrew[Blogger Crew]
Router -->|"2. LinkedIn Post"| LinkedInCrew[LinkedIn Post
Generator Crew]
Router -->|"3. Research Report"| ResearcherCrew[Researcher Crew]

%% Blogger Crew Details
BloggerCrew --> BA1[Senior Investigative
Technology Journalist]
BA1 --> BA2[Senior Staff Writer
Technology Section]
BA2 --> BA3[Editorial Director
& Senior Editor]
BA3 --> BlogOutput[blog_post.md]

%% LinkedIn Crew Details
LinkedInCrew --> LA1[Senior LinkedIn
Post Researcher]
LA1 --> LA2[Senior LinkedIn
Post Writer]
LA2 --> LinkedInOutput[linkedin_post.md]

%% Researcher Crew Details
ResearcherCrew --> RA1[Senior Content
Researcher]
RA1 --> RA2[Senior Content
Report Generator]
RA2 --> ResearchOutput[report.md]

%% Styling
classDef crew fill:#e1f5fe,stroke:#01579b,stroke-width:2px
classDef agent fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef output fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
classDef router fill:#f3e5f5,stroke:#6a1b9a,stroke-width:2px

class BloggerCrew,LinkedInCrew,ResearcherCrew crew
class BA1,BA2,BA3,LA1,LA2,RA1,RA2 agent
class BlogOutput,LinkedInOutput,ResearchOutput output
class Router router
```

## 🚀 Features

- **Multi-Crew Architecture**: Three specialized crews for different content types
- **Flow-Based Orchestration**: Dynamic routing based on user selection
- **High-Quality Content Generation**: Leverages Gemini 2.5 Flash with 100K token capacity
- **Professional Standards**: Blog crew simulates NYT editorial process
- **Web Research Integration**: Uses SerperDevTool for current information
- **Persistent State Management**: Tracks all generated content across the flow

## 📋 Content Types

### 1. Blog Post Generation
- **Crew**: Blogger Crew (3 agents)
- **Output**: 1,200-1,500 word NYT-style technology analysis
- **Process**: Research → Writing → Editorial Review
- **Agents**:
- Senior Investigative Technology Journalist
- Senior Staff Writer - Technology Section
- Editorial Director & Senior Editor

### 2. LinkedIn Post Generation
- **Crew**: LinkedIn Post Generator Crew (2 agents)
- **Output**: Engaging professional social media content
- **Process**: Research → Content Creation
- **Agents**:
- Senior LinkedIn Post Researcher
- Senior LinkedIn Post Writer

### 3. Research Report Generation
- **Crew**: Researcher Crew (2 agents)
- **Output**: Executive summary with key insights
- **Process**: Deep Research → Report Generation
- **Agents**:
- Senior Content Researcher
- Senior Content Report Generator

## Installation

Ensure you have Python >=3.10 <3.14 installed on your system. This project uses [UV](https://docs.astral.sh/uv/) for dependency management and package handling, offering a seamless setup and execution experience.

First, if you haven't already, install uv:

```bash
pip install uv
```

Next, navigate to your project directory and install the dependencies:

(Optional) Lock the dependencies and install them by using the CLI command:
```bash
crewai install
```

### Configuration

**1. Create and add your API keys into the `.env` file**

```bash
# Google AI API key (required)
GOOGLE_API_KEY=your_google_api_key_here

# Serper API key for web search (required)
SERPER_API_KEY=your_serper_api_key_here
```

- Get your Google AI API key from: https://aistudio.google.com/app/apikey
- Get your Serper API key from: https://serper.dev/

**2. Project Structure**

```
content_creator_flow/
├── src/content_creator_flow/
│ ├── main.py # Main flow orchestration
│ ├── crews/ # Individual crew configurations
│ │ ├── blogger/ # Blog post generation crew
│ │ ├── linkedin_post_generator/ # LinkedIn content crew
│ │ └── researcher/ # Research report crew
│ └── tools/ # Shared tools and utilities
├── output/ # Generated content output
│ ├── blog_post.md
│ ├── linkedin_post.md
│ └── report.md
└── crewai_flow.html # Flow visualization

## Running the Project

### Running the Flow

From the root folder of your project:

```bash
crewai run
```

Or using the alternative command:

```bash
python -m content_creator_flow.main
```

### Usage Example

When you run the project, you'll be prompted with:

```
🚀 CONTENT CREATOR FLOW
==================================================

📝 STEP 1: Topic Selection
-------------------------
Enter a topic for content creation: AI and Ethics

📋 STEP 2: Content Type Selection
--------------------------------
1. blog post
2. linkedin post
3. research report

Enter your choice (1, 2, or 3): 1

🔄 Starting AI workflow...
```

The system will then:
1. Route your request to the appropriate crew
2. Execute the multi-agent workflow
3. Save the generated content to the `output/` directory

### Visualizing the Flow

To generate a visual representation of the flow:

```bash
crewai plot
```

This creates `crewai_flow.html` which you can open in a browser to see the interactive flow diagram.

## 🔧 Advanced Configuration

### Customizing Agents

Each crew has its own configuration files:
- `src/content_creator_flow/crews/[crew_name]/src/[crew_name]/config/agents.yaml`
- `src/content_creator_flow/crews/[crew_name]/src/[crew_name]/config/tasks.yaml`

### Flow State Management

The flow uses Pydantic models for state management (main.py:15-21):
```python
class ContentCreatorState(BaseModel):
researcher_report: str = ""
linkedin_post: str = ""
blog_post: str = ""
content_type: str = ""
topic: str = ""
```

### Adding New Content Types

1. Create a new crew directory under `src/content_creator_flow/crews/`
2. Define agents and tasks in the config files
3. Add a new route in `main.py` router function
4. Create a listener method for the new crew

## 📊 Example Outputs

### Research Report
- Executive summary format
- Key insights and analysis
- Structured with title, summary, insights, conclusion, and sources

### Blog Post
- 1,200-1,500 words
- NYT Technology section style
- Includes byline, compelling headline, and expert quotes

### LinkedIn Post
- Concise and engaging
- Professional tone
- Includes relevant hashtags
- Call-to-action for engagement

## 🛠️ Troubleshooting

### Common Issues

1. **API Key Errors**: Ensure your `.env` file contains valid API keys
2. **Import Errors**: Run `crewai install` to ensure all dependencies are installed
3. **Token Limits**: The Gemini model has a 100K token limit - very long topics may need to be broken down

### Debug Mode

For verbose output during execution, agents and tasks are configured with `verbose=True` by default.

## 📈 Performance Considerations

- **LLM**: Uses Gemini 2.5 Flash for fast, cost-effective generation
- **Token Usage**: Each crew is configured with appropriate token limits
- **Sequential Processing**: Agents work sequentially to ensure quality control
- **Output Caching**: Generated content is saved to disk for reuse

## 🤝 Contributing

Feel free to submit issues, fork the repository, and create pull requests for any improvements.

## 📚 Resources

- [crewAI Documentation](https://docs.crewai.com)
- [crewAI GitHub](https://github.com/joaomdmoura/crewai)
- [Google AI Studio](https://aistudio.google.com/app/apikey)
- [Serper API](https://serper.dev/)

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

---

Built with ❤️ using crewAI - Let's create amazing content together!