# Retrieval, Embeddings & Search **Track:** Models, Tools & Agents — AI-Native Full-Stack Development — complete (30) **Framework / surface:** web dev (pgvector / retrieval) **Level:** Intermediate **Prerequisites:** Context, State & Memory, Relational Data & SQL **In one line:** Retrieve the right evidence into context instead of expecting the model to remember or ingest everything. ## Theory, aesthetics & inspiration An application knows more than any model request should carry, so retrieval is a selection problem: given the task, find the few pieces of information most likely to help. The generation side was formalized as retrieval-augmented generation by Patrick Lewis and colleagues (2020); the semantic side rests on embeddings — the dense vector representations that entered mainstream practice with word2vec (Mikolov et al., 2013) — which place related content near each other so meaning can be searched by distance. But retrieval methods are complementary, not ideological: exact identifiers, relational queries, full-text search, and vector similarity each win on different information needs, and the pgvector extension makes the point concretely by putting embeddings inside PostgreSQL, where ownership and metadata stay queryable with SQL and results can be filtered before entering context. Resist the cargo-cult reflex of standing up a vector database for every feature — and evaluate retrieval separately from generation, because a model cannot faithfully use evidence it never received. **Builder question:** What retrieval method best matches this information need: exact lookup, relational query, keyword search, vector similarity, or a combination?