AIInterviewTraining logoAIInterview/Training
🤖 Retrieval & Agents
Core

Retrieval vs Long Context

If a whole document fits in a model's large context window, should you paste it, or retrieve only the relevant chunks? Long context is simpler but costly (quadratic attention), slower, and used unevenly (lost in the middle); retrieval is cheaper, faster, refreshes without retraining, and surfaces only what matters. The usual answer is retrieval for large, changing, or partially-relevant corpora, and long context for small, cohesive inputs. AI, ML, and GenAI engineer interviews test it because 'just use the big context window' is a common, costly oversimplification.

a free account unlocks the core curriculum tier · no card
RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS
COMPANIES THAT ASSUME THIS
NEXT IN RETRIEVAL & AGENTSAgent State, Checkpointing, and Durable Execution