This directory contains examples of how to use the TiDB as a vector database.
Please follow the instructions below to set up a TiDB Serverless cluster with built-in vector search supported.
- Sign up TiDB Cloud
- Follow this tutorial to create a TiDB Serverless cluster
- Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page
- Click Connect in the upper-right corner.
- In the connection dialog, select General from the Connect With dropdown and keep the default setting of the Endpoint Type as Public.
- If you have not set a password yet, click Create password to generate a random password.
The connection dialog of TiDB Serverless
- OpenAI Embedding: use the OpenAI embedding model to generate vectors for text data.
- Image Search: use the OpenAI CLIP model to generate vectors for image and text.
- LlamaIndex RAG with UI: use the LlamaIndex to build an RAG(Retrieval-Augmented Generation) application.
- Chat with URL: use LlamaIndex to build an RAG(Retrieval-Augmented Generation) application that can chat with a URL.
- GraphRAG: 20 lines code of using TiDB Serverless to build a Knowledge Graph based RAG application.
- GraphRAG Step by Step Tutorial: Step by step tutorial to build a Knowledge Graph based RAG application with Colab notebook. In this tutorial, you will learn how to extract knowledge from a text corpus, build a Knowledge Graph, store the Knowledge Graph in TiDB Serverless, and search from the Knowledge Graph.
- Vector Search Notebook with SQLAlchemy: use SQLAlchemy to interact with TiDB Serverless: connect db, index&store data and then search vectors.
- Build RAG with Jina AI Embeddings: use Jina AI to generate embeddings for text data, store the embeddings in TiDB Vector Storage, and search for similar embeddings.
- Semantic Cache: build a semantic cache with Jina AI and TiDB Vector.
tidb.ai is an amazing out-of-the-box Graph RAG(Retrieval Augmented Generation) template project based on the TiDB vector store, it contains ui and server logic, fork it on github and deploy your own.