Contextcore
Long context vs RAG
Send everything, or retrieve the right part? Depends on size, change rate, cost and permissions.
What it is and why it exists
Long context is simple and great when the material fits and the task needs all of it (summarise this contract). RAG wins when the corpus is large or changing, when each call should be cheap and fast, when permissions differ per user, or when you need citations to specific passages.
Quick prototype
Paste the document.
In production, at scale
Often both: retrieve the relevant documents, then give the model whole sections rather than tiny chunks, and cache stable reference material in the prefix.
Vendors and tools
| Long-context models | Hundreds of thousands of tokens per call |
|---|---|
| Vector DBs + rerankers | Retrieval at any corpus size |
How it fails
- Long context for every request of a high-traffic app: huge bills
- RAG over a 20-page document that would simply fit
What the interviewer asks next
A customer has 300 PDFs. Long context or RAG?
RAG for Q&A: too large to send every time, and different users likely see different files. Long context for a per-document task like “summarise this one contract”.