Retrieval-Augmented Generation (RAG).
What is retrieval-augmented generation (RAG)?
Retrieval-augmented generation is an architectural pattern for grounding large language models in external knowledge. At query time, the system retrieves a small set of relevant passages from a corpus — documents, a knowledge base, the user's notes, the web — and inserts them into the model's context window before generating the answer. The original RAG paper (Lewis et al., Facebook AI Research, 2020) gave the pattern its name. The standard stack: an embedding model (OpenAI text-embedding-3, Cohere Embed v3, Voyage AI) converts documents to vectors; a vector database (Pinecone, Weaviate, Qdrant, pgvector) stores them; a retriever pulls the top-k matches for a query; the LLM (Claude Opus 4.5, GPT-5, Gemini 2.5 Pro) generates the answer from retrieved context. RAG reduces hallucination, enables citations, and lets the assistant answer from current data beyond its knowledge cutoff. Scroll down for the RAG architecture diagram.
RAG retrieves relevant context from a knowledge base (usually via vector search) and includes it in the prompt before generating a response. The pattern lets AI answer from your own data without fine-tuning the model.
Typical RAG stack: chunk documents → embed → store in vector DB → at query time embed the question, retrieve top-k chunks, inject into prompt. Frameworks: LangChain, LlamaIndex, Haystack.
Jarvis (getjarvis.eu) uses RAG-like patterns for its persistent memory and connector data lookups.
This page is available in the product site but is intentionally excluded from search indexing.
Glossary