Render raises $100M at a $1.5B valuation
Read the announcementWhy deploy RAG Powered Chatbot on Render?
A RAG (Retrieval-Augmented Generation) powered chatbot is a conversational AI that retrieves relevant documents from a knowledge base and uses them as context when generating responses with a large language model. It solves the problem of LLM hallucinations and outdated knowledge by grounding responses in your actual data, enabling accurate answers about specific documents, products, or domain knowledge.
This template deploys a complete RAG chatbot stack—React frontend, Express backend, and PostgreSQL with pgvector already configured—with database migrations and seeding of 15 AI/ML documents running automatically on first deploy. Instead of manually setting up pgvector, wiring services together, and configuring environment variables, you get a working chatbot with a populated knowledge base in one click. Render's Blueprint handles the service linking and database provisioning, so you just add your OpenAI key and deploy.
Architecture
What you can build
After deploying, you'll have a working chatbot that answers questions using RAG over a pre-loaded set of 15 AI/ML documents, with source citations showing which docs informed each response. The app maintains conversation history across sessions and displays real-time token usage so you can see how much context you're consuming. You can start chatting immediately or swap in your own documents to build a Q&A interface over any knowledge base.
Key features
- pgvector semantic search: Uses PostgreSQL with pgvector extension for vector embedding storage and semantic similarity search over documents.
- Multi-turn conversation context: Maintains persistent conversation history with context awareness across multiple chat turns.
- Source citation tracking: Returns which documents from the knowledge base informed each RAG-generated response.
- npm workspaces monorepo: Organized as TypeScript monorepo with shared UI component library between Express backend and React/Vite frontend.
- One-click Render deployment: Pre-configured render.yaml blueprint with automatic database migrations, seeding, and service linking.
Use cases
- Developer builds internal docs search chatbot for engineering team
- Startup founder creates AI support agent trained on product documentation
- Student learns RAG architecture by deploying working full-stack example
- Technical writer adds conversational interface to knowledge base articles
What's included
Service | Type | Purpose |
|---|---|---|
rag-chatbot-backend | Web Service | Handles API requests and business logic |
rag-chatbot-frontend | Web Service | Serves the user interface |
rag-chatbot-db | PostgreSQL | Primary database |
Prerequisites
- OpenAI API Key: Your API key for OpenAI services, used to generate embeddings and power the RAG chatbot responses.
Next steps
- Open the frontend URL and ask a question about machine learning — You should receive a response with source citations from the pre-seeded AI/ML documentation within a few seconds
- Test conversation context by asking a follow-up question like 'Tell me more about that' — The chatbot should reference your previous question and provide a contextually relevant answer
- Check the token usage indicator in the chat interface during a multi-turn conversation — You should see the context window usage increase as you add more messages to the conversation.