Connect an email account and Draftline reads incoming mail, classifies and prioritizes it, and writes a grounded reply draft from your uploaded knowledge base — with citations and a confidence signal. You review, edit, and decide.
Draftline never sends email. Drafts live in-app and, only on your explicit action, are written to your provider's Drafts folder. There is no send path.
This is the pattern teams keep asking for: Gmail → read → AI classify + prioritize → RAG draft → human approves → nothing auto-sent. Human-in-the-loop by design, grounded rather than hallucinated, and small enough to reason about.
| Layer | Choice |
|---|---|
| Frontend | Next.js (App Router) · TypeScript · Tailwind · shadcn/ui — Vercel |
| Backend | FastAPI · Python 3.12 · uvicorn · Pydantic v2 — Render |
| DB / Auth | Supabase (Postgres + Auth + pgvector) |
| DB access | SQLAlchemy 2.0 async + asyncpg |
Gmail API (read + drafts.create only) |
|
| LLM | Groq — llama-3.1-8b-instant (classify) · llama-3.3-70b-versatile (draft) |
| Embeddings | Google Gemini text-embedding-004 (768 dims) |
draftline/
├── web/ Next.js frontend (App Router, TypeScript)
└── api/ FastAPI backend (async)
🚧 In active development, built phase by phase.
- Phase 0 — Foundation: repo, auth, DB schema, authenticated round-trip
- Phase 1 — Connect Gmail (OAuth) + sync unread mail into the app
- Phase 2 — Auto-classify: category + priority + reason (Groq JSON mode)
- Phase 3 — Knowledge base: upload → chunk → embed (Gemini) → pgvector retrieval
- Phase 4 — Grounded reply drafts with citations; review, edit, Save to Gmail (never sent)
- Phase 5 — Dashboard, filterable audit log, editable settings, and a polish pass (loading/empty/error states, mobile)
- Phase 6 — Deploy + demo assets
See web/README.md and api/README.md.
Copy each .env.example to .env and fill in your own keys. Never commit
secrets — .env* files are gitignored.