Skip to content

Build a copilot application with Azure OpenAI Service, Azure Cosmos DB for MongoDB & Azure App Service.

License

Notifications You must be signed in to change notification settings

AzureCosmosDB/cosmosdb-mongo-copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build a Copilot app using Azure Cosmos DB for MongoDB, Azure OpenAI Service and Semantic Kernel

This sample application shows how to build a Generative-AI application using Azure Cosmos DB for MongoDB using its new vector search capabilities and Azure OpenAI Service and Semantic Kernel. The sample provides practical guidance on many concepts you will need to design and build these types of applications.

Concepts Covered

This application demonstrates the following concepts and how to implement them:

  • The basics of building a highly scalable Generative-AI chat application using Azure Cosmos DB for MongoDB.
  • Generating completions and embeddings using Azure OpenAI Service.
  • Managing a context window (chat history) for natural conversational interactions with an LLM.
  • Manage token consumption and payload sizes for Azure OpenAI Service requests.
  • Building a semantic cache using Azure Cosmos DB for MonogDB vector index and the Semantic Kernel Connector for improved performance and cost.
  • Using the Semantic Kernel SDK for vector search from Azure Cosmos DB for MongoDB as well as completion and embeddings generation.

Architecture Diagram

Architecture Diagram

User Experience

Cosmos DB + ChatGPT user interface

Getting Started

Prerequisites

Instructions

  1. Run the following command to download this project code:

    azd init -t AzureCosmosDB/cosmosdb-mongo-copilot
  2. Open a terminal and navigate to the /infra directory in this solution.

  3. Log in to AZD.

    azd auth login
  4. Deploy the services to Azure, build your container, and deploy the application.

    azd up
  5. To load the data needed for this sample you will need navigate to the web app and click on the "Admin : Load Data" button. LoadingDocumentsClick.png You can monitor the loading of the data through the application logs. LoadingDocumentsStatus.png

Quickstart

This solution has a number of quickstarts than you can run through to learn about the features in this sample and how to implement them yourself.

Please see Quickstarts

Clean up

  1. Open a terminal and navigate to the /infra directory in this solution.

  2. Type azd down

    azd down

Resources

To learn more about the services and features demonstrated in this sample, see the following:

About

Build a copilot application with Azure OpenAI Service, Azure Cosmos DB for MongoDB & Azure App Service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published