A Cloudflare Worker that connects Twilio WhatsApp with Cloudflare AutoRAG to deliver intelligent, document-aware chatbot responses — all running serverlessly.
Built and maintained by neuno.ai
- Twilio integration for WhatsApp
- Cloudflare Workers for ultra-low latency
- AutoRAG integration for contextual, file-backed responses
- Lightweight and scalable with no server setup
- Secrets managed securely via Wrangler
Requires a Twilio "Try WhatsApp" Sandbox is set up under your Twilio account (can be uograded later to a paid Twilio number)
git clone https://github.com/your-username/twilio-autorag-bot.git
cd twilio-autorag-botnpm i -g wranglerwrangler secret put CF_API_TOKEN
wrangler secret put CF_ACCOUNT_ID
wrangler secret put AUTORAG_SLUG
wrangler secret put TWILIO_ACCOUNT_SID
wrangler secret put TWILIO_AUTH_TOKE
wrangler secret put TWILIO_PHONE_NUMBERwrangler deployAfter deploying the Cloudflare Worker, copy the deployed Worker URL (e.g., https://twilio-autorag-bot.yourdomain.workers.dev) and paste it into the "WHEN A MESSAGE COMES IN" field under:
- Twilio Console → Messaging → Sandbox for WhatsApp → Sandbox Configuration
- Scroll to the "Sandbox Configuration" section.
- Paste your deployed URL into the "When a message comes in" field.
- Ensure this field Method is set to "POST" 5 Save the changes.
This tells Twilio where to forward incoming WhatsApp messages.
wrangler tail