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.
The code exercises in this lab contain two folders:
Folder | Purpose |
---|---|
start | Unmodified code that is ready for you to begin the exercise. Make your changes in this folder. |
completed | Completed code for reference. Compare your changes with this folder when you complete the exercise. |
Chatbot Demo
https://arg-syd-caiwest-chat.azurewebsites.net/
The product catalog for the bicycle store is stored in 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
-
Azure Deployment Guide: The Azure resources required for this lab have already been provisioned for you. If you would like to provision the resources on your own subscription, follow the instructions on the Azure Deployment Guide page.
-
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 Open AI 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.