---
title: "RAGBot Starter — An Astra DB and OpenAI chatbot"
description: "Starter project for creating a chatbot using Astra DB and OpenAI."
url: "https://vercel.com/templates/next.js/ragbot-starter"
links:
  repository: "https://github.com/datastax/ragbot-starter"
  demo: "https://ragbot-starter.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=RAGBot+Starter+%E2%80%94+An+Astra+DB+and+OpenAI+chatbot&demo-description=Starter+project+for+creating+a+chatbot+using+Astra+DB+and+OpenAI.&demo-url=https%3A%2F%2Fragbot-starter.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F41CTDhgzlYylfnTwehOHSA%2Fa331212e4f6878e7eabc89c9f293b5cc%2Fimage__4_.png&project-name=RAGBot+Starter+%E2%80%94+An+Astra+DB+and+OpenAI+chatbot&repository-name=ragbot-starter&repository-url=https%3A%2F%2Fgithub.com%2Fdatastax%2Fragbot-starter&from=templates&integration-ids=oac_HrgeXUSyqANAtm3MAOaTJ43a&env=OPENAI_API_KEY&envDescription=These+values+allow+you+to+connect+to+DataStax+and+OpenAI.&envLink=https%3A%2F%2Fgithub.com%2Fdatastax%2Fragbot-starter%23setup"
---

# RAGBot Starter — An Astra DB and OpenAI chatbot

Starter project for creating a chatbot using Astra DB and OpenAI.

# RAGBot Starter

This project is a starter for creating a chatbot using Astra DB and OpenAI. It's designed to be easy to deploy and use, with a focus on performance and usability.

## Features

- **Astra DB Integration**: Store and retrieve data from your Astra DB database with ease.
- **OpenAI Integration**: Leverage the power of OpenAI to generate intelligent responses.
- **Easy Deployment**: Deploy your chatbot to Vercel with just a few clicks.
- **Customizable**: Modify and extend the chatbot to suit your needs.

## Getting Started

### Prerequisites

- An Astra DB account. You can [create one here](https://astra.datastax.com/register).
    - An Astra Vector Database
- An OpenAI account. You can [create one here](https://platform.openai.com/).

## Deployment

Easily deploy your chatbot to Vercel by clicking the button below:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/datastax/ragbot-starter&integration-ids=oac_HrgeXUSyqANAtm3MAOaTJ43a&env=OPENAI_API_KEY)

Configure the Astra DB integration and add your `OPENAI_API_KEY` environment variable.

Note: Before you deploying to prod, you will want to remove seed script (`npm run seed`) from the build step.

### Local Development

1. Clone this repository to your local machine.
2. Install the dependencies by running `npm install` in your terminal.
3. Set up the following environment variables in your IDE or `.env` file:
    - `OPENAI_API_KEY`: Your API key for OpenAI
    - `ASTRA_DB_API_ENDPOINT`: Your Astra DB vector database endpoint
    - `ASTRA_DB_APPLICATION_TOKEN`: The generated app token for your Astra database
        - To create a new token go to your database's `Connect` tab and click `Generate Token`. (your Application Token begins with `AstraCS:...`)
    - `ASTRA_DB_NAMESPACE`: (Optional) The existing Astra Namespace/Keyspace **_in a vector-enabled DB_**
4. Populate your database with sample data by running `npm run seed` in your terminal.

### Running the Project

To start the development server, run `npm run dev` in your terminal. Open [http://localhost:3000](http://localhost:3000) to view the chatbot in your browser.

## Related Templates

### [qrGPT – AI QR Code Generator](https://vercel.com/templates/next.js/qrGPT)

QrGPT is an AI tool for you to generate beautiful QR codes using AI with one click. Powered by Vercel and Replicate.

### [Liftoff – AI Mock Interview Simulator](https://vercel.com/templates/next.js/liftoff)

Liftoff is an interview preparation tool that provides AI feedback on your mock interviews, built with OpenAI Whisper and GPT.

### [Nuxt AI Chatbot](https://vercel.com/templates/nuxt/nuxt-ai-chatbot)

An AI chatbot template to build your own chatbot powered by Nuxt MDC and Vercel AI SDK.

## Related Integrations

### [DataStax Astra DB](https://vercel.com/marketplace/datastax-astra-db)

NoSQL and Vector DB for Generative AI

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
