Skip to Content
RAG with Python 쿡북 (Korean Edition)
book

RAG with Python 쿡북 (Korean Edition)

by Dominik Polzer
May 2026
Intermediate
378 pages
5h 49m
Korean
O'Reilly Media, Inc.
Content preview from RAG with Python 쿡북 (Korean Edition)

제1장. RAG 시작하기

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

대규모 언어 모델 (LLMs) 은 프로덕션 코드 작성부터 재무 보고서 분석, 수십 개 언어의 번역에 이르기까지 복잡한 인지 과제를 해결하는 방식을 혁신적으로 변화시켰습니다. 이를 보완하는 기초 모델들은 이제 시각, 음성 합성 및 인식, 오디오 처리, 이미지 생성, 다중 모달 추론을 처리하며, 이 모든 모델은 여러 영역에 걸쳐 인간과 유사한 콘텐츠를 처리하고 생성할 수 있는 유사한 트랜스포머 아키텍처 위에 구축되어 있습니다.

이러한 능력에도 불구하고, 이 모델들은 근본적인 구조적 한계를 가지고 있습니다. 사용자가 직접 제공하지 않는 한, 이 모델들은 사용자의 개인 정보나 기밀 데이터에 접근할 수 없습니다. 또한 컨텍스트 윈도우의 제한으로 인해 한 번에 고려할 수 있는 정보의 양이 제한되어, 긴 문서를 한 번에 분석하는 데 비용이 많이 들거나 아예 불가능합니다. 게다가 이 모델들은 올바른 정보가 부족할 때, 불확실성을 인정하기보다는 환각을 일으키는 경향이 있습니다.

검색 강화 생성 (RAG)은 이 세 가지 문제를 한 번에 해결합니다. RAG는 모델이 외부 지식에 통제된 방식으로 접근할 수 있게 하고, 단일 prompt에 담을 수 있는 양보다 훨씬 더 많은 정보를 처리할 수 있게 하며, 추측이 아닌 검색된 증거를 바탕으로 답변을 도출합니다. 사용자가 질문을 하면 시스템은 먼저 지식 소스에서 관련 정보를 검색한 다음, 그 컨텍스트를 모델에 전달하여 응답을 생성합니다.

그림 1-1은 RAG 시스템의 가장 단순한 형태를 보여줍니다. 검색기( )는 벡터 저장소나 데이터베이스와 같은 지식 소스를 검색하여 관련 문장을 반환합니다. 벡터 저장소를 구글처럼 전체 웹이 아닌, 특정 문서와 지식 기반을 색인화하는 특화된 검색 엔진으로 생각하면 됩니다. 생성기( )는 일반적으로 LLM으로, 검색된 자료를 활용하여 근거에 기반한 답변을 생성합니다.

Diagram illustrating a RAG chatbot retrieving information from search results about horcrux destruction methods and generating a response.
그림 1-1. 관련 정보를 검색하고 상황에 맞는 응답을 생성하는 RAG챗봇

RAG( )은 지식이 수많은 문서에 분산되어 있거나, 답변을 위해 단순한 조회보다는 종합적인 처리가 필요하거나, 데이터가 너무 방대하거나 다양하여 사람이 검토하기 어려운 경우에 가장 유용합니다. 최신 시스템은 종종 여러 개의 리트리버를 사용합니다. 하나는 문서를 검색하고, 다른 하나는 구조화된 데이터베이스를 쿼리하며, 또 다른 것들은 외부 API를 호출할 수 있습니다. 모델은 이러한 도구들을 조정하여 각 질문에 어떤 정보를 사용할지 결정합니다.

그림 1-2는 바로 이러한 접근 방식을 보여줍니다. Notion 데이터베이스 검색, 웹 검색, 계산 수행, 그리고 지식 기반 검색을 위해 SQL 및 벡터 데이터베이스에 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Tips for Designing Effective Presentation Slide Decks

Tips for Designing Effective Presentation Slide Decks

Curtis Newbold
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho
How to Overcome a Power Deficit

How to Overcome a Power Deficit

Cyril Bouquet, Jean-Louis Barsoux

Publisher Resources

ISBN: 0642572383596