📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

AI Integrations for TiDB



This document provides an overview of AI integrations for TiDB, including Auto Embedding providers, AI frameworks, Object Relational Mapping (ORM) libraries, cloud services, and MCP server support.

Auto Embedding

The Auto Embedding feature lets you perform vector searches directly with plain text. TiDB automatically converts text into vectors behind the scenes, so you do not need to generate or manage embeddings yourself.

TiDB Vector Search supports storing vectors of up to 16383 dimensions, which accommodates most embedding models.

You can use either self-deployed open-source embedding models or third-party embedding APIs to generate vectors.

The following table lists the supported embedding providers. For details on how to configure each provider, see the corresponding guide.

ProviderGuide
OpenAIOpenAI
OpenAI CompatibleOpenAI Compatible
Jina AIJina AI
CohereCohere
Google GeminiGoogle Gemini
Hugging FaceHugging Face
NVIDIA NIMNVIDIA NIM
Amazon TitanAmazon Titan

AI frameworks

TiDB provides official support for the following AI frameworks, enabling you to easily integrate AI applications developed with these frameworks into TiDB Vector Search.

You can also use TiDB for various tasks such as document storage and knowledge graph storage for AI applications.

ORM libraries

You can integrate TiDB Vector Search with your ORM library to interact with the TiDB database.

The following table lists the supported ORM libraries and the corresponding integration tutorials:

LanguageORM/ClientHow to installTutorial
PythonSQLAlchemypip install tidb-vectorIntegrate TiDB Vector Search with SQLAlchemy
Pythonpeeweepip install tidb-vectorIntegrate TiDB Vector Search with peewee
PythonDjangopip install django-tidb[vector]Integrate TiDB Vector Search with Django

Cloud services

You can use third-party cloud embedding services to generate vectors and store them in TiDB.

The following table lists the supported cloud services and the corresponding tutorials:

MCP server

The TiDB MCP Server is an open-source tool that lets you interact with TiDB databases using natural language instructions through the Model Context Protocol (MCP).

The following table lists the supported MCP clients and the corresponding setup guides:

MCP clientGuide
Claude CodeClaude Code
Claude DesktopClaude Desktop
CursorCursor
VS CodeVS Code
WindsurfWindsurf

Was this page helpful?