One database for all your AI ambitions: Vector Search, Knowledge Graphs, and Operational Data - with enterprise-grade reliability and serverless simplicity.
TiDB is your complete database solution for AI applications. One rules all:
Say goodbye to data synchronization, duplication, or maintaining multiple data stores.
1# Define schema
2class Doc(Base):
3 __tablename__ = "doc"
4 id = Column(Integer, primary_key=True)
5 content = Column(Text)
6 embedding = Column(VectorType(dim=3))
7
8# Create table and index
9Base.metadata.create_all(engine)
10VectorAdaptor(engine).create_vector_index(
11 Doc.embedding, tidb_vector.DistanceMetric.L2
12)
13
14# Insert
15with Session(engine) as session:
16 session.add(Doc(content="dog", embedding=[1, 2, 1]))
17 session.add(Doc(content="fish", embedding=[1, 2, 4]))
18 session.commit()
19
20# Search nearest 1 embedding using L2 distance
21with Session(engine) as session:
22 results = session.execute(
23 select(Doc.content)
24 .order_by(Doc.embedding.l2_distance([1, 2, 3]))
25 .limit(1)
26 ).all()
27 print(results)
TiDB is your complete database solution for AI applications. One rules all:
1# Define schema
2class Doc(Base):
3 __tablename__ = "doc"
4 id = Column(Integer, primary_key=True)
5 content = Column(Text)
6 embedding = Column(VectorType(dim=3))
7
8# Create table and index
9Base.metadata.create_all(engine)
10VectorAdaptor(engine).create_vector_index(
11 Doc.embedding, tidb_vector.DistanceMetric.L2
12)
13
14# Insert
15with Session(engine) as session:
16 session.add(Doc(content="dog", embedding=[1, 2, 1]))
17 session.add(Doc(content="fish", embedding=[1, 2, 4]))
18 session.commit()
19
20# Search nearest 1 embedding using L2 distance
21with Session(engine) as session:
22 results = session.execute(
23 select(Doc.content)
24 .order_by(Doc.embedding.l2_distance([1, 2, 3]))
25 .limit(1)
26 ).all()
27 print(results)
Enhance RAG applications with knowledge graph context for more accurate answers.
Build powerful semantic search with vector similarity and SQL filtering combined.
Deploy visual similarity search with efficient storage and real-time matching.
TiDB.AI: an intelligent documentation assistant built with GraphRAG technology, powered by TiDB Vector Search.
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh~/.tiup/bin/tiup playground nightly --tag my_vector_db
* Supported platforms: Linux (x64 / ARM64), MacOS (x64 / ARM64)
Production-ready integrations for every stage of your AI pipeline.
Leading LLMOps platform enabling organizations to build and deploy AI applications, serving hundreds of thousands of customers with millions of daily AI interactions.
Managing separate databases for vector and relational data consumed valuable engineering resources while performance fluctuated unpredictably as tenant workloads varied.
Implemented TiDB Cloud Serverless as a unified database solution that handles both vector and relational data with automated scaling capabilities.
Leveraged TiDB Cloud Serverless with vector search capabilities to power their entire data infrastructure, serving over 300,000 database containers.
Achieved consistent performance across 100M+ records while reducing infrastructure costs and simplifying database management through automated operations.
We are in compliance with the latest industry standards: SOC2 Type II and SOC3 certified, EU CoC, PCI DSS and HIPAA compliant.
TiDB Serverless supports Role-based Access Control, Encryption at rest, Private Link, and more.
TiDB Serverless offers 99.9% uptime SLA and Zonal HA by default. Supports cross-AZ HA and automatic backups.