PostDraft is an agentic AI LinkedIn post generator and automated editorial reviewer. Built with LangGraph, Groq (llama-3.3-70b-versatile), a FastAPI backend, and a modern Next.js + shadcn/ui frontend.
It drafts LinkedIn posts, gathers real-time search context using Tavily when needed, evaluates drafts against a strict 7-point editorial checklist, and iterates through up to 3-5 revisions until publish-ready.
- ⚡ 100% OpenAI-free: Powered entirely by LangChain Groq (
ChatGroq) using ultra-fast models such asllama-3.3-70b-versatileandllama-3.1-8b-instant. - 🔄 LangGraph Multi-Agent Architecture:
- Writer Agent: Composes high-performing posts tailored to your selected tone, audience, and custom constraints.
- Tavily Search Tool: Integrates real-time web search for fresh facts, statistics, and industry news.
- Editorial Reviewer Agent: Evaluates drafts strictly against the 7 LinkedIn quality criteria:
- Scroll-stopping hook in first 1–2 lines
- One clear, valuable takeaway
- High skimmability (short paragraphs, 1–3 sentences each)
- Optimal length (~150–200 words)
- Engaging closing question or CTA
- Authentic, human voice (no robotic AI fluff)
- Zero hashtags
- Automated Revision Loop: If rejected, the reviewer provides constructive feedback and the writer creates an improved draft fixing every issue.
- 🚀 FastAPI Backend:
- Full REST API + Server-Sent Events (SSE) streaming for real-time progress updates.
- Interactive Swagger API documentation at
/docs.
- 🎨 Next.js & shadcn/ui Frontend:
- Authentic LinkedIn desktop post preview with realistic formatting and social metrics.
- Live agent stepper visualizing graph execution (Research → Writer → Reviewer → Revisions → Approved).
- Reviewer rubric scorecard and attempt revision history with exact critique notes.
- One-click copy, word count sweet spot indicator, and inline editing.
- In-app API key and model configuration modal.
- LLM Engine: Groq via
langchain-groq(llama-3.3-70b-versatile) - Agent Orchestration: LangGraph
- Backend: FastAPI, Uvicorn, Pydantic, SSE Starlette
- Frontend: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS, shadcn/ui design system, Lucide Icons
Start both the FastAPI backend and Next.js frontend together with a single command:
python run.pyThis starts:
- FastAPI Backend:
http://127.0.0.1:8000(Docs:http://127.0.0.1:8000/docs) - Next.js Web UI:
http://localhost:3000
- Create and activate a Python virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install backend dependencies:
pip install -r requirements.txt- Configure your environment variables in
.env:
GROQ_API_KEY=gsk_your_groq_api_key_here
TAVILY_API_KEY=tvly_your_tavily_key_optional
GROQ_MODEL=llama-3.3-70b-versatileNote: A free Groq API key can be obtained from Groq Console. Tavily search is optional; if omitted, the writer generates drafts without web search.
- Start the FastAPI backend server:
python -m uvicorn backend.main:app --reload --port 8000The API will be available at http://localhost:8000 with interactive docs at http://localhost:8000/docs.
- Open a new terminal in the
frontendfolder:
cd frontend
npm install- Run the Next.js development server:
npm run dev- Open http://localhost:3000 in your browser.
You can also run PostDraft directly in your terminal:
python main.py --cliOr start the FastAPI server via the CLI entrypoint:
python main.py --serverReturns configured services and available Groq models.
Generates a post synchronously.
Request Body:
{
"topic": "Why simple architecture beats clever complexity",
"tone": "Thought Leadership",
"audience": "Tech Leaders & Engineers",
"custom_instructions": "Focus on real-world maintenance cost",
"use_search": true,
"max_attempts": 3,
"model_name": "llama-3.3-70b-versatile"
}Streams agent events via Server-Sent Events (SSE) in real time.