- A vector database for storing document embeddings
- A text generation model for producing responses
- A gradient descent optimizer for continual learning
- A document chunking mechanism for preprocessing
- Retrieval — finding relevant documents, passages, or knowledge snippets using embeddings and similarity search (commonly backed by a vector database).
- Preprocessing / Chunking — splitting long documents into model-friendly passages or chunks so the retriever and generator can work effectively.
- Generation — a language model (decoder, encoder-decoder, or instruction-following LLM) that conditions on retrieved context to produce the final response.

- RAG systems typically keep the generation model fixed at query time and rely on an external retrieval index to surface current knowledge.
- Continuous model updates via gradient descent are not part of the inference pipeline. When you need the model to learn from new data, typical approaches include periodic offline fine-tuning, parameter-efficient updates (e.g., adapters), or re-embedding the index and refreshing the vector database.
- In short: keep retrieval fast and up-to-date; apply training and weight updates as separate, controlled offline processes.
RAG architectures center on retrieval, preprocessing/chunking, and generation. Continuous weight updates via gradient descent during inference are not part of the standard RAG pipeline—updates are handled separately when needed.