Built entirely on Cloudflare's platform: Workers AI, Vectorize, Durable Objects, and Pages.
SupportWise lets teams upload their support documentation (FAQs, guides, product docs) and instantly query them using natural language. The AI finds the most relevant sections and generates accurate answers with source citations, reducing ticket resolution time.
┌─────────────────────────────────────────────────────┐
│ User (Browser) │
│ Upload Docs ←→ Ask Questions │
└──────────────┬──────────────────┬────────────────────┘
│ │
POST /api/upload POST /api/ask
│ │
┌──────────────▼──────────────────▼────────────────────┐
│ Cloudflare Worker (index.ts) │
│ Routing · Orchestration · CORS │
└──────┬──────────┬───────────────┬────────────────────┘
│ │ │
┌────▼───┐ ┌───▼────────┐ ┌────▼──────────────┐
│Workers │ │ Vectorize │ │ Durable Objects │
│ AI │ │ (Embeddings │ │ (Chat Session │
│ │ │ Storage) │ │ Memory) │
│- Embed │ │ │ │ │
│ (BGE) │ │- Store │ │- Store messages │
│- LLM │ │- Query │ │- Retrieve history │
│(Llama) │ │- Similarity │ │ │
└────────┘ └─────────────┘ └───────────────────┘
| Requirement | Cloudflare Product | Implementation |
|---|---|---|
| LLM | Workers AI | Llama 3.3 70B for answers, BGE-base for embeddings |
| Workflow/Coordination | Workers | Orchestrates: chunk → embed → store → retrieve → generate |
| User Input (Chat) | Pages + Workers API | Chat UI with document upload (PDF/TXT/MD) |
| Memory/State | Vectorize + Durable Objects | Vector embeddings + per-session chat history |
- Document Upload — Drag-and-drop PDF, TXT, or Markdown files
- Intelligent Chunking — Documents are split into overlapping chunks for better retrieval
- Semantic Search — Questions are embedded and matched against document chunks via cosine similarity
- AI-Generated Answers — Llama 3.3 generates answers grounded in retrieved context
- Source Citations — Every answer shows which documents and sections it drew from, with confidence scores
- Session Memory — Chat history persists per session via Durable Objects
- Node.js v18+
- Cloudflare account (free tier works)
- Wrangler CLI
git clone https://github.com/YOUR_USERNAME/cf_ai_supportwise.git
cd cf_ai_supportwisenpm installnpx wrangler loginnpm run create-indexThis creates a Vectorize index named support-docs-index with 768 dimensions (matching BGE-base embeddings) and cosine similarity metric.
npm run devOpen http://localhost:8787 in your browser.
- Upload a support document (try a FAQ or product guide as a
.txtor.pdf) - Wait for processing confirmation
- Ask a question related to the document content
- View the AI-generated answer with source citations
npm run deployYour app will be live at https://cf-ai-supportwise.<your-subdomain>.workers.dev.
Live Demo: https://cf-ai-supportwise.dkumar247.workers.dev
cf_ai_supportwise/
├── src/
│ ├── index.ts # Main Worker: routes, Durable Object, orchestration
│ ├── embeddings.ts # Document chunking, embedding, Vectorize storage
│ ├── rag.ts # RAG pipeline: retrieve context → generate answer
│ └── types.ts # TypeScript interfaces
├── frontend/
│ └── index.html # Chat UI (Cloudflare-branded)
├── wrangler.toml # Cloudflare configuration
├── package.json
├── tsconfig.json
├── README.md
└── PROMPTS.md
- Runtime: Cloudflare Workers
- LLM:
@cf/meta/llama-3.3-70b-instruct-fp8-fastvia Workers AI - Embeddings:
@cf/baai/bge-base-en-v1.5via Workers AI - Vector DB: Cloudflare Vectorize (768-dim, cosine similarity)
- State: Durable Objects (session chat history)
- Frontend: Vanilla HTML/CSS/JS served via Workers Sites
- Language: TypeScript
MIT