Getting Started
- VS Code
- Node.js 18.x or later
- Azure OpenAI API Key
- Azure Cosmos DB
Introduction
For this lab, you will be building a chatbot for a bicycle store that can answer queries about bicycles and accessories for you.
Chatbot Demo
Hosted RAG chatbot example is here: https://aiaaa-s2-chatbot.azurewebsites.net

The product catalog for the bicycle store is stored in an Azure Cosmos DB database. The solution will use Azure Cosmos DB vector search capabilities to retrieve relevant documents from the database based on the user's query. It will generate the final response using Chat Completion API from Azure OpenAI.
Data Ingestion

Query Processing

Lab Outline
-
Loading Product Catalog: The first step in building the chatbot is to load some sample data into the Azure Cosmos DB database to build a product catalog.
-
Vector Search with Azure Cosmos DB: Use text embeddings to perform vector search in Azure Cosmos DB.
-
Workflow Orchestration using LangChain: Use LangChain to orchestrate the workflow of querying Azure Cosmos DB and Azure OpenAI services.
-
Chatbot Backend API: Build the Node.js backend API to expose the Azure OpenAI functionality.
-
Chatbot Frontend: Connect Chatbot Frontend with the Backend API.
Deployment Architecture

The Front-end Web App is a static SPA application written in React. Since React is outside the scope of this guide, the source code for the Front-end Web App is provided for you. The Front-end Web App communicates with the Node.js backend API, which you will build in this lab.
The Node.js backend API is responsible for generating responses to user queries. It queries Azure Cosmos DB to extract relevant documents using vector search and then uses Azure OpenAI services to generate responses to user queries.
Let's get started by clicking the Next button below.