Skip to content

FelixBitSoul/contentCrew-AI

Repository files navigation

ContentCrew AI

AI-Powered Multi-Agent Content Creation Platform

English | 简体中文


ContentCrew AI is a multi-agent content creation platform built on the CrewAI framework. Through the collaborative workflow of multiple AI agents—Researcher, Writer, Editor, and SEO Specialist—it helps users rapidly generate high-quality articles, reports, LinkedIn posts, product descriptions, and more.

✨ Features

  • 🤖 Multi-Agent Collaboration: Researcher → Writer → Editor → SEO Specialist pipeline
  • ⚡ Real-time Streaming: SSE-based live streaming of agent execution logs
  • 🔍 Intelligent Web Search: Integrated Tavily API for automatic up-to-date information retrieval
  • 📝 Diverse Content Templates: Articles, reports, LinkedIn posts, product descriptions, blogs
  • ⚙️ Advanced Customization: Word count, tone, audience, language, custom prompts
  • 🔐 User Authentication: Supabase-based email/password and Google OAuth
  • 📊 Task Management: Complete task lifecycle with history tracking
  • 💰 Daily Quota Control: Built-in daily usage limit system

🏗️ Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                                User Layer                                  │
│                      ┌─────────────┐    ┌─────────────┐                  │
│                      │   Web App   │    │   Auth UI   │                  │
│                      │  (Next.js)  │    │ (Supabase)  │                  │
│                      └──────┬──────┘    └─────────────┘                  │
└─────────────────────────────┼─────────────────────────────────────────────┘
                              │
┌─────────────────────────────┼─────────────────────────────────────────────┐
│                         API Layer (FastAPI)                                 │
│                        ┌────┴────┐                                          │
│                        │  REST   │                                          │
│                        │  + SSE  │                                          │
│                        └────┬────┘                                          │
└─────────────────────────────┼─────────────────────────────────────────────┘
                              │
┌─────────────────────────────┼─────────────────────────────────────────────┐
│                      CrewAI Agent Layer                                     │
│   ┌────────────┐    ┌────────────┐    ┌────────────┐    ┌────────────┐     │
│   │  Researcher │──→│   Writer   │──→│   Editor   │──→│ SEO Adapter│     │
│   └──────┬──────┘    └────────────┘    └────────────┘    └────────────┘     │
│          │                                                                  │
│          └────────────────→ ┌────────────┐                                   │
│                             │ Tavily API │ (Web Search)                     │
│                             └────────────┘                                   │
└──────────────────────────────────────────────────────────────────────────────┘
                              │
┌─────────────────────────────┼─────────────────────────────────────────────┐
│                         Data Layer                                         │
│          ┌──────────────────┴──────────────────┐                          │
│          │                                      │                          │
│     ┌────┴────┐                           ┌────┴────┐                    │
│     │Supabase │                           │DeepSeek │                    │
│     │(PostgreSQL)                         │   LLM   │                    │
│     └─────────┘                           └─────────┘                    │
│          │                                                                │
│     ┌────┴────────┐                                                        │
│     │  Schema:     │                                                        │
│     │ contentcrew  │                                                        │
│     │  ├── users   │                                                        │
│     │  ├── tasks   │                                                        │
│     │  └── agent_logs                                                       │
│     └──────────────┘                                                        │
└────────────────────────────────────────────────────────────────────────────┘

🛠️ Tech Stack

Frontend

Technology Version Purpose
Next.js 16.2.4 React framework with App Router
React 19.2.4 UI library
TypeScript 5.x Type safety
Tailwind CSS v4 Utility-first CSS
Supabase Client 2.28.3 Auth & database
shadcn/ui 0.9.5 UI components

Backend

Technology Version Purpose
FastAPI 0.115.0 Python web framework
CrewAI 1.14.0 Multi-agent orchestration
DeepSeek - LLM API
Tavily 0.7.23 AI search engine
Supabase 2.28.3 PostgreSQL database
Pydantic 2.x Data validation
Uvicorn 0.44.0 ASGI server

📁 Project Structure

contentCrew-AI/
├── frontend/                    # Next.js Frontend
│   ├── app/
│   │   ├── page.tsx             # Home - Create task
│   │   ├── login/page.tsx       # Authentication
│   │   ├── run/[taskId]/        # Task execution (SSE streaming)
│   │   └── results/[taskId]/    # Task results
│   ├── lib/
│   │   ├── supabase.ts          # Supabase client
│   │   └── sse.ts               # SSE utilities
│   └── next.config.ts           # API proxy config
│
├── backend/                     # FastAPI Backend
│   ├── api/
│   │   └── tasks.py             # REST + SSE endpoints
│   ├── crew/
│   │   ├── crew.py              # CrewAI orchestration
│   │   ├── agents.py            # 4 agent definitions
│   │   ├── tasks.py             # Task definitions
│   │   ├── tools.py             # Tavily search
│   │   └── streaming.py         # Stream callbacks
│   ├── db/
│   │   ├── supabase.py          # Database operations
│   │   └── init.sql             # DB schema
│   └── main.py                  # App entry
│
└── .env.example                 # Environment template

🚀 Quick Start

Prerequisites

  • Node.js 18.0+
  • Python 3.12+
  • uv (Python package manager)
  • Supabase project

