검색 증강 생성(RAG)
관련 문서를 검색해 프롬프트에 삽입함으로써 자체 데이터와 LLM을 결합하고, 근거가 있으며 최신인 답변을 생성합니다.
검색 증강 생성(RAG)은(는) CoddyKit의 무료 AI Powered SaaS: Stripe + Auth + Billing + Deploy 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 AI Powered SaaS: Stripe + Auth + Billing + Deploy 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. AI Powered SaaS: Stripe + Auth + Billing + Deploy 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
What is RAG?
Retrieval-Augmented Generation gives an LLM access to external knowledge at query time. Instead of relying only on training data, you fetch relevant text and add it to the prompt.
- Answers stay current without retraining
- Reduces hallucinations
- Lets the model cite your private documents
The RAG Pipeline
A typical pipeline has two phases:
- Indexing: split documents into chunks, embed them, store vectors
- Retrieval + generation: embed the query, find similar chunks, feed them to the LLM
Chunking Documents
Split long documents into smaller chunks (often 200-500 tokens) with slight overlap. Good chunking keeps related ideas together so retrieval returns coherent context.
Creating Embeddings
An embedding model turns text into a numeric vector. Similar meanings produce nearby vectors. You embed every chunk during indexing.
const emb = await client.embeddings.create({
model: "text-embedding-3-small",
input: chunkText,
});
const vector = emb.data[0].embedding;Storing Vectors
Vectors live in a vector database such as pgvector, Pinecone, or Qdrant. Each record stores the vector plus metadata (source, title, chunk id) for later filtering and citation.
Retrieving Relevant Chunks
At query time you embed the user question and run a similarity search (cosine distance) to get the top-k closest chunks.
SELECT content FROM docs
ORDER BY embedding <=> $1
LIMIT 5;Building the Augmented Prompt
Insert the retrieved chunks into the prompt as context, then ask the model to answer using only that context.
const prompt = "Context:\n" + chunks.join("\n---\n") +
"\n\nQuestion: " + userQuestion +
"\nAnswer using only the context above.";Citing Sources
Because each chunk carries metadata, you can show citations next to the answer. This builds trust and lets users verify claims against the original document.
Handling No Good Match
If similarity scores are all low, the knowledge base probably lacks the answer. Detect this with a threshold and have the model reply that it does not know, rather than guessing.
Keeping the Index Fresh
When source documents change, re-embed and upsert the affected chunks. Track a content hash per chunk so you only re-index what actually changed, saving embedding cost.
Evaluating RAG Quality
Measure two things: retrieval quality (did we fetch the right chunks?) and answer quality (is the response grounded?). Use a test set of question and answer pairs and check whether the cited chunks contain the supporting facts.
Quick Check
Check your understanding of RAG.
Recap
You learned the full RAG flow:
- Chunk and embed documents into a vector store
- Embed the query and retrieve top-k similar chunks
- Augment the prompt and answer with citations
- Handle low-confidence matches and keep the index fresh
RAG grounds your AI features in your own data without retraining.
자주 묻는 질문
“검색 증강 생성(RAG)” 강의는 무료인가요?
네 — “검색 증강 생성(RAG)” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 AI Powered SaaS: Stripe + Auth + Billing + Deploy 강의 전체를 잠금 해제할 수 있습니다. AI Powered SaaS: Stripe + Auth + Billing + Deploy 강의에는 총 4개의 강의가 포함되어 있습니다.
“검색 증강 생성(RAG)”에서 뭘 배우나요?
관련 문서를 검색해 프롬프트에 삽입함으로써 자체 데이터와 LLM을 결합하고, 근거가 있으며 최신인 답변을 생성합니다. 브라우저에서 직접 실행하는 실습 코드로 AI Powered SaaS: Stripe + Auth + Billing + Deploy을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
AI Powered SaaS: Stripe + Auth + Billing + Deploy을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 AI Powered SaaS: Stripe + Auth + Billing + Deploy은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.
“검색 증강 생성(RAG)” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 AI Powered SaaS: Stripe + Auth + Billing + Deploy 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 AI Powered SaaS: Stripe + Auth + Billing + Deploy 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- LLM 미세 조정
- 실시간 인공지능 처리
- 인공지능 성능 모니터링
- 검색 증강 생성(RAG)