An open-source RAG (Retrieval-Augmented Generation) chatbot framework built on Cloudflare's infrastructure. Deploy your own AI-powered document Q&A system in minutes.
Framework Note: This is an open-source framework designed for evaluation, demonstration, and rapid deployment. By default, it runs in permissive mode to facilitate testing and integration. See Security Configuration for production hardening options.
- ๐ One-Command Deployment - Deploy to your Cloudflare account with a single script
- ๐ Multi-Language Support - EN, DE, FR, IT with automatic language detection
- ๐ Smart Document Organization - Category and product-based document structure
- ๐ค Multiple AI Models - Workers AI, OpenAI, and Anthropic support
- ๐จ Embeddable Widget - Drop into any website with two lines of code
- ๐ R2 Storage Integration - Scalable document storage
- ๐ AutoRAG Indexing - Automatic document indexing and retrieval
- ๐ฎ Interactive Playground - Test configurations before deployment
- Cloudflare account (free tier works)
- Node.js 18+ and npm (Node 20+ recommended for all features)
- Git
# 1. Clone and setup
git clone https://github.com/arnemoor/rag-chatbot.git
cd rag-chatbot
# 2. Follow the setup guide
# See docs/SETUP.md for detailed instructionsManual steps required:
- Create AutoRAG instance in Cloudflare Dashboard
- Create API Token with proper permissions
- Copy credentials to .env file
Automated by scripts:
- R2 bucket creation
- Worker deployment
- Widget deployment
- URL configuration
After deployment, you'll receive:
- Your Worker API URL:
https://your-worker.workers.dev - Your Widget URL:
https://your-widget.pages.dev - Integration code for your website
- Direct links to playground, demo, and tools
Add the chatbot to any website:
<script src="https://your-widget.pages.dev/autorag-widget.min.js"></script>
<autorag-widget></autorag-widget>With custom configuration:
<autorag-widget
language="en"
category="fiction"
theme="dark"
position="bottom-right">
</autorag-widget>Your Cloudflare Account
โโโ Worker (API Backend)
โ โโโ AutoRAG Integration
โ โโโ Document Processing
โ โโโ Chat Endpoints
โโโ Pages (Widget Frontend)
โ โโโ Embeddable Widget
โ โโโ Standalone Chat
โ โโโ Admin Tools
โโโ R2 Storage
โโโ Document Storage
rag-chatbot/
โโโ worker/ # Backend API (Cloudflare Worker)
โโโ widget/ # Embeddable widget (Cloudflare Pages)
โโโ scripts/ # Deployment and utility scripts
โโโ docs/ # Documentation
โโโ examples/ # Configuration examples
โโโ sample-documents/ # Sample documents for testing
โโโ README.md # Quick start guide
- Account ID: Found in Cloudflare Dashboard โ Right sidebar
- API Token: Create at Profile โ API Tokens with permissions:
- AutoRAG: Read/Write
- R2: Read/Write
- Workers: Edit
- Pages: Edit
Add to .env for external models:
OPENAI_API_KEY=your-key
ANTHROPIC_API_KEY=your-key- Documentation Hub - All documentation
- Quick Start Guide - Get started in 5 minutes
- Document Management - Upload and sync documents
- API Token Setup - Configure permissions
- Security Configuration - Security options and production hardening
- Troubleshooting - Common issues
- Customer Support - AI-powered support chatbot
- Documentation Assistant - Interactive documentation helper
- Knowledge Base - Searchable knowledge base with AI
- Educational Platform - Course material Q&A system
- Internal Tools - Employee handbook assistant
# Install all dependencies
./scripts/install-dependencies.sh
# Start Worker locally
cd worker
npm run dev
# Build Widget
cd widget
npm run build -- --watch
# Run all tests
./scripts/test-all.shUpload documents to R2:
# Upload sample documents
./scripts/upload-library-documents.sh
# Or upload your own files
cd worker
npx wrangler r2 object put your-bucket/document.pdf --file=../path/to/document.pdfDocuments are automatically indexed by AutoRAG after upload.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file
- Documentation: Documentation Hub
- Issues: Report issues in your fork
- Discussions: Use your preferred communication channel
Built with:
Note: This is an open source template. When you deploy it, all services run on YOUR Cloudflare infrastructure with YOUR URLs. No data or requests go to the original authors.