General AI

Embeddings, vectors and RAG

Reference only. Project progress and credentials come from assessed work.

An embedding represents content as a list of numbers so that meaning-related items can be compared. A vector database stores and searches these representations.

Retrieval flow

  1. Documents are split into useful chunks.
  2. Chunks receive embeddings and metadata.
  3. A user query receives an embedding.
  4. Search returns similar, permitted chunks.
  5. The application places selected chunks into the model context.
  6. The model produces an answer, ideally with citations.

RAG, or retrieval-augmented generation, is the broader pattern of retrieving information before generation.

Vector similarity does not prove factual relevance. Good systems also use metadata filters, keyword search, permissions, reranking and evaluation.

Embeddings, vectors and RAG | Mariete Academy