AI EngineeringInterview preparation
Intermediate·Concept·2 min read

RAG revision

Practice this question

Ingestion: approved source → secure parse/OCR → coherent chunks + metadata → embeddings → complete published index.

Answer: identity → eligible retrieval → rerank/context budget → grounded model → validated citations → answer/abstain.

Advanced patternPurposeMain risk
RewriteResolve conversational/search wordingChanging intent or identifiers
Multi-querySearch alternative phrasingsFan-out cost and duplication
DecompositionSplit compound questionsLosing how subanswers connect
Parent-childSearch precise pieces, provide full relevant sectionOversized context or mismatched permissions
Multi-hopFollow dependent evidenceCompounding errors and latency
Agentic RAGLet bounded agent choose retrieval stepsLoops and excess autonomy
Corrective/self-reflectiveCheck evidence/answer and apply bounded correctionUncalibrated self-approval
Graph RAGRetrieve through entity relationshipsIncorrect extracted links and maintenance cost
CompressionKeep only useful evidenceLost exceptions, numbers, or provenance

RAG versus fine-tuning: retrieval supplies current external knowledge; training changes learned behavior. RAG versus long context: search a large changing corpus versus supply a known bounded document set. RAG versus search: generation adds explanation; returning sources can be sufficient.

Adapted from 13_AI.MD · “RAG revision”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.