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:5173
Open 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