1. RAG νκ° κ°μ
: μμ€ν μ΄ μ λ ₯μ λν΄ μΌλ§λ μ κ²μνκ³ , κ·Έ μ λ³΄λ‘ μ νν μλ΅μ μμ±νλμ§ μΈ‘μ νλ κ³Όμ
• νκ° μμ
- κ²μ λ¨κ³ νκ° : μ§λ¬Έμ λν΄ κ²μλ λ¬Έμ(context)μ κ΄λ ¨μ±·μ νμ± νκ°
- μμ± λ¨κ³ νκ° : κ²μ μ 보 κΈ°λ°μΌλ‘ μμ±λ μλ΅μ νμ§·μ νμ± νκ°
• νκ° λ°©λ²
| κΈ°μ€ | μ’ λ₯ | μ€λͺ |
| λ°μ΄ν° μΆμ² | μ€νλΌμΈ | 미리 μ€λΉλ λ°μ΄ν°μ μΌλ‘ μ±λ₯ μΈ‘μ |
| μ¨λΌμΈ | μ€μ μ¬μ©μ νΈλν½·νΌλλ°± κΈ°λ° μ€μκ° μ±λ₯ νκ° | |
| μΈ‘μ λ°©μ | μ λμ | μλνλ μ§νλ‘ ν μ€νΈ νμ§ νκ° |
| μ μ±μ | μ λ¬Έκ°/μ¬μ©μκ° μ§μ μ£Όκ΄μ νκ° |
2. RAGAS νλ μμν¬μ 4λ μ§ν
• RAGAS : RAG νμ΄νλΌμΈμ μ λμ μΌλ‘ νκ°νλ μ€νμμ€ νλ μμν¬
2-1. μμ±(Generation) νκ°(LLM λ΅λ³μ λν νκ°)
β Faithfulness(μ λ’°μ±) - ν 루μλ€μ΄μ νκ°
: μμ±λ λ΅λ³μ΄ κ²μ λ¬Έμ(context)μ μΌλ§λ μΆ©μ€νμ§ νκ°(μ μ λ²μ 0~1, λμμλ‘ ππ»)
- κ³μ° λ‘μ§ : λ΅λ³μμ μ£Όμ₯(claim) μΆμΆ → κ° μ£Όμ₯μ΄ contextμμ μΆλ‘ κ°λ₯νμ§ νλ¨(λͺ¨λ LLM νμ©)

β‘ Answer Relevancy(λ΅λ³ μ ν©μ±)
: μμ±λ λ΅λ³μ΄ μ§λ¬Έμ μΌλ§λ λΆν©νλμ§ νκ°(μ μ λ²μ -1~1, μ½μ¬μΈ μ μ¬λ κΈ°λ°)
- κ³μ° λ‘μ§ : LLM λ΅λ³μΌλ‘λΆν° μμΌλ‘ μ§λ¬Έ μμ± → μλ μ§λ¬Έκ³Ό μμ±λ μ§λ¬Έ κ° μ½μ¬μΈ μ μ¬λμ νκ·

2-2. κ²μ(Retrieval) νκ°(κ²μλ contextμ λν νκ°)
β’ Context Precision(λ¬Έλ§₯ μ λ°λ)
: κ΄λ ¨ μλ λ¬Έμκ° μΌλ§λ μμ μμμ μμΉνλμ§ νκ°(μ μ λ²μ 0~1)

β£ Context Recall(λ¬Έλ§₯ μ¬νλ₯ )
: κ²μλ contextκ° μ λ΅(ground-truth) μ 보λ₯Ό μΌλ§λ ν¬ν¨νλμ§ νκ°(μ μ λ²μ 0~1)
- Faithfulnessμ μ μ¬νμ§λ§, λ΅λ³μ΄ μλ μ λ΅(GT)μμ μ£Όμ₯ μΆμΆνλ€λ μ μ΄ λ€λ¦

• RAGASμ langchain-communityμ λ²μ νΈνμ± λ¬Έμ
- TestsetGenerator import μ `No Module named langchain_community.chat_models.vertexai` Error λ°μ
• ν΄κ²°
1. langchain_google_vertexai μ€μΉ
- !uv pip install langchain_google_vertexai
2. .venv\Lib\site-packages\langchain_community\chat_models λλ ν 리 μλ vertexai.py νμΌμ λ§λ€κ³ μλ μ½λλ₯Ό λ£λλ€.
```python
try:
from langchain_google_vertexai import ChatVertexAI
except ImportError:
class ChatVertexAI:
def __init__(self, *args, **kwargs):
raise ImportError(
"ChatVertexAI requires langchain-google-vertexai. "
"Install with: pip install langchain-google-vertexai"
)
```
'STUDY > LLM' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
| [LLM] Neo4jGraphμ Cypher 쿼리 - 2 (0) | 2026.07.09 |
|---|---|
| [LLM] Neo4jGraphμ Cypher 쿼리 (0) | 2026.07.07 |
| [LLM] Advanced RAG (0) | 2026.07.05 |
| [LLM] RAG - Retriever (0) | 2026.07.04 |
| [LLM] Qdrant - langchain (0) | 2026.07.03 |