Azure AI RAG Chatbot

R
Renaudil y a 2 jours
0

Description

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

npx boilerapp azure-ai-rag-chatbot

Documentation

Azure AI + Vercel AI SDK RAG Template

Deploy with Vercel

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.

vercel-start3

Features

Getting Started

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

  1. Install dependencies:

    npm install
    
  2. Copy the example environment file:

    cp .env.example .env
    
  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:

    AZURE_SEARCH_ENDPOINT=your_azure_search_endpoint_here
    AZURE_SEARCH_KEY=your_azure_search_key_here
    AZURE_SEARCH_INDEX_NAME=your_azure_search_index_name_here
    AZURE_SEARCH_CONTENT_FIELD=your_azure_search_content_field_here
    AZURE_SEARCH_VECTOR_FIELD=your_azure_search_vector_field_here # include if using vector search
    AZURE_SEARCH_SEMANTIC_CONFIGURATION_NAME=your_azure_search_semantic_configuration_name_here # include if using semantic search
    
    AZURE_OPENAI_API_ENDPOINT=your_azure_openai_api_endpoint_here
    AZURE_RESOURCE_NAME=your_azure_resource_name_here
    AZURE_DEPLOYMENT_NAME=your_azure_deployment_name_here # chat model deployment name
    AZURE_EMBEDDING_DEPLOYMENT_NAME=your_azure_embedding_deployment_name_here # embedding model deployment name
    AZURE_API_KEY=your_azure_api_key_here
    
  2. Start the development server:

    npm run dev
    

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

Virtual Dev Environments

Open in GitHub Codespaces

Open in Dev Containers

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.

Prix

Gratuit

FREE

Commentaires (0)

FAQ

Questions Fréquemment Posées

Vous avez une question ? Nous avons les réponses. Si vous ne trouvez pas ce que vous cherchez, n'hésitez pas à nous contacter.

Boilerapp est une plateforme communautaire dédiée au partage de boilerplates, de starter kits et de modèles de projets pour développeurs. Notre objectif est simple : vous faire gagner du temps sur la configuration initiale (setup) pour que vous puissiez coder ce qui compte vraiment. Que vous cherchiez une simple base de code ou un projet SaaS complet, vous le trouverez ici.

Vous avez d'autres questions ?

Notre équipe est là pour vous aider. Contactez-nous et nous vous répondrons dès que possible.