Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.66 KB

File metadata and controls

54 lines (38 loc) · 1.66 KB

TiDB Vector Search Example - How to build your own RAG app

An interactive demo showcasing TiDB's vector search capabilities. This demo allows you to explore and experiment with semantic search functionality powered by TiDB's vector similarity search feature.

Visit https://tidbcloud-example-with-vector-search.vercel.app/ to experience the demo.

Features

  • Interactive vector search demonstration
  • Real-time semantic similarity search
  • Built-in sample documents and queries
  • Custom query testing capability

How Vector Search Works

  1. Document Storage:

    • Each document is converted into a high-dimensional vector (embedding)
    • Both the original content and vector embeddings are stored in TiDB
    • Vector indexes enable efficient similarity search
  2. Search Process:

    • Your search query is converted to a vector
    • TiDB finds documents with similar vector representations
    • Results are ranked by similarity score

Running Locally (Optional)

If you want to run this demo locally:

Prerequisites

  1. Sign up for a TiDB Cloud account
  2. Create a Serverless Tier cluster (free)
  3. Get a Jina AI API key for text embeddings

Setup

  1. Clone this repository
  2. Create a .env file:
JINA_API_KEY=your_jina_api_key
  1. Install and run:
pnpm install
pnpm dev

Visit http://localhost:3000 to see the demo locally.

Learn More