C.W.K.
Stream
Lesson 02 of 05 · published

RAG vs Long Context는 라우팅 문제

~26 min · rag, long-context, routing

Level 0Window Watcher
0 XP0/50 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

종교 X, fit만

RAG는 큰 corpus + selective retrieval, citation, 빠른 반복 lookup 필요할 때 좋아. Long context는 fits하고 함께 보여야 할 bounded set의 cross-reference 필요할 때 좋아. 경쟁하는 철학 X, 라우팅 결정의 도구로 다뤄.

Production은 보통 둘 다

RAG로 candidate 파일 retrieve, 진짜 중요한 몇 개만 long context에 full로 로드. 그게 도서관 scale + 책상 reasoning 줘. 순수 RAG는 cross-reference drop, 순수 long-context는 무관 material에 익사, hybrid가 나눠 가짐.

Task shape로 라우팅

Task가 search, synthesis, audit, transformation 중 뭔지 물어. Search는 retrieval. 몇 문서에 걸친 deep synthesis는 long context. Transformation은 정확한 source 파일과 test, vector-store 점성술 X. Task 모양이 전략 선택, ego 투표권 없음.

Code

Context router·python
def choose_context_strategy(task):
    if task.corpus_tokens > task.model_window:
        return "RAG"
    if task.requires_exact_cross_reference:
        return "long_context"
    if task.needs_citations_across_many_docs:
        return "RAG_then_load_top_sources"
    if task.is_transformation_of_known_files:
        return "load_exact_files"
    return "small_context_with_pointers"
Routing matrix·text
                       FITS IN WINDOW         BIGGER THAN WINDOW
NEEDS HOLISTIC         long_context           summarize_then_long
NEEDS SELECTIVE        load_exact_files       RAG
NEEDS CITATIONS        long_context+cite      RAG_then_load_top

External links

Exercise

실제 task 4개를 RAG, long context, hybrid, pointer-only로 분류. 각각 routing rule 설명.
Hint
Corpus 크기, cross-reference 필요, citation 요구사항 봐.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.