## Overview

### The background of this lab

For the background on Manus and TiDB Cloud (including information about TiDB Cloud Branching), please consult the following resources:

- [How Manus Scaled Its Data Foundation for Viral Growth with TiDB](https://www.pingcap.com/case-study/manus-agentic-ai-database-tidb/)
- [How Manus 1.5 Uses TiDB Cloud to Let Agents Ship Full-Stack Apps at Scale](https://www.pingcap.com/blog/how-manus-1-5-uses-tidb-x-to-let-agents-ship-full-stack-apps-at-scale/)
- [Agentic AI at Scale: How Manus Migrated to TiDB in 2 Weeks](https://www.youtube.com/watch?v=PP4Ht_JWA7k)

<!-- markdownlint-disable MD032 -->
> [!IMPORTANT]
> Please be sure to read the following information before starting the lab.
> - This lab only supports Chrome browser.
> - This lab will grant you temporary access to Amazon Bedrock for invoking necessary models. Please adhere strictly to the usage guidelines outlined in the lab materials and refrain from utilizing this access in any other contexts. We reserve the right to hold users legally accountable for any misuse of Amazon Bedrock permissions that results in financial loss.
> - This lab utilizes the **Branching** feature in TiDB Cloud, which is currently in preview.
> - If you have experience developing or deploying applications with MySQL but are new to TiDB, we recommend first trying the [Introduction to TiDB Cloud Starter](/labs/demo_203) lab. Completing that lab beforehand will help you get more out of this one.

In many real-world Agentic AI products, an agent needs to try multiple approaches on the same underlying data—for example, different database schema designs, different SQL generation strategies, or different data cleaning rules. If all attempts are applied to a single database directly, two issues quickly show up:

- **No easy rollback**: An incorrect DDL statement or data modification can compromise the environment and may impact subsequent validation.
- **No clean comparison**: Different approaches interfere with each other, making it hard to compare options on a consistent baseline.

In this lab, we use TiDB Cloud Branching and treat the database as the agent's **forkable workspace**: you branch from one baseline into multiple parallel paths, validate and compare, then continue iterating from the best path.

In this lab, you will learn:

- How to interpret **database branching** in an agent workflow through the product materials of Manus;
- What TiDB Cloud Branching is, and how to manually create a branch in the console;
- In a Text2SQL scenario, how to drive an agent using **Amazon Strands Agents** and **Jupyter Notebook**:
  - Generate 3 parallel storage approaches for a Todo app (one branch per approach);
  - Select one as the baseline, then evolve it further by adding a `users` table and relationships (branch again from the chosen baseline).
- Why **branch-style exploration** is crucial for agentic AI systems, supported by a research paper.

### Start the Lab

- If the **`Redeem`** button appears in the left navigation pane, please click it to redeem this lab using your lab credits before proceeding. Alternatively, you can use the lab code provided by your instructor in the top-right profile menu to redeem the lab.
- In the left navigation pane, click the **`Region`** dropdown and choose your preferred cloud provider and region for the lab. Follow your instructor's guidance if required.
- Click **`Authorize`** to select a personal TiDB Cloud organization and project for this hands-on lab. Do NOT choose a production environment.
- In the **`Select Starter Cluster`** section, you can either create a new cluster by selecting **`Create New Cluster`**, or choose an existing non-production cluster marked with a green thumb icon (which indicates that the cluster is in the same region as the one you selected for this lab). For example:

  ![select-starter-cluster.jpg 40%](https://lab-static.pingcap.com/images/2025/11/18/595576a52cdeceea38b55b23a93a901c11e8cc20.jpg)

- Click **`Start`** to launch the lab environment.
  - TiDB Labs will assign you an Ubuntu virtual machine in your selected region, from which you can access the TiDB Cloud Starter cluster.
  - If you chose **`Create New Cluster`**, a new free TiDB Cloud Starter cluster will be created under your own TiDB Cloud account.
  - Once the environment is ready, you can click **`Next`** on the bottom to follow the lab guide step-by-step to complete the practice.
