Retrieval-augmented generation 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, embeddings, indexes, hybrid search, reranking, grounding, evaluation and cloud-scale choices.
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. RAG 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.
SELECT, full-text search and BM25, then vectors computed by hand: dot product, distance, cosine, and what an embedding model really produces.
A vector column per row, exact search, HNSW and IVF, pgvector in PostgreSQL and vector search in SQLite, with SQL that was run.
Chunking, pipelines, hybrid search with rank fusion, reranking, two corpora with different contracts, grounded answers and retrieval evals.
Scale without row-count myths, re-embedding versus reindexing, Google Cloud options, a sourced comparison of 14 vector databases, reference architectures.