1. Clone

git clone https://github.com/yourusername/contentCrew-AI.git
cd contentCrew-AI

2. Environment Variables

cp .env.example .env

Required API keys:

Variable Source Purpose
DEEPSEEK_API_KEY DeepSeek LLM API
TAVILY_API_KEY Tavily Search API
SUPABASE_URL Supabase Database
SUPABASE_SERVICE_ROLE_KEY Supabase Dashboard Server DB access
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase Dashboard Client auth

3. Initialize Database

Execute backend/db/init.sql in Supabase SQL Editor.

4. Start Backend

cd backend
uv sync
uv run python main.py
# Runs at http://localhost:8000

5. Start Frontend

cd frontend
npm install
npm run dev
# Runs at http://localhost:3000

📡 API Endpoints

Authentication

All API requests require Supabase JWT:

Authorization: Bearer <access_token>

Endpoints

Method Endpoint Description
POST /api/tasks Create task
GET /api/tasks List tasks
GET /api/tasks/{id} Get task
GET /api/tasks/{id}/stream SSE - Stream execution logs
GET /api/tasks/{id}/logs Get history logs
DELETE /api/tasks/{id} Delete task
POST /api/tasks/{id}/cancel Cancel task

Create Task Example

curl -X POST http://localhost:8000/api/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "topic": "AI Development Trends 2024",
    "content_type": "Report",
    "word_count": 1500,
    "tone": "Professional",
    "audience": "Tech professionals",
    "language": "English",
    "include_seo": true
  }'

SSE Streaming (JavaScript)

const eventSource = new EventSource('/api/tasks/{id}/stream', {
  headers: { 'Authorization': 'Bearer <token>' }
});

eventSource.addEventListener('log', (e) => {
  const log = JSON.parse(e.data);
  console.log(`[${log.agent}] ${log.content}`);
});

eventSource.addEventListener('done', (e) => {
  const { result } = JSON.parse(e.data);
  console.log('Completed:', result);
});

🧠 Agent Workflow

┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Senior     │     │ Professional│     │  Critical   │     │  SEO &      │
│  Researcher │────→│   Writer    │────→│   Editor    │────→│  Social     │
│             │     │             │     │             │     │  Adapter    │
└──────┬──────┘     └─────────────┘     └─────────────┘     └─────────────┘
       │                                                           ↑
       │                                                    (Optional)
       ↓
┌─────────────┐
│ Tavily API  │  Web search for up-to-date information
└─────────────┘

Agent Responsibilities:

Agent Role Output
Senior Researcher Web search, fact verification Structured research summary
Professional Writer Content creation based on research Draft content
Critical Editor Fact-checking, flow optimization Polished content + SEO keywords
SEO Adapter (optional) SEO titles, meta descriptions, social versions SEO package

🗄️ Database Schema

-- Users
CREATE TABLE users (
    id TEXT PRIMARY KEY,           -- Supabase Auth user ID
    email TEXT NOT NULL,
    daily_count INTEGER DEFAULT 0, -- Daily usage count
    daily_reset_at TIMESTAMP
);

-- Tasks
CREATE TABLE tasks (
    id TEXT PRIMARY KEY,
    user_id TEXT REFERENCES users(id),
    status TEXT,                  -- pending/running/completed/failed/cancelled
    topic TEXT NOT NULL,
    config JSONB,                 -- Content parameters
    result TEXT,                  -- Generated content
    token_used INTEGER,
    created_at TIMESTAMP,
    completed_at TIMESTAMP
);

-- Agent Execution Logs
CREATE TABLE agent_logs (
    id TEXT PRIMARY KEY,
    task_id TEXT REFERENCES tasks(id),
    agent_name TEXT,              -- researcher/writer/editor/seo_adapter
    log_type TEXT,                -- thought/action/observation/result/status
    content TEXT,
    created_at TIMESTAMP
);

🚢 Deployment

Frontend (Vercel)

cd frontend
npm run build
vercel --prod

Environment Variables:

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • NEXT_PUBLIC_BACKEND_API_URL

Backend (Docker)

FROM python:3.12-slim
WORKDIR /app
RUN pip install uv
COPY . .
RUN uv sync
EXPOSE 8000
CMD ["uv", "run", "python", "main.py"]
docker build -t contentcrew-backend .
docker run -p 8000:8000 --env-file .env contentcrew-backend

❓ FAQ

Q: Styles not working?
Check: Tailwind v4 config, globals.css has @import "tailwindcss";

Q: API returns 401?
Check: Authorization: Bearer <token> header, token expiration (~1hr)

Q: SSE disconnects?
Set X-Accel-Buffering: no header, configure SSE_HEARTBEAT_INTERVAL_MS=20000

Q: Daily quota exceeded?
Wait for reset or modify quota logic in backend/db/supabase.py

📄 License

MIT License © 2024 ContentCrew AI


Built with ❤️ using Next.js, FastAPI, and CrewAI

About

ContentCrew AI is an end-to-end Agentic AI system that transforms a single prompt into high-quality, structured content through collaborative AI agents. Instead of relying on a single LLM response, it orchestrates a team of specialized agents — just like a real content team.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors