Custom Content AI Chatbot is an open-source boilerplate for building a custom AI chatbot that answers questions about your own content, built with Next.js, LangChain, Upstash, and TailwindCSS and deployed to Fly.io.
What is Custom Content AI Chatbot?
The template's core function is to let you create a chatbot that uses your content (such as documentation, blog posts, or other text) as its knowledge base. It takes user questions as input and returns streamed answers powered by OpenAI, with caching and rate limiting handled by Upstash. The template runs on Next.js and is configured for deployment on Fly.io. It was authored by Rishi Raj Jain and published on the Upstash blog.
Key Features
- Next.js framework — Built on Next.js, a React framework, for the chat interface and serverless API routes.
- LangChain.js integration — Uses LangChain to orchestrate the question-answering pipeline over custom content.
- Upstash Rate Limiter — Limits each user to 3 requests per 60 seconds to prevent abuse.
- Upstash Redis caching — Caches OpenAI responses in Upstash Redis to reduce latency and cost.
- QStash scheduled training — Uses Upstash QStash to schedule content training jobs so the chatbot stays up to date.
- TailwindCSS styling — Styles the chat UI with TailwindCSS utility classes.
- Fly.io deployment — Includes configuration for deploying the app on Fly.io.
- Streaming responses — Streams AI answers to the client for a better user experience.
Who is it for?
This template is for developers who want to add a custom AI chatbot to their site or product without building the infrastructure from scratch. It suits teams already using Next.js who want to integrate OpenAI with rate limiting and caching. It's also a useful reference for developers exploring LangChain and the Upstash serverless stack.
What can you do with it?
- Documentation owners: Add a chatbot to your docs site that answers questions based on your documentation content, helping users find answers faster.
- Content creators: Let visitors ask questions about your blog posts or articles instead of reading everything themselves.
- Developers: Use the template as a foundation for production AI features that require rate limiting, caching, and scheduled content updates.








