📣
TiDB Cloud Essential is now in public preview. Try it out →

TiDB for AI



TiDB is a distributed SQL database designed for modern AI applications, offering integrated vector search, full-text search, and hybrid search capabilities. This document provides an overview of the AI features and tools available for building AI-powered applications with TiDB.

Quick Start

Get up and running quickly with TiDB's AI capabilities.

DocumentDescription
Get Started with PythonBuild your first AI application with TiDB in minutes using Python.
Get Started with SQLQuick start guide for vector search using SQL.

Concepts

Understand the foundational concepts behind AI-powered search in TiDB.

DocumentDescription
Vector SearchComprehensive overview of vector search, including concepts, how it works, and use cases.

Guides

Step-by-step guides for building AI applications with TiDB using the pytidb SDK or SQL.

DocumentDescription
Connect to TiDBConnect to TiDB Cloud or self-managed clusters using pytidb.
Working with TablesCreate, query, and manage tables with vector fields.
Vector SearchPerform semantic similarity searches using pytidb.
Full-Text SearchKeyword-based text search with BM25 ranking.
Hybrid SearchCombine vector and full-text search for better results.
Image SearchSearch images using multimodal embeddings.
Auto EmbeddingAutomatically generate embeddings on data insertion.
FilteringFilter search results with metadata conditions.

Examples

Complete code examples and demos showcasing TiDB's AI capabilities.

DocumentDescription
Basic CRUD OperationsFundamental table operations with pytidb.
Vector SearchSemantic similarity search example.
RAG ApplicationBuild a Retrieval-Augmented Generation application.
Image SearchMultimodal image search with Jina AI embeddings.
Conversational MemoryPersistent memory for AI agents and chatbots.
Text-to-SQLConvert natural language to SQL queries.

Integrations

Integrate TiDB with popular AI frameworks, embedding providers, and development tools.

DocumentDescription
Integration OverviewOverview of all available integrations.
Embedding ProvidersUnified interface for OpenAI, Cohere, Jina AI, and more.
LangChainUse TiDB as a vector store with LangChain.
LlamaIndexUse TiDB as a vector store with LlamaIndex.
MCP ServerConnect TiDB to Claude Code, Cursor, and other AI-powered IDEs.

Reference

Technical reference documentation for TiDB's AI and vector search features.

DocumentDescription
Vector Data TypesVector column types and usage.
Functions and OperatorsDistance functions and vector operations.
Vector Search IndexCreate and manage vector indexes for performance.
Performance TuningOptimize vector search performance.
LimitationsCurrent limitations and constraints.

Was this page helpful?