Three AI agents collaborate to research, write, and polish articles on any topic.
A portfolio-ready multi-agent application built with crewAI, FastAPI, and React + Tailwind. Watch in real-time as the Planner, Writer, and Editor agents work through a pipeline — from outline to polished article.
You type a topic → Planner researches → Writer drafts → Editor polishes → You get a full article
The UI shows each agent's progress live with an animated timeline — not just a spinner.
- Python 3.11+
- Node.js 18+
- At least one LLM API key (Groq recommended — free tier, very fast)
| Provider | Sign-up | Free tier? | Speed |
|---|---|---|---|
| Groq (recommended) | console.groq.com/keys | ✅ 1,000 req/day | ⚡ Very fast |
| Gemini | aistudio.google.com | ✅ 1,500 req/day | 🚀 Fast |
| OpenRouter | openrouter.ai/keys | ✅ Limited | 🏃 Good |
git clone <your-repo-url>
cd research-write-article
# Copy the env template and add your key
cp .env.example .env
# Edit .env → paste your API key into GROQ_API_KEY (or GEMINI_API_KEY)# Backend
pip install -r requirements.txt
# Frontend
cd frontend
npm install
cd ..Terminal 1 — Backend:
python backend/main.py
# → http://localhost:8000 | Swagger: http://localhost:8000/docsTerminal 2 — Frontend:
cd frontend
npm run dev
# → http://localhost:5173Open http://localhost:5173, type a topic, and watch the agents work.
Pushing to main triggers automatic deploys — only the part that changed:
| Change in... | Deploys |
|---|---|
backend/** |
→ Render |
frontend/** |
→ Vercel |
| Both | → Both (in parallel) |
- Render deploy hook:
- dashboard.render.com → click your service name
- Settings tab → scroll to "Deploy Hook" section → copy the URL
- Looks like:
https://api.render.com/deploy/srv-...?key=...
- Vercel deploy hook:
- vercel.com → your project → Settings tab
- Left sidebar: Git → "Deploy Hooks" → Create Hook → copy URL
- Looks like:
https://api.vercel.com/v1/integrations/deploy/prj_.../...
- Add to GitHub Secrets (repo → Settings → Secrets and variables → Actions):
RENDER_DEPLOY_HOOK_URL— your Render hookVERCEL_DEPLOY_HOOK_URL— your Vercel hookVITE_API_URL—https://your-app.onrender.com
Workflows live in .github/workflows/:
deploy-backend.yml— validates Python imports, triggers Renderdeploy-frontend.yml— builds Vite app, triggers Vercel
You have two options:
Two separate services, each doing what they're best at.
- Push your code to GitHub
- Go to dashboard.render.com → New + → Web Service
- Click "Build and deploy from a Git repository" → connect GitHub → select your repo
- Fill the form:
| Field | Value |
|---|---|
| Name | research-write-article (becomes research-write-article.onrender.com) |
| Region | Ohio (US East) or closest to you |
| Branch | main |
| Runtime | Python 3 |
| Build Command | pip install -r requirements.txt |
| Start Command | cd backend && uvicorn main:app --host 0.0.0.0 --port $PORT |
| Instance Type | Free |
- Scroll down to Advanced → Add Environment Variable and add:
| Key | Value |
|---|---|
GROQ_API_KEY |
gsk_your_key_here |
GEMINI_API_KEY |
(if you have one) |
PROVIDER_PRIORITY |
groq,gemini,openrouter,huggingface |
- Click Create Web Service → Render builds & deploys. Your API is live at
https://research-write-article.onrender.com. Verify: open/docsfor the Swagger UI.
- Go to vercel.com → Add New → Project
- Import your repo
- Set Root Directory to
frontend - Add environment variable:
| Key | Value |
|---|---|
VITE_API_URL |
https://your-app.onrender.com |
- Click Deploy → your frontend is live at
https://your-app.vercel.app
⚠️ Render free tier: the backend sleeps after 15 min of inactivity. First request takes ~30s to wake. Use UptimeRobot (free) to ping it every 10 min and keep it alive.
Everything in one place, no cold starts, optional GPU access. Deploy once and it stays alive.
- Create a Dockerfile at the project root (see Docker deployment below)
- Go to huggingface.co/new-space
- Choose Docker as the Space SDK
- Connect your GitHub repo (or upload directly)
- Add your API keys as Space Secrets
- Your app is live at
https://huggingface.co/spaces/<your-username>/<space-name>
Trade-off: simpler to manage, always online, but serves the frontend from FastAPI rather than a CDN — slightly less optimal for static assets. Better for demo/portfolio; less "production-grade" in architecture.
Create a Dockerfile in the project root:
FROM python:3.11-slim
WORKDIR /app
# Install Node.js for frontend build
RUN apt-get update && apt-get install -y curl \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Backend dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Frontend build
COPY frontend/package.json frontend/package-lock.json* frontend/
RUN cd frontend && npm install
COPY . .
# Build React app and copy to backend static folder
RUN cd frontend && npm run build
RUN mkdir -p backend/static && cp -r frontend/dist/* backend/static/
EXPOSE 7860
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]Then in HuggingFace Spaces:
- Create a new Space → choose Docker
- Push this repo (with the Dockerfile) to the Space's repository
- Add your
GROQ_API_KEYas a Secret in Space Settings - Done!
research-write-article/
├── backend/
│ ├── main.py ← FastAPI app (endpoints: /api/generate, /api/health)
│ ├── config.py ← Environment configuration (Pydantic)
│ ├── providers.py ← Multi-provider fallback router (Groq→Gemini→OpenRouter→HF)
│ └── agents.py ← CrewAI pipeline (Planner → Writer → Editor) + SSE streaming
├── frontend/
│ ├── src/
│ │ ├── App.jsx ← Main app: SSE client, state management
│ │ └── components/
│ │ ├── Hero.jsx ← Landing section
│ │ ├── TopicInput.jsx ← Topic input + generate button
│ │ ├── AgentProgress.jsx ← Animated 3-step agent timeline
│ │ ├── ArticleResult.jsx ← Markdown-rendered article + copy/regenerate
│ │ └── HowItWorks.jsx ← Multi-agent system explanation
│ ├── package.json
│ └── vite.config.js
├── specs/article-agent-demo/ ← Design docs, requirements, tasks, deployment guide
├── CLAUDE.md ← AI assistant project guide
├── .env.example ← Environment variables template
└── requirements.txt ← Python dependencies
The system tries LLM providers in this order (configurable via PROVIDER_PRIORITY):
Groq → Gemini → OpenRouter → HuggingFace
If one fails (no credits, network error, rate limit), it automatically tries the next. You only need one API key configured — the first working provider wins.
To change the order, edit PROVIDER_PRIORITY in your .env or Render/Vercel environment variables.
Stream article generation progress via Server-Sent Events (SSE).
Request:
{ "topic": "Artificial Intelligence in Healthcare" }Response (SSE stream):
data: {"step":"planning","status":"running","message":"Planner is researching..."}
data: {"step":"planning","status":"completed","message":"Outline ready."}
data: {"step":"writing","status":"running","message":"Writer is crafting..."}
data: {"step":"writing","status":"completed","message":"Draft ready."}
data: {"step":"editing","status":"running","message":"Editor is polishing..."}
data: {"step":"editing","status":"completed","message":"Article polished."}
data: {"step":"done","status":"completed","message":"{\"article\":\"...\",\"provider\":\"groq\"}"}
{ "status": "ok", "configured_providers": ["groq", "gemini"] }Change the AI model in .env:
# Fast & powerful (Groq):
DEFAULT_MODEL=groq/llama-3.3-70b-versatile
# Cheapest (Groq):
DEFAULT_MODEL=groq/llama-3.1-8b-instant
# Good balance (Gemini, also free):
DEFAULT_MODEL=gemini/gemini-2.5-flash| Layer | Technology |
|---|---|
| Agent framework | crewAI |
| Backend | FastAPI + Pydantic |
| LLM routing | LiteLLM |
| Frontend | React 18 + Vite |
| Styling | Tailwind CSS |
| Animations | Framer Motion |
| Article rendering | react-markdown |
Built as a portfolio demo showcasing multi-agent AI systems.
Powered by crewAI and open-source LLM providers.
Last updated: June 2026