Skip to content

Conversation

@shizn
Copy link
Collaborator

@shizn shizn commented Jan 30, 2026

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 30, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hfxsd for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 30, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shizn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a substantial overhaul and expansion of the documentation related to TiDB's AI features. The changes aim to provide a more structured, comprehensive, and user-friendly resource for developers looking to build AI-powered applications with TiDB. The focus is on practical guidance, diverse examples, and broad integration support to streamline the development process.

Highlights

  • Documentation Restructuring: The entire 'ai' documentation section has been significantly reorganized into logical subdirectories: 'concepts', 'guides', 'examples', 'integrations', and 'reference'. This improves navigability and clarity for users exploring TiDB's AI capabilities.
  • Comprehensive Table of Contents: The main AI landing page (ai/_index.md) now features a detailed Table of Contents, providing a quick overview and direct links to all major sections, including getting started, core concepts, practical guides, examples, and various integrations.
  • New Guides and Examples: A large number of new documentation pages have been added, covering detailed guides for features like auto embedding, filtering, join queries, raw SQL, reranking, table operations, and transactions. New examples demonstrate basic CRUD, auto embedding, full-text search, hybrid search, image search, RAG applications, conversational memory, Text2SQL, and vector search using PyTiDB.
  • Expanded Integrations: New integration guides have been introduced for various embedding providers (Cohere, Google Gemini, Hugging Face, Jina AI, NVIDIA NIM, OpenAI, OpenAI-compatible, TiDB Cloud Hosted) and AI frameworks (LangChain, LlamaIndex). Additionally, documentation for the TiDB Model Context Protocol (MCP) Server and its integration with tools like Claude Code, Claude Desktop, Cursor, VS Code, and Windsurf has been added.
  • Updated AI Overview and Quickstart: The primary AI overview page (ai/index.md) has been updated to reflect TiDB's role in modern AI applications, emphasizing integrated vector search, full-text search, and a seamless Python SDK. A new quickstart guide (ai/quickstart.md) helps users rapidly get started with TiDB's AI features using the Python SDK.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly restructures and expands the "TiDB for AI" documentation, introducing a new table of contents, a demo gallery, and numerous guides and examples. The changes are well-organized and make the documentation much more comprehensive. My review includes suggestions for improving clarity, correcting minor typos and grammatical errors, and ensuring consistency across the new documents, in line with the repository's documentation style guide.


```python
tidbvec = TiDBVectorStore(
connection_string=tidb_connection_url,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The variable tidb_connection_url is not defined in the preceding code. It should be tidb_connection_string to match the variable defined earlier in the document.

Suggested change
connection_string=tidb_connection_url,
connection_string=tidb_connection_string,

```python
table.update(
values={
"content": "TiDB Cloud Starter is a fully managed, auto-scaling cloud database service"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This line is missing a comma at the end, which will cause a syntax error in the Python dictionary. Adding the comma will fix the code example.

Suggested change
"content": "TiDB Cloud Starter is a fully managed, auto-scaling cloud database service"
"content": "TiDB Cloud Starter is a fully managed, auto-scaling cloud database service",

(7, 'Bluetooth5.3ヘッドホン ノイズキャンセリング 没入サウンド 快適装着'),
(8, 'IPX7防水イヤホン スポーツ対応 タッチ操作 高音質音楽'),
(9, 'スポーツイヤホン 安定装着 防汗 長持ちバッテリー ワークアウト対応'),
(10, '有线ヘッドホン スタジオ级 HDサウンド 快适装着 プロ音楽体験'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in the Japanese text. 快适装着 should be 快適装着.

Suggested change
(10, '有线ヘッドホン スタジオ级 HDサウンド 快适装着 プロ音楽体験'),
Item(id=10, title="有線ヘッドホン スタジオ級 HDサウンド 快適装着 プロ音楽体験"),

- [OpenAI](embedding-openai.md)
- [OpenAI Compatible](embedding-openai-compatible.md)
- [Cohere](embedding-cohere.md)
- [Jina AI](embedding-jinaai.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in the link filename. It should be embedding-jina-ai.md.

Suggested change
- [Jina AI](embedding-jinaai.md)
- [Jina AI](embedding-jina-ai.md)


!!! info

`tidbcloud_free` prefix models is not required to configure the API key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Grammatical correction for subject-verb agreement.

Suggested change
`tidbcloud_free` prefix models is not required to configure the API key.
`tidbcloud_free` prefix models do not require you to configure an API key.


### Step 5. Embed and store document vectors

TiDB vector store supports both cosine distance (`consine`) and Euclidean distance (`l2`) for measuring similarity between vectors. The default strategy is cosine distance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

There is a typo in consine. It should be cosine.

Suggested change
TiDB vector store supports both cosine distance (`consine`) and Euclidean distance (`l2`) for measuring similarity between vectors. The default strategy is cosine distance.
TiDB vector store supports both cosine distance (`cosine`) and Euclidean distance (`l2`) for measuring similarity between vectors. The default strategy is cosine distance.

```python
search_query = f"""
SELECT
VEC_Cosine_Distance(se.embedding, :query_vector) as distance,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The SQL function name should be in uppercase to be consistent with SQL standards and other parts of the documentation.

Suggested change
VEC_Cosine_Distance(se.embedding, :query_vector) as distance,
VEC_COSINE_DISTANCE(se.embedding, :query_vector) as distance,

@qiancai qiancai force-pushed the feature/preview-top-navigation branch from 34b5b17 to 60b8cc9 Compare January 31, 2026 01:12
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 31, 2026

@shizn: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify e3ad131 link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants