## Overview

> <!-- markdownlint-disable MD032 -->
> [!IMPORTANT]
> Please be sure to read the following information before starting the lab.
> + This lab only supports Chrome browser.
> + Before you start this lab, you need to register a billable OpenAI account and get the `OPENAI_API_KEY`. You can find the guidance of getting your keys from this [document from OpenAI](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key).

Generative AI is currently a cutting-edge field that has attracted many developers eager to explore it. However, several barriers often hinder their entry into this domain, such as:

- A lack of foundational AI knowledge, leaving them unsure where to begin.
- The absence of comprehensive, step-by-step, and interactive guides for building generative AI applications.
- Limited access to essential infrastructure needed for learning, such as databases and large model APIs.

To address these challenges, we developed a series of labs, including this one, through which you will learn:

- How to leverage pytidb and **TiDB Cloud Starter** as a unified data storage layer for AI applications to streamline development.
- What Embedding is and its capabilities.
- How to utilize embedded vectors after they have been obtained.
- How to employ RAG (Retrieval-Augmented Generation) for information retrieval when dealing with large volumes of data, and working with LLM (Large Language Model).
- How to make a useful Text2SQL AI application to explore the dataset.

> [!NOTE]
> In this lab, we'll use Streamlit as a rapid application development framework to streamline and accelerate data application building.
> Whether you choose your own TiDB Cloud Starter cluster or the sandbox TiDB Cloud Starter option to start the lab, a dedicated database will be created for this hands-on lab.

### Tasks

- **Build your first RAG application**

  - Save your embedding vector and the other data to TiDB Serverless cluster.
  - Start a Streamlit webpage to test the performance of your RAG application.
  - Read the code of RAG Demo.

- **Build your first Text2SQL application**

  - Use TiDB Serverless cluster as a SQL runner to correct LLM.
  - Start a Streamlit webpage to use your Text2SQL application.
  - Read the code of Text2SQL.

> [!TIP]
> Click **Start** to launch the lab environment.
> Once the environment is ready, select **Next** on the bottom toolbar to advance to **Module 1**.
> And, follow the step-by-step lab guide to connect to the hands-on environment and begin your tasks.
