โ† Back to list
eco2-team

rag-pipeline

by eco2-team

๐ŸŒฑ ์ด์ฝ”์—์ฝ”(Ecoยฒ) BE

โญ 0๐Ÿด 0๐Ÿ“… Jan 25, 2026

SKILL.md


name: rag-pipeline description: RAG (Retrieval-Augmented Generation) ํŒŒ์ดํ”„๋ผ์ธ ๊ตฌํ˜„ ๊ฐ€์ด๋“œ. Contextual Retrieval, Evidence Tracking, Phase 1-4 ํ‰๊ฐ€ ์‹œ ์ฐธ์กฐ. "rag", "retrieval", "retriever", "evidence", "citation", "nugget" ํ‚ค์›Œ๋“œ๋กœ ํŠธ๋ฆฌ๊ฑฐ.

RAG Pipeline Guide

Ecoยฒ RAG ์•„ํ‚คํ…์ฒ˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    RAG Pipeline (Anthropic Pattern)                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  User Query                                                              โ”‚
โ”‚      โ”‚                                                                   โ”‚
โ”‚      โ–ผ                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  Strategy Selection                                              โ”‚    โ”‚
โ”‚  โ”‚  1. Classification (Vision ๊ฒฐ๊ณผ ํ™œ์šฉ)                            โ”‚    โ”‚
โ”‚  โ”‚  2. Contextual (ํƒœ๊ทธ ๊ธฐ๋ฐ˜ ๋งค์นญ)                                  โ”‚    โ”‚
โ”‚  โ”‚  3. Keyword (ํด๋ฐฑ)                                               โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚      โ”‚                                                                   โ”‚
โ”‚      โ–ผ                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  Retriever                                                       โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€ LocalAssetRetriever (๊ธฐ๋ณธ)                                   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€ TagBasedRetriever (Contextual)                               โ”‚    โ”‚
โ”‚  โ”‚      โ”œโ”€ item_class_list.yaml (~200 ํ’ˆ๋ชฉ)                         โ”‚    โ”‚
โ”‚  โ”‚      โ””โ”€ situation_tags.yaml (~100 ํƒœ๊ทธ)                          โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚      โ”‚                                                                   โ”‚
โ”‚      โ–ผ                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  Evidence & Answer Generation                                    โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€ Evidence: chunk_id, quoted_text, relevance, matched_tags    โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€ Answer: Global + Local[intent] ํ”„๋กฌํ”„ํŠธ                      โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚      โ”‚                                                                   โ”‚
โ”‚      โ–ผ                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  Phase 1-4 Evaluation (Optional)                                 โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€ Phase 1: Citation (chunk ์ฐธ์กฐ ์ถ”์ )                          โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€ Phase 2: Nugget Completeness (์ •๋ณด ์™„์ „์„ฑ)                   โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€ Phase 3: Groundedness (๊ทผ๊ฑฐ ๊ธฐ๋ฐ˜ ๊ฒ€์ฆ)                       โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€ Phase 4: Next Steps (ํ›„์† ์•ก์…˜ ์ œ์•ˆ)                         โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๊ฒ€์ƒ‰ ์ „๋žต ์šฐ์„ ์ˆœ์œ„

์ˆœ์œ„์ „๋žตํŠธ๋ฆฌ๊ฑฐ์‹ ํ˜ธ ๊ฐ•๋„
1ClassificationVision ๊ฒฐ๊ณผ ์กด์žฌ๋†’์Œ
2Contextualํ’ˆ๋ชฉ/์ƒํ™ฉ ํƒœ๊ทธ ๋งค์นญ์ค‘๊ฐ„
3Keywordํ๊ธฐ๋ฌผ ํ‚ค์›Œ๋“œ ํฌํ•จ๋‚ฎ์Œ

Reference Files

Quick Start

1. SearchRAGCommand (์ „๋žต ์„ ํƒ)

@dataclass
class SearchRAGCommand:
    """RAG ๊ฒ€์ƒ‰ ์ปค๋งจ๋“œ"""

    retriever: RetrieverPort

    async def execute(self, input: SearchRAGInput) -> SearchRAGOutput:
        # Strategy 1: Classification ๊ธฐ๋ฐ˜
        if input.classification_result:
            result = await self._search_by_classification(input)
            if result.found:
                return result

        # Strategy 2: Contextual ๊ธฐ๋ฐ˜
        result = await self._search_contextual(input)
        if result.found:
            return result

        # Strategy 3: Keyword ํด๋ฐฑ
        return await self._search_keyword(input)

2. TagBasedRetriever (Contextual)

class TagBasedRetriever(RetrieverPort):
    """ํƒœ๊ทธ ๊ธฐ๋ฐ˜ Contextual Retriever"""

    async def search_with_context(
        self,
        message: str,
    ) -> list[ContextualSearchResult]:
        # 1. ํ’ˆ๋ชฉ/์ƒํ™ฉ ํƒœ๊ทธ ์ถ”์ถœ
        context = self.extract_context(message)

        # 2. ํƒœ๊ทธ ๊ธฐ๋ฐ˜ ๊ฒ€์ƒ‰
        results = await self._search_by_tags(context)

        # 3. Relevance ์ ์ˆ˜ ๊ณ„์‚ฐ
        return self._rank_results(results)

3. Evidence ๊ตฌ์กฐ

@dataclass
class Evidence:
    """RAG Evidence (Phase 1-4์šฉ)"""
    chunk_id: str           # ์†Œ์Šค ์‹๋ณ„์ž
    relevance: str          # "high" | "medium" | "low"
    quoted_text: str        # ์ธ์šฉ ํ…์ŠคํŠธ (80์ž)
    matched_tags: list[str] # ๋งค์นญ๋œ ํƒœ๊ทธ
    method: str             # ๊ฒ€์ƒ‰ ๋ฐฉ๋ฒ•

4. Phase 1-4 ํ‰๊ฐ€

@dataclass
class FeedbackResult:
    """Phase 1-4 ํ‰๊ฐ€ ๊ฒฐ๊ณผ"""
    # Phase 1: Citation
    context_relevance: float
    cited_chunks: list[str]

    # Phase 2: Nugget Completeness
    completeness: float
    covered_nuggets: list[str]
    missing_nuggets: list[str]

    # Phase 3: Groundedness
    groundedness: float
    unsupported_claims: list[str]

    # Phase 4: Next Steps
    suggested_queries: list[str]
    action_items: list[str]

Score

Total Score

60/100

Based on repository quality metrics

โœ“SKILL.md

SKILL.mdใƒ•ใ‚กใ‚คใƒซใŒๅซใพใ‚Œใฆใ„ใ‚‹

+20
โœ“LICENSE

ใƒฉใ‚คใ‚ปใƒณใ‚นใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+10
โ—‹่ชฌๆ˜Žๆ–‡

100ๆ–‡ๅญ—ไปฅไธŠใฎ่ชฌๆ˜ŽใŒใ‚ใ‚‹

0/10
โ—‹ไบบๆฐ—

GitHub Stars 100ไปฅไธŠ

0/15
โ—‹ๆœ€่ฟ‘ใฎๆดปๅ‹•

3ใƒถๆœˆไปฅๅ†…ใซๆ›ดๆ–ฐใŒใ‚ใ‚‹

0/10
โ—‹ใƒ•ใ‚ฉใƒผใ‚ฏ

10ๅ›žไปฅไธŠใƒ•ใ‚ฉใƒผใ‚ฏใ•ใ‚Œใฆใ„ใ‚‹

0/5
โœ“Issue็ฎก็†

ใ‚ชใƒผใƒ—ใƒณIssueใŒ50ๆœชๆบ€

+5
โœ“่จ€่ชž

ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ่จ€่ชžใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+5
โ—‹ใ‚ฟใ‚ฐ

1ใคไปฅไธŠใฎใ‚ฟใ‚ฐใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

0/5

Reviews

๐Ÿ’ฌ

Reviews coming soon