본문으로 건너뛰기
cccskills
무료GitHub에 공개

agentic-rag

Use when building self-correcting retrieval systems for AI agents. Keywords: RAG, retrieval, Corrective RAG, Self-RAG, query decomposition, reranking, hallucination, grounding.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Agentic RAG - Self-Correcting Retrieval

Overview

Agentic RAG evolves beyond static information retrieval by embedding autonomous agents within the retrieval and generation pipeline. Unlike "Naive RAG" which assumes a direct mapping from query to document chunk, Agentic RAG employs iterative reasoning, self-correction, and multi-step workflows to ensure answers are grounded, accurate, and comprehensive. It treats retrieval as a dynamic task-oriented process.

When To Use

  • When dealing with multi-hop questions requiring information synthesis from disparate sources.
  • When existing RAG pipelines suffer from high hallucination rates or low retrieval precision.
  • When the domain requires "Codebase RAG" that understands syntax, imports, and symbol definitions rather than just text semantic similarity.
  • When you need systems that can autonomously fall back to web search or tool execution when internal knowledge is insufficient.

Architecture Patterns

  1. Query Decomposition & Routing: Breaking down complex, high-level questions into focused sub-queries. Agents route these sub-queries to appropriate specialized indexes (e.g., code-index, docs-index, general-web).
  2. Hybrid Retrieval + RRF: Combining lexical search (BM25 for acronyms/technical IDs) with dense embedding search (vector similarity), merged using Reciprocal Rank Fusion (RRF) to boost ranking robustness.
  3. Corrective RAG (CRAG): Implementing a relevance grader that evaluates retrieved docs. If quality is low, the agent triggers a fallback workflow (e.g., web search, re-phrasing).
  4. Self-RAG Reflection Loops: Generation output is passed through an evaluator agent that checks for groundedness and relevance. If it fails, the system triggers a re-retrieval or re-generation cycle.
  5. Codebase RAG (AST-aware): Rather than naive chunking, use AST (Abstract Syntax Tree) parsing to extract class/function definitions and method signatures, ensuring the retriever captures the structural context of the codebase.

Implementation Workflow

  1. Data Ingestion:
    • Parse documents with layout-aware tools.
    • For code: extract symbols, classes, and dependencies using tree-sitter.
    • Generate embeddings using multi-modal or code-specialized models (e.g., text-embedding-3-large).
  2. Retrieval:
    • Apply hybrid search (BM25 + Vectors).
    • Use cross-encoder rerankers (e.g., Cohere Rerank, BGE-Reranker) to refine the top-k results.
  3. Agentic Processing:
    • Decomposition Phase: Use LLM to split user query into atomic tasks.
    • Retrieval Phase: Fetch data for each task independently.
    • Grading Phase: Use a "Critic" agent to grade relevance/faithfulness.
    • Generation Phase: Synthesize the answer.
  4. Validation:
    • Hallucination Detection: Compare generation against original retrieved contexts using NLI (Natural Language Inference) models or LLM-as-a-judge.

Quality Gates

  • Grounding Gate: Reject any answer where the supporting evidence score is below a predefined threshold (e.g., 0.8 on a 0-1 scale).
  • Retrieval Quality Gate: If all retrieved segments have low relevance scores, block generation and trigger an automated refinement or search process.
  • Syntactic Integrity Gate (Code RAG): Verify that retrieved code snippets can be resolved/linked back to real codebase identifiers.
  • Confidence Scoring: Require agents to output a confidence score; if low, provide a disclaimer or suggest human intervention.

References


[!NOTE] Agentic RAG introduces latency overhead. Always measure RTT (Round Trip Time) during the evaluation phase to ensure acceptable UX.

[!TIP] For codebase RAG, prefer tool-based indexing (e.g., repomix) over raw file chunking to preserve module boundaries.

[!WARNING] Ensure PI-masking is performed before indexing private repositories, especially when using third-party embedding providers.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

2d-games

무료

2D game development principles. Sprites, tilemaps, physics, camera.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

3d-games

무료

3D game development principles. Rendering, shaders, physics, cameras.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

aesthetic

무료

Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

Use when implementing or managing persistent, hierarchical memory systems for AI agents. Covers cross-session state, fact supersession, and self-managed memory tools to enable long-term recall and adaptive agent behavior.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

Use when monitoring, tracing, or debugging agentic workflows in production. Keywords: observability, tracing, OpenTelemetry, Langfuse, latency, token cost, loop detection, telemetry.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

Use when building autonomous LLM agents operating in live environments. Protects against prompt injection, tool abuse, data exfiltration, and runaway loops. Keywords: guardrails, prompt injection, IPI, safety, sandboxing, NeMo, LLM Guard.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

VoDaiLocz의 스킬 모두 보기

이 스킬의 문제 신고