Learn to Build Your Own AI Apps with Azure Cosmos DB! Part 2

Microsoft Reactor
15 May 202447:55

TLDRIn this informative session, event planner Danny introduces Jasine Greenway, who leads participants through part two of the Azure Cosmos DB developer guide. The session focuses on building AI applications with Azure Cosmos DB, emphasizing the importance of speed, handling diverse data types, natural language interaction, scalability, security, and cost-effectiveness. Jasine demonstrates how to use Azure Open AI service to create embeddings and implement retrieval augmented generation, key for developing modern AI applications. The guide also covers deploying a container app to Azure App Service and interacting with Azure Cosmos DB. The session concludes with a Q&A, offering participants the opportunity to clarify concepts and gain insights into deploying AI applications effectively.

Takeaways

  • 😀 The session is a follow-up part two of the Azure Cosmos DB developer guide, focusing on building AI apps.
  • 👥 Danny is the event planner, and Jasine Greenway is the speaker leading the session.
  • 📜 The event has a code of conduct that encourages respectful and on-topic discussions.
  • 🌐 The session is recorded and will be available on the Microsoft Reactor YouTube channel for on-demand viewing.
  • 🛠️ Participants are encouraged to engage in a hackathon, with some looking for teammates in the chat.
  • 🔍 The session covers the use of Azure AI open API endpoints and explores embeddings and retrieval augmented generation.
  • 📈 Key features of modern AI applications include speed, handling diverse data types, natural language interaction, scalability, security, and cost-effectiveness.
  • 🌐 Azure Cosmos DB is used as a vector store to manage embeddings, which are vector representations of data for machine learning models.
  • 🔑 The session provides a link to access Azure OpenAI through a proxy for hackathon participants.
  • 🛠️ The backend of the application is discussed, which includes setting up an API with Azure OpenAI and Azure Cosmos DB.
  • 📚 The use of 'Lang chain' as an LLM orchestrator is highlighted for managing AI packages and libraries efficiently.

Q & A

  • What is the main focus of the session presented by Jasine Greenway?

    -The session focuses on part two of the Azure Cosmos DB developer guide, where Jasine Greenway walks through building AI applications with Azure Cosmos DB, specifically discussing embeddings and retrieval augmented generation.

  • What is the significance of embeddings in the context of AI applications?

    -Embeddings are a machine learning concept that allows categorical variables or text to be converted into a form that can be input into a model. They are used to create a searchable product base that can be accessed through chat, making it easier to find related items or topics.

  • How does Azure Cosmos DB store and manage embeddings?

    -Azure Cosmos DB stores the vector representations, or embeddings, of data in what is essentially a vector database or vector store with an index, allowing for efficient storage and retrieval of these embeddings.

  • What is the role of the Azure Open AI service in the application being built?

    -The Azure Open AI service is used to interact with the application's backend. It is leveraged for creating embeddings and applying retrieval augmented generation to enhance the user experience and provide meaningful responses.

  • Why is the chat interface important in the context of AI applications?

    -The chat interface is important because it allows users to interact with the application's knowledge base using natural language. This means users can ask questions in a conversational manner instead of writing complex queries, making the interaction more intuitive and user-friendly.

  • What are some modern requirements for AI applications?

    -Modern AI applications require speed, the ability to work with different types of data under one application, natural language interaction, scalability to handle the demand of users, security and compliance, and cost-effectiveness in terms of resources and monetary costs.

  • How does the use of Azure App Service benefit the deployment of the front end of the application?

    -Azure App Service is a service for hosting web applications. It benefits the deployment of the front end by providing a platform that is reliable and scalable, allowing for easy management and hosting of the single page application (SPA).

  • What is the purpose of the hackathon mentioned in the session?

    -The hackathon is an opportunity for participants to showcase their AI skills and use Azure Open AI through the provided proxy. It encourages learning and building AI applications, with the chance to compete for prizes and recognition on a global scale.

  • How can participants access Azure Open AI during the hackathon?

    -Participants can access Azure Open AI through the hackathon proxy by logging in through GitHub. Upon doing so, they receive an Azure Open AI key and an endpoint that can be used in their applications.

  • What is the benefit of using a containerized approach for deploying backend applications?

    -Containerizing a backend application ensures consistency across different environments. It allows the application to run with the same behavior regardless of whether it's deployed locally or in the cloud, simplifying the development and deployment process.

  • What is Lang Chain and how does it help in managing different AI packages and libraries?

    -Lang Chain is an LLM (Large Language Model) orchestrator that simplifies the management of different AI packages and libraries. It allows for the chaining of different AI app processes, making it easier to sequence and manage the execution of various AI tasks within an application.

Outlines

00:00

😀 Introduction and Event Overview

Danny, the event planner for the New York Reactor Space, welcomes everyone and introduces Jasine Greenway, the speaker for the session on Azure Cosmos DB developer guide. The session includes a review of the code of conduct, an overview of the session's structure, and a mention of the ongoing hackathon. Jasine discusses the modern requirements for AI applications, such as speed, data handling, cloud solutions, natural language interaction, accuracy, scalability, security, and cost-effectiveness.

05:03

📚 Backend Development and Embeddings

The presentation moves on to discuss the backend development of the web application, which was deployed to Azure App Service. The focus is on using Azure OpenAI service for creating embeddings, which are a way to convert text into a format that can be processed by machine learning models. The concept of vectors and embedding is introduced as a means to build a searchable product base through chat, emphasizing the importance of vector representation for data like images, audio, and text.

10:03

🔍 Exploring Embeddings and Vector Databases

Jasine provides a deeper look into the existing notebook labs, focusing on how to use embeddings to create a product base for a searchable database. The process involves setting up an endpoint, creating clients, and connecting to Azure OpenAI. The use of different models for chat completions and embeddings is explained, with a focus on the Text Embedding Ada model for creating vectors. The concept of vectorizing and storing embeddings in documents is also covered.

15:07

🛠️ Vector Index Creation and Searching

The session continues with creating a vector index, which is essential for performing vector searches in Azure Cosmos DB. Different types of indexes are discussed, with IVF being the default choice. A demonstration of searching for products using vector representations is shown, highlighting how similar items can be found based on vector similarity. The concept of retrieval augmented generation is introduced, which combines vector databases with completion models to create tailored responses.

20:08

🔗 Lang Chain API and Backend Integration

Jasine opens up lab five to work with the backend API, showcasing the use of Lang Chain, an LLM (Large Language Model) orchestrator, to manage different AI packages and libraries. The process of setting up the backend API locally, creating clients, and connecting to Azure OpenAI is detailed. The use of Lang Chain to format documents into JSON and the importance of setting up the Python environment for development are also discussed.

25:10

🏗️ Deploying the Backend API and Containerization

The paragraph outlines the steps for deploying the backend API in a container using Docker. It emphasizes the benefits of containerization, such as consistency and ease of deployment across different environments. The process includes installing requirements, using a Dockerfile to manage containers, and deploying the application to Azure Container Apps. The use of Azure Cloud Shell for executing commands is also mentioned.

30:13

🤖 Interaction with Completion Models and Vector Embeddings

Jasine clarifies the difference between vector embeddings and interacting with completion models. Completion models are used for text generation, such as creating resumes, while vector embeddings are for creating similarity between data points, which is useful for searches and is typically stored in a vector database. The application of these concepts in a chat application is discussed, where user input is turned into a vector for database comparison.

35:13

📝 Final Q&A and Closing Remarks

The session concludes with a Q&A segment where Jasine addresses questions about the use of Docker Desktop for local container testing and the difference between vector embeddings and completion models. She also provides information on how to join the hackathon and Discord for further interaction and support. The importance of community engagement and the opportunity to learn and compete in the hackathon are highlighted before signing off.

Mindmap

Keywords

💡Azure Cosmos DB

Azure Cosmos DB is a globally distributed, multi-model database service provided by Microsoft Azure. It is designed to scale across any number of geographical regions with a comprehensive SLA. In the context of the video, it is used to store and manage data for an AI application, particularly for creating a searchable product base using embeddings.

💡Embeddings

Embeddings are a concept within machine learning where categorical variables or text are converted into a numerical form that can be input into a model. They are used to represent data such as text, images, or audio as vectors, which can be processed by AI models. In the video, embeddings are used to create a product base for a searchable database that will be accessible through chat.

💡Retrieval Augmented Generation (RAG)

Retrieval Augmented Generation is a technique that combines a vector database or store with a completions model to create tailored responses around user queries and data. It is mentioned in the video as a method to enhance AI applications by generating more accurate and contextually relevant responses.

💡Natural Language Interaction

Natural Language Interaction refers to the ability of an application to interact with users through natural language, as opposed to structured queries or commands. It is highlighted in the video as an important feature for AI applications to provide a more intuitive and user-friendly experience.

💡Scalability

Scalability is the ability of a system, network, or process to handle a growing amount of work by adding resources. In the video, it is discussed as a critical requirement for AI applications, especially when dealing with services like Azure Open AI, to manage the demand and number of users effectively.

💡Azure Open AI

Azure Open AI refers to the Azure platform's integration with Open AI services, which allows developers to leverage advanced AI models and capabilities within their applications. The video discusses using Azure Open AI for creating embeddings and applying RAG in an AI application.

💡Vector Search

Vector Search is a type of search that uses vector representations (embeddings) of data to find similar items or information. It is showcased in the video as a method for searching products within a database based on their vectorized representations for more accurate and relevant results.

💡Container Apps

Container Apps are a type of application deployment in Azure that allows for the running of containerized applications in a managed and scalable environment. The video discusses deploying a backend API as a container app to Azure for better resource management and scalability.

💡Lang Chain

Lang Chain is referred to as an LLM (Large Language Model) orchestrator in the video. It is a tool that helps manage and chain different AI packages and libraries, allowing for a more streamlined development process of AI applications. It is used to format documents into JSON and manage the flow of data within the application.

💡Hackathon

A Hackathon is an event, often of duration ranging from a day to a week, where people, including programmers, collaborate intensively on a project. In the video, the speaker mentions an ongoing hackathon as an opportunity for participants to build AI applications using Azure Open AI and compete for prizes.

💡Code of Conduct

A Code of Conduct is a set of rules or guidelines outlining the standards of behavior and professional etiquette expected from participants in an event. The video begins with a mention of the code of conduct, emphasizing the importance of maintaining a respectful environment during the session.

Highlights

Session introduces the Azure Cosmos DB developer guide with a focus on AI applications.

Emphasizes the importance of a respectful environment and professional engagement during the session.

The session is recorded and will be available on the Microsoft Reactor YouTube channel.

Jasine Greenway leads the session, discussing the Azure Cosmos DB and its integration with AI applications.

Mentions an ongoing hackathon where participants can build and find teammates.

Explains the use of Azure OpenAI endpoints and embeddings for creating a searchable product base.

Discusses the modern requirements for AI applications, including speed, data handling, and natural language interaction.

Highlights the role of cloud solutions like Azure in providing scalable and secure AI application infrastructure.

Introduces the concept of vectors and embedding as a way to convert data into a form that machine learning models can use.

Demonstrates how embeddings can capture the relationship between different data points, unlike traditional numerical representations.

Shows how Azure Cosmos DB can store and manage vector representations of data for efficient searching.

Details the process of setting up an endpoint, creating clients, and connecting to Azure OpenAI service.

Explains the use of the Lang Chain package for orchestrating different AI packages and libraries in an application.

Provides a step-by-step guide on deploying a backend API in a container for consistency and ease of management.

Discusses the benefits of containerization for backend applications, such as consistency across different environments.

Shows how to use the Azure portal and Cloud Shell for deploying and managing Azure container apps.

Provides a live demo of a chat application using Azure Cosmos DB and embeddings for product search and retrieval.

Mentions the use of Discord for community interaction, support, and office hours with the presenter.

Invites participants to join the hackathon and utilize the provided resources to build and showcase their AI applications.