A free, open-source RAG chatbot template built with Next.js, Upstash Vector, and the AI SDK that helps you quickly build powerful context-aware chatbot applications. Based on Vercel's AI chatbot repository.
Features · Model Providers · Deploy Your Own · Running locally
This template ships with xAI grok-2-1212 as the default chat model. However, with the AI SDK, you can switch LLM providers to OpenAI, Anthropic, Cohere, and many more with just a few lines of code.
To enable the RAG functionality, you need to upload content into the Upstash Vector database. This process involves upserting documents or data points that will be used for similarity searches during chatbot interactions. There are two ways to do this:
upsert operation adds new documents or updates existing ones in the vector index. You can do this via a script or integrate it into your application. For example, in JavaScript:
await index.upsert({
id: 'doc1',
vector: embedding,
data: { title: 'Sample Document' }
});
You can deploy your own version of the Upstash RAG AI Chatbot to Vercel with one click:
You will need to use the environment variables defined in .env.example to run Upstash RAG AI Chatbot. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.
Note: You should not commit your
.envfile or it will expose secrets that will allow others to control access to your various AI and authentication provider accounts.
npm i -g vercel.vercel directory): vercel linkvercel env pullpnpm install
pnpm dev
Your app template should now be running on localhost:3000.
A free, open-source RAG chatbot template built with Next.js, Upstash Vector, and the AI SDK that helps you quickly build powerful context-aware chatbot applications. Based on Vercel's AI chatbot repository.
Features · Model Providers · Deploy Your Own · Running locally
This template ships with xAI grok-2-1212 as the default chat model. However, with the AI SDK, you can switch LLM providers to OpenAI, Anthropic, Cohere, and many more with just a few lines of code.
To enable the RAG functionality, you need to upload content into the Upstash Vector database. This process involves upserting documents or data points that will be used for similarity searches during chatbot interactions. There are two ways to do this:
upsert operation adds new documents or updates existing ones in the vector index. You can do this via a script or integrate it into your application. For example, in JavaScript:
await index.upsert({
id: 'doc1',
vector: embedding,
data: { title: 'Sample Document' }
});
You can deploy your own version of the Upstash RAG AI Chatbot to Vercel with one click:
You will need to use the environment variables defined in .env.example to run Upstash RAG AI Chatbot. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.
Note: You should not commit your
.envfile or it will expose secrets that will allow others to control access to your various AI and authentication provider accounts.
npm i -g vercel.vercel directory): vercel linkvercel env pullpnpm install
pnpm dev
Your app template should now be running on localhost:3000.