Build SQL and vector retrieval context layers with TiDB
Use TiDB when an agent needs one transactional SQL store that can also hold embeddings and serve vector retrieval for RAG, memory, or app-context workflows.
npx skills add agentskillexchange/skills --skill build-sql-and-vector-retrieval-context-layers-with-tidb
Use TiDB when an operator needs a durable retrieval layer where structured application records, transactional state, analytics queries, and vector embeddings stay in one distributed SQL database. The workflow is: provision TiDB or TiDB Cloud, create tables for source records and embedding vectors, ingest documents or application events, run SQL plus vector similarity queries to retrieve grounded context, and feed the selected rows back into the agent or RAG pipeline. Invoke this instead of using the database product normally when an agent workflow needs repeatable context retrieval with ACID updates, SQL filters, and vector search together rather than a separate vector-only service. The scope boundary is SQL-backed retrieval and memory context for agents; it is not a generic TiDB database listing, a full data-platform card, or a replacement for application database administration.
What this skill actually does
Inputs and prerequisites: TiDB or TiDB Cloud, an embedding model, SQL client or application connector, source documents or application records.
Setup notes: Use TiDB Cloud Serverless for the shortest setup path, or install a local TiDB test cluster with the current TiUP instructions from PingCAP’s documentation. Create vector columns for embeddings, load source rows, add vector indexes where appropriate, and query with SQL filters plus vector similarity functions from the TiDB vector search docs.
Source and verification boundary: use https://docs.pingcap.com/tidb/stable/vector-search-overview/ as the canonical reference before running the workflow; keep commands, API calls, CLI usage, and generated outputs reviewable against that upstream source.
Framework fit: publish this as a Multi-Framework workflow only when the operator can invoke the documented toolchain directly, rather than treating the upstream project as a generic product listing.