Long Context vs RAG
After this lesson, you will be able to:
- Explain why million-token-context LLMs (Gemini 2M, Claude 1M) didn't kill RAG — they're complementary, with each winning different use cases
- Apply the cost-recall-latency rubric to pick long-context vs RAG vs hybrid for a given workload
- Recognize the U-shaped attention failure mode where long-context LLMs lose information in the middle
- Build a hybrid pipeline that uses RAG for the long-tail and full-context for the head
Before You Start
Open the /play/rag-pipeline playground and slide the corpus size from 1K to 1M tokens. Watch the long-context cost line cross the RAG line around 50K tokens — that's the practical break-even where every team in production switches architectures.