QuotePilot is an AI-assisted CPQ workflow for creating budgetary SaaS quotes from natural-language sales requests. A seller can describe the customer, country, products, quantities, and commercial intent in chat; QuotePilot resolves the structured quote, asks for missing information, prices from the backend catalog, retrieves policy context from Pinecone, shows an editable draft, and generates a professional PDF.
The core design rule is intentional: the LLM helps interpret the request and retrieve policy context, but exact products, prices, tax, discounts, totals, quote ownership, and PDF generation are controlled by Django backend logic.
- Stateful agent workflow with LangGraph for multi-turn quote creation.
- RAG-backed policy retrieval using OpenAI embeddings and Pinecone.
- Deterministic pricing, tax, discount, and quote-line snapshot logic.
- Django REST APIs with token auth, quote ownership, admin-managed catalog data, and PDF downloads.
- React + TypeScript dashboard with chat, live quote draft, editable line quantities, discount updates, quote history, CSV export, and knowledge upload.
- ReportLab PDF generation with quote-time policy snapshots for auditability.
- Production deployment configuration for Render Web Services, Render Postgres, and a static React frontend.
- Backend: Django 5, Django REST Framework, LangGraph, ReportLab, Gunicorn, WhiteNoise
- Frontend: Vite, React, TypeScript, Tailwind CSS, Playwright
- Database: SQLite locally, PostgreSQL in production through
DATABASE_URL - RAG: OpenAI
text-embedding-3-smallembeddings with Pinecone namespace retrieval - Deployment: Docker Compose for DigitalOcean VPS, plus optional Render blueprint
flowchart LR
User["Sales user"] --> UI["React TypeScript dashboard"]
UI --> API["Django REST API"]
API --> Agent["LangGraph quote agent"]
Agent --> DB["Postgres products, quotes, tax rules"]
Agent --> Pinecone["Pinecone policy vectors"]
Agent --> OpenAI["OpenAI extraction + embeddings"]
API --> PDF["ReportLab PDF generator"]
PDF --> Media["Persistent media storage"]
- Complete quote:
Create a budgetary quote for Acme Corp in Singapore for 20 CRM Pro seats and analytics. - Missing info:
Create a quote for 50 CRM users. - Ambiguous product:
Quote CRM for Acme Corp in India. - Modification:
Change CRM Pro to 17 seats and apply 10 percent discount. - Approval:
Looks good, generate the PDF.
Backend:
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py seed_demo
python manage.py runserverFrontend:
cd frontend
pnpm install
cp .env.example .env
pnpm devOpen http://127.0.0.1:5173.
Backend variables:
SECRET_KEY=replace-me
DEBUG=False
ALLOWED_HOSTS=your-api.onrender.com
FRONTEND_URL=https://your-frontend.onrender.com
CORS_ALLOWED_ORIGINS=https://your-frontend.onrender.com
CSRF_TRUSTED_ORIGINS=https://your-api.onrender.com,https://your-frontend.onrender.com
DATABASE_URL=postgresql://...
MEDIA_ROOT=/var/data/media
OPENAI_API_KEY=...
OPENAI_MODEL=gpt-4o-mini
OPENAI_EMBEDDING_MODEL=text-embedding-3-small
OPENAI_EMBEDDING_DIMENSIONS=1024
PINECONE_API_KEY=...
PINECONE_INDEX=quotepilot-kb
PINECONE_NAMESPACE=quotepilot-productionFrontend variable:
VITE_API_BASE_URL=https://your-api.onrender.com/apiThe repo includes a VPS deployment bundle in deploy/digitalocean:
- Django API container
- Postgres 16 container with persistent volume
- Caddy reverse proxy with automatic HTTPS
- conservative Postgres memory settings for a 1 GB Droplet
- one Gunicorn worker with two threads for low-memory stability
Recommended split:
- Backend + DB: DigitalOcean Droplet
- Frontend: Vercel
- DNS: Cloudflare or your domain registrar
- RAG/LLM: Pinecone and OpenAI
Quick deployment shape:
git clone https://github.com/djm-1/QuotePilot.git
cd QuotePilot/deploy/digitalocean
cp .env.example .env
docker compose up -d --buildRead the full VPS guide in deploy/digitalocean/README.md.
For a 1 GB Droplet, enable 2 GB swap before starting containers. It can run QuotePilot for light portfolio traffic, but upgrade to 2 GB or 4 GB if you also host SupportBench on the same VPS.
Use Vercel for the React frontend:
- Import
https://github.com/djm-1/QuotePilot.git. - Set the project root directory to
frontend. - Build command:
pnpm build. - Output directory:
dist. - Environment variable:
VITE_API_BASE_URL=https://api.yourdomain.com/apiAfter Vercel deploys, update the backend .env on the Droplet:
FRONTEND_URL=https://your-vercel-app.vercel.app
CORS_ALLOWED_ORIGINS=https://your-vercel-app.vercel.app
CSRF_TRUSTED_ORIGINS=https://api.yourdomain.com,https://your-vercel-app.vercel.appThen restart the backend:
cd QuotePilot/deploy/digitalocean
docker compose up -dThe repo includes a root-level render.yaml blueprint with:
quotepilot-api: Django web servicequotepilot-web: static React frontendquotepilot-db: managed Postgres/var/datapersistent disk for generated PDFs- pre-deploy migrations and catalog seeding
Recommended Render flow:
- Push this repository to GitHub.
- In Render, create a new Blueprint from the repo.
- Set the unsynced backend env vars:
OPENAI_API_KEY,PINECONE_API_KEY,PINECONE_INDEX,FRONTEND_URL,CORS_ALLOWED_ORIGINS, andCSRF_TRUSTED_ORIGINS. - Set frontend
VITE_API_BASE_URLtohttps://<api-service>.onrender.com/api. - Deploy the API first, then update/redeploy the frontend after the API URL is known.
- Visit
/healthz/on the API service to confirm the backend is live. - Register a user from the UI, download the vendor policy pack, upload it through Knowledge, then create a quote.
For production demos, use paid Render services. Free web services can sleep and make the portfolio feel unreliable.
Create an admin user:
cd backend
python manage.py createsuperuserSeed catalog and tax data:
python manage.py seed_demoReplace the active Pinecone policy pack from the bundled PDF:
python manage.py replace_policy_pack ../output/pdf/quotepilot-vendor-policy-pack.pdf --source-name quotepilot-vendor-policy-packProduct catalog, tax rules, customers, quotes, and audit events live in Postgres. Active policy text lives in Pinecone; Django stores lightweight metadata previews and quote-time policy snapshots.
POST /api/auth/register/POST /api/auth/login/POST /api/chat/sessions/POST /api/chat/sessions/{id}/messages/GET /api/products/GET /api/quotes/GET /api/quotes/{id}/PATCH /api/quotes/{id}/POST /api/quotes/{id}/generate-pdf/GET /api/quotes/{id}/download/GET /api/knowledge/documents/POST /api/knowledge/upload/GET /api/knowledge/policy-pack/download/
Backend:
cd backend
.venv/bin/python manage.py test quotesFrontend build:
cd frontend
pnpm buildEnd-to-end smoke tests:
cd frontend
pnpm test:e2eQuotePilot is intentionally scoped as an MVP, but it is built around real production concerns: ownership boundaries, audit snapshots, deterministic pricing, Pinecone-primary knowledge retrieval, editable drafts, generated PDFs, and deployment-ready service configuration. The project is a better resume signal than a generic CRUD app because it combines full-stack engineering, backend business rules, agent workflow design, and practical AI integration.