Back to AI/ML Overview
🔎 Knowledge Site · Retrieval-Augmented Generation · SQL, Vectors, Indexes, Hybrid Search

RAG EngineeringRetrieval is a query. The model reads only what it returns.

starts with an ordinary table. Each row can carry a vector, a list of numbers that places its text in a space of meaning; a query vector is compared with the rows, they are ranked by distance, and the nearest few are handed to a model. This site starts from SELECT ... WHERE and climbs, one idea at a time, through full-text search, vectors computed by hand, , indexes, , , grounding, and cloud-scale choices.

🎯The problem

An underwriting agent needs two different kinds of evidence: homes similar to the one being quoted, and past underwriter decisions on similar points. A WHERE clause finds exact values but not a similar risk; a vector finds a paraphrase but can miss an exact rule id. engineering decides what each row embeds, what stays a filter, how candidates are ranked and reranked, and how you prove the right rows came back.

🔑The question every page asks
Which rows did we find, and how do we know they are the right ones? Two corpora of one synthetic insurance workflow and a local-first private-document example, from exact SQL search to , and recall@k.

🗺️What is inside

From SQL to vectors

SELECT, full-text search and , then vectors computed by hand: dot product, distance, cosine, and what an model really produces.

Storage and indexes

A vector column per row, exact search, and , pgvector in PostgreSQL and vector search in SQLite, with SQL that was run.

Better retrieval

, pipelines, with , , two corpora with different contracts, grounded answers and retrieval .

Choosing and operating

Scale without row-count myths, re- versus reindexing, Google Cloud options, a sourced comparison of 14 , reference architectures.

🖱️How to read it

  • New to : read in order. Each chapter starts in plain English with one tiny example.
  • Engineers: jump to pgvector, indexes, or the ecosystem matrix. The rigorous part sits in folded blocks.
  • Fourteen interactive labs, among them a drag-the-query nearest-neighbour board, an visualizer and a candidate-to-rerank funnel.
  • The data is synthetic and the encoders are toy stand-ins. Results show how the mechanism works, not how good any model is.