Skip to content
Agentmart
Submit a tool

agentic-rag

Use when building self-correcting retrieval systems for AI agents.

Skill by VoDaiLocz

IndexedApache-2.0★ 28
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/vodailocz-agentic-rag

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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

Use cases: ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/agentic-rag

What's inside

Skill name
agentic-rag
Description
Use when building self-correcting retrieval systems for AI agents. Keywords: RAG, retrieval, Corrective RAG, Self-RAG, query decomposition, reranking, hallucination, grounding.
License
Apache-2.0
Instructions
56 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 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
- [CRAG (Corrective RAG)](https://arxiv.org/abs/2401.15884)
- [Self-RAG: Learning to Retrieve, Generate, and Critique](https://arxiv.org/abs/2310.11511)
- [Reciprocal Rank Fusion (RRF)](https://plg.uwaterloo.ca/~gvcormac/cormacksigir09-rrf.pdf)
- [Agentic Retrieval-Augmented Generation](https://docs.llamaindex.ai/)

---
> [!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.

From VoDaiLocz/kilo-kit-mcp, Apache-2.0.

More from VoDaiLocz/kilo-kit-mcp

Signals

Stars
28
Forks
3
Open issues
0
Last commit (this folder)
Aug 21, 2026 (2 months ago)
Last release
Oct 24, 2026 (4 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from VoDaiLocz

Cite this page

agentic-rag skill. Agent Mart. https://agentmart.dev/skills/vodailocz-agentic-rag (last updated 2026-10-24)