Skip to Content
벡터 데이터베이스 (Korean Edition)
book

벡터 데이터베이스 (Korean Edition)

by Nitin Borwankar
April 2026
Intermediate
292 pages
4h 39m
Korean
O'Reilly Media, Inc.
Content preview from 벡터 데이터베이스 (Korean Edition)

제6장. SQLite VSS와 Ollama를 활용한 검색 강화 생성(RAG) 시스템구축

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

이전 장들에서는 벡터 검색의 개별 구성 요소, 즉 임베딩 생성 및 유사도 쿼리 수행에 중점을 두었습니다. 이제 이러한 구성 요소들을 결합하여 실제 작동하는 검색 강화 생성(RAG) 시스템을 구축할 차례입니다.

분산 클라우드 클러스터에 의존하는 생산 규모의 웹 애플리케이션과 달리, 여기서의 목표는 단일 데스크톱에서 실행되는 고성능의 비공개, 완전한 로컬 RAG 시스템을 구축하는 것입니다. 검색 엔진으로는 SQLite VSS를, 로컬 LLM “두뇌”로는 Ollama를 사용할 것입니다.

RAG 시스템은 LLMs의 근본적인 한계, 즉 훈련 시점에 지식이 고정되어 사적인 정보나 최신 정보에 접근할 수 없다는 문제를 해결합니다. LLM에 검색 메커니즘을 결합함으로써, 최신 도메인별 지식을 활용해 질문에 답변하는 시스템을 구축할 수 있습니다.

우리의 목표는 Reddit 콘텐츠에 대한 질의에 지능적으로 응답하는 질의응답 시스템을 구축하는 것입니다. 사용자가 질문을 하면 시스템은 (1) 저장된 Reddit 게시물을 검색하여 가장 관련성 높은 정보를 찾고, (2) 가장 잘 일치하는 콘텐츠 조각을 추출하며, (3) 이 맥락을 LLM에 제공하고, (4) 추출된 정보만을 기반으로 자연어 답변을 생성합니다.

이러한 접근 방식은 LLM의 응답을 실제 데이터에 기반하게 함으로써 사실적 정확성을 보장하며, 환각 현상을 크게 줄이고(완전히 제거하진 못하더라도) LLM의 훈련 데이터에 포함되지 않은 비공개 또는 전문적인 콘텐츠도 처리할 수 있게 합니다.

시스템 아키텍처 개요

당사의 RAG 시스템은 서로 연동하여 작동하는 다섯 가지 주요 구성 요소로 이루어져 있습니다:

벡터 데이터베이스 레이어 (SQLite VSS)

콘텐츠 청크와 해당 임베딩을 함께 저장하여 빠른 유사도 검색을 가능하게 함

임베딩 엔진 (SentenceTransformers)

텍스트를 의미적 의미를 포착하는 고밀도 벡터 표현으로 변환

하이브리드 검색 시스템

최적의 검색 결과를 위해 의미론적 벡터 검색과 기존 키워드 검색을 결합

LLM 통합 (Ollama)

자연어 응답 생성을 위한 로컬 LLM 추론 제공

RAG 파이프라인 오케스트레이터

검색 및 생성 프로세스를 조정합니다

데이터 흐름은 다음과 같은 경로를 따릅니다: 콘텐츠 수집 → 텍스트 청크화 → 임베딩 생성 → 벡터 저장 → 쿼리 처리 → 하이브리드 검색 → 컨텍스트 검색 → prompt 구성 → LLM 생성. 그림 6-1을 참조하십시오.

Diagram showing the system architecture with components for content ingestion, embedding, storage, search, and LLM integration, illustrating the data flow through ingestion and query processes.
그림 6-1. 시스템 아키텍처 개요

각 구성 요소를 단계별로 구축해 보겠습니다.

벡터 지원이 ...

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

데이터 집약적인 애플리케이션 설계 (Korean Edition), 2nd Edition

데이터 집약적인 애플리케이션 설계 (Korean Edition), 2nd Edition

Martin Kleppmann, Chris Riccomini

Publisher Resources

ISBN: 0642572369835