Skip to content
Back to Templates

Azure AI RAG Chatbot

Sample retrieval-augmented generation (RAG) AI chatbot app using Next.js, shadcn/ui, Azure AI Search, Azure OpenAI, and Vercel AI SDK

Azure AI Chatbot Screenshot

Azure AI + Vercel AI SDK RAG Template

Live sample: https://vercelazurerag.azurewebsites.net/

A Next.js application, powered by the Vercel AI SDK, that uses retrieval-augmented generation (RAG) to reason and respond with information outside of the model's training data.

Features

Getting Started

To get the project up and running, follow these steps:

  1. Install dependencies:

  2. Copy the example environment file:

  3. Create prerequisite resources in Azure AI:

  • Azure AI Search index
    • Optionally create a semantic search configuration and include vector fields in the index

Note: create a vector search index via REST API or within Azure Portal)

  • Azure OpenAI Chat model
  • Azure OpenAI Embedding model, if using vector search

Note: see available Azure OpenAI models here and deploy them using this guide

  1. Add your Azure OpenAI and Azure AI Search variables to the .env file:

  2. Start the development server:

Your project should now be running on http://localhost:3000.

Virtual Dev Environments

Appendix

This template includes code from Vercel's AI SDK RAG Template, which is licensed under the MIT license.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

Azure AI RAG Chatbot