RAG pipeline
The full chain from document to answer: ingest (parse + chunk) → embed → store in vector DB → query: retrieve → optionally rerank → generate.
Naive RAG: plain top-k cosine search. Modern RAG includes: chunking strategy (semantic, sliding window, recursive, late chunking), hybrid search (vector + BM25), reranker (cross-encoder such as Cohere Rerank), query expansion (HyDE, multi-query), context compression, contextual retrieval (Anthropic's technique). Larger LLM context windows made the "just send everything" competitor ("long context vs RAG") attractive but worse and more expensive.