Token导航 LogoToken导航

Agent Skill · 研究检索

rag-agent-builder(RAG Agent 构建器)

用于搭建或维护带检索增强的 RAG 工作流,适合让 Agent 处理知识库问答、向量检索、来源引用和事实核查。它可以辅助整理数据接入、Embedding、向量库、召回参数和回答生成流程。使用时需要确认数据来源、更新频率、召回阈值和引用展示方式,避免把未命中的资料或过期内容包装成确定事实。

rag-agent-builder 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,674 个 Skill 里排第 31,806。

总安装 2,640周安装 110GitHub Stars 5下载 880核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rag-agent-builder(RAG Agent 构建器)
来源仓库:https://github.com/qodex-ai/ai-agent-skills
仓库路径:skills/rag-agent-builder
安装命令:
npx skills add https://github.com/qodex-ai/ai-agent-skills --skill rag-agent-builder
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/qodex-ai/ai-agent-skills --skill rag-agent-builder

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于搭建或维护带检索增强的 RAG 工作流,支持知识库问答和向量检索。适合让 Agent 处理数据接入、Embedding 生成和回答引用展示,需确认数据来源和召回阈值。通过 GitHub 安装,使用 npx skills add 命令添加指定仓库的技能。避免将未命中资料包装成确定事实,应结合更新频率和引用方式使用。

rag-agent-builder 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/rag-agent-builder

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/qodex-ai/ai-agent-skills --skill rag-agent-bui…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

rag-agent-builder 怎么安装?

在终端执行 npx skills add https://github.com/qodex-ai/ai-agent-skills --skill rag-agent-builder。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

rag-agent-builder 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

rag-agent-builder 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

rag-agent-builder 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

rag-agent-builder 用的人多吗?

公开数据是累计安装 2,640 次,近一周安装 110 次,下载 880 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

rag-agent-builder 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
rag-agent-builder

RAG Agent 构建器 · 本页

2,6405需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

RAG Agent Builder

Build powerful Retrieval-Augmented Generation (RAG) applications that enhance LLM capabilities with external knowledge sources, enabling accurate, contextualized AI responses.

Quick Start

Get started with RAG implementations in the examples and utilities:

  • Examples: See examples/ directory for complete implementations:

- basic_rag.py - Simple chunk-embed-retrieve-generate pipeline - retrieval_strategies.py - Hybrid search, reranking, and filtering - agentic_rag.py - Agent-controlled retrieval with iterative refinement

  • Utilities: See scripts/ directory for helper modules:

- embedding_management.py - Embedding generation, normalization, and caching - vector_db_manager.py - Vector database abstraction and factory - rag_evaluation.py - Retrieval and answer quality metrics

Overview

RAG systems combine three key components:

  1. Document Retrieval - Find relevant information from knowledge bases
  2. Context Integration - Pass retrieved context to the LLM
  3. Response Generation - Generate answers grounded in the retrieved information

This skill covers building production-ready RAG applications with various frameworks and approaches.

Core Concepts

What is RAG?

RAG augments LLM knowledge with external data:

  • Without RAG: LLM relies on training data (may be outdated or limited)
  • With RAG: LLM uses real-time, custom knowledge + training knowledge

When to Use RAG

  • Document Q&A: Answer questions about PDFs, books, reports
  • Knowledge Base Search: Query internal documentation, wikis
  • Enterprise Search: Search proprietary company data
  • Context-Specific Assistants: Customer support, HR assistants
  • Fact-Heavy Applications: Legal docs, medical records, financial data

When RAG Might Not Be Needed

  • General knowledge questions (ChatGPT-like)
  • Real-time data that changes constantly (use tools instead)
  • Very simple lookup tasks (use database queries)

Architecture Patterns

Basic RAG Pipeline

Documents → Chunks → Embeddings → Vector DB
                                        ↓
User Question → Embedding → Retrieval → LLM → Answer
                              ↑         ↓
                         Vector DB    Context

Advanced RAG Patterns

1. Agentic RAG
  • Agent decides what to retrieve and when
  • Can refine queries iteratively
  • Better for complex reasoning
2. Hierarchical RAG
  • Multi-level document structure
  • Search at different levels of detail
  • More flexible organization
3. Hybrid Search RAG
  • Combines keyword search (BM25) + semantic search (embeddings)
  • Captures both exact matches and meaning
  • Better for mixed query types
4. Corrective RAG (CRAG)
  • Evaluates retrieved documents for relevance
  • Retrieves additional sources if needed
  • Ensures high-quality context

Implementation Components

1. Document Processing

Chunking Strategies:

# Simple fixed-size chunks
chunks = split_text(doc, chunk_size=1000, overlap=100)

# Semantic chunks (group by meaning)
chunks = semantic_chunking(doc, max_tokens=512)

# Hierarchical chunks (different levels)
chapters = split_by_heading(doc)
chunks = split_each_chapter(chapters, size=1000)

Key Considerations:

  • Chunk size affects retrieval quality and cost
  • Overlap helps maintain context between chunks
  • Semantic chunking preserves meaning better

2. Embedding Generation

Popular Embedding Models:

  • OpenAI: text-embedding-3-small, text-embedding-3-large
  • Open Source: all-MiniLM-L6-v2, all-mpnet-base-v2
  • Domain-Specific: Domain-trained embeddings for specialized knowledge

Best Practices:

  • Use consistent embedding model for retrieval and queries
  • Store embeddings with normalized vectors
  • Update embeddings when documents change

3. Vector Databases

Popular Options:

  • Pinecone: Managed, serverless, easy to scale
  • Weaviate: Open-source, self-hosted, flexible
  • Milvus: Open-source, high performance
  • Chroma: Lightweight, good for prototypes
  • Qdrant: Production-grade, high-performance

Selection Criteria:

  • Scale requirements (data volume, queries per second)
  • Latency needs (real-time vs batch)
  • Cost considerations
  • Deployment preferences (managed vs self-hosted)

4. Retrieval Strategies

Retrieval Methods:

# Similarity search (most common)
results = vector_db.query(question_embedding, k=5)

# Hybrid search (keyword + semantic)
keyword_results = bm25.search(question, k=3)
semantic_results = vector_db.query(embedding, k=3)
results = combine_and_rank(keyword_results, semantic_results)

# Reranking (improve relevance)
retrieved = initial_retrieval(query)
reranked = rerank_by_relevance(retrieved, query)

Retrieval Parameters:

  • k (number of results): Balance between context and relevance
  • Similarity threshold: Filter out low-relevance results
  • Diversity: Return varied results vs best matches

5. Context Integration

Context Window Management:

# Fit retrieved documents into context window
def prepare_context(retrieved_docs, max_tokens=3000):
    context = ""
    for doc in retrieved_docs:
        if len(tokenize(context + doc)) <= max_tokens:
            context += doc
        else:
            break
    return context

Prompt Design:

You are a helpful assistant. Answer the question based on the provided context.

Context:
{retrieved_documents}

Question: {user_question}

Answer:

6. Response Generation

Generation Strategies:

  • Direct Generation: LLM answers from context
  • Summarization: Summarize multiple retrieved docs first
  • Fact-Grounding: Ensure answer cites sources
  • Iterative Refinement: Refine based on user feedback

Implementation Patterns

Pattern 1: Basic RAG

Simplest RAG implementation:

  1. Split documents into chunks
  2. Generate embeddings for each chunk
  3. Store in vector database
  4. Retrieve top-k similar chunks for query
  5. Pass to LLM with context

Pros: Simple, fast, works well for straightforward QA Cons: May miss relevant context, no refinement

Pattern 2: Agentic RAG

Agent controls retrieval:

  1. Agent receives user question
  2. Decides whether to retrieve documents
  3. Formulates retrieval query (may differ from original)
  4. Retrieves relevant documents
  5. Can iterate or use tools
  6. Generates final answer

Pros: Better for complex questions, iterative improvement Cons: More complex, higher costs

Pattern 3: Corrective RAG (CRAG)

Validates retrieved documents:

  1. Retrieve documents for question
  2. Grade each document for relevance
  3. If poor relevance:

- Try different retrieval strategy - Expand search scope - Retrieve from different sources

  1. Generate answer from validated context

Pros: Higher quality answers, adapts to failures Cons: More API calls, slower

Popular Frameworks

LangChain

from langchain.document_loaders import PDFLoader
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Pinecone
from langchain.chains import RetrievalQA

# Load documents
loader = PDFLoader("document.pdf")
docs = loader.load()

# Create RAG chain
embeddings = OpenAIEmbeddings()
vectorstore = Pinecone.from_documents(docs, embeddings)
qa = RetrievalQA.from_chain_type(
    llm=ChatOpenAI(),
    chain_type="stuff",
    retriever=vectorstore.as_retriever()
)

answer = qa.run("What is the document about?")

LlamaIndex

from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader

# Load documents
documents = SimpleDirectoryReader("./data").load_data()

# Create index
index = GPTVectorStoreIndex.from_documents(documents)

# Query
response = index.as_query_engine().query("What is the main topic?")

CrewAI with RAG

from crewai import Agent, Task, Crew
from tools import retrieval_tool

researcher = Agent(
    role="Research Assistant",
    goal="Research topics using knowledge base",
    tools=[retrieval_tool]
)

research_task = Task(
    description="Research the topic: {topic}",
    agent=researcher
)

Best Practices

Document Preparation

  • ✓ Clean and normalize text (remove headers, footers)
  • ✓ Preserve document structure when possible
  • ✓ Add metadata (source, date, category)
  • ✓ Handle PDFs with OCR if scanned
  • ✓ Test chunk sizes for your domain

Embedding Strategy

  • ✓ Use same embedding model for indexing and queries
  • ✓ Fine-tune embeddings for domain-specific needs
  • ✓ Normalize embeddings for consistency
  • ✓ Monitor embedding quality metrics

Retrieval Optimization

  • ✓ Tune k (number of results) for your use case
  • ✓ Use reranking for quality improvement
  • ✓ Implement relevance filtering
  • ✓ Monitor retrieval precision and recall
  • ✓ Cache frequently retrieved documents

Generation Quality

  • ✓ Include source citations in answers
  • ✓ Prompt LLM to indicate confidence
  • ✓ Ask to cite specific documents
  • ✓ Generate summaries for long contexts
  • ✓ Validate answers against context

Monitoring & Evaluation

  • ✓ Track retrieval metrics (precision, recall, MRR)
  • ✓ Monitor answer quality and relevance
  • ✓ Log failed retrievals for improvement
  • ✓ Collect user feedback
  • ✓ Iterate based on failures

Common Challenges & Solutions

Challenge: Irrelevant Retrieval

Solutions:

  • Improve chunking strategy
  • Better embedding model
  • Add document metadata to queries
  • Implement reranking
  • Use hybrid search

Challenge: Context Too Large

Solutions:

  • Reduce chunk size
  • Retrieve fewer results (smaller k)
  • Summarize retrieved context
  • Use hierarchical retrieval
  • Filter by relevance score

Challenge: Missing Information

Solutions:

  • Increase k (retrieve more)
  • Improve embedding model
  • Better preprocessing
  • Use multiple search strategies
  • Add document hierarchy

Challenge: Slow Performance

Solutions:

  • Use managed vector database
  • Cache embeddings
  • Batch process documents
  • Optimize chunk size
  • Use smaller embedding model for speed

Evaluation Metrics

Retrieval Metrics:

  • Precision: % of retrieved docs that are relevant
  • Recall: % of relevant docs that are retrieved
  • MRR (Mean Reciprocal Rank): Rank of first relevant result
  • NDCG (Normalized DCG): Quality of ranking

Answer Quality Metrics:

  • Relevance: Does answer address the question?
  • Correctness: Is the answer factually accurate?
  • Grounding: Is answer supported by context?
  • User Satisfaction: Would user find answer helpful?

Advanced Techniques

1. Query Expansion

# Expand query with related terms
expanded_query = query + " " + synonym_expansion(query)
results = retrieve(expanded_query)

2. Document Compression

# Compress retrieved docs before passing to LLM
compressed = compress_documents(retrieved_docs, query)
context = format_context(compressed)

3. Active Retrieval

# Iteratively refine retrieval based on LLM output
query = user_question
while iterations < max:
    results = retrieve(query)
    answer = generate_with_context(results)
    if answer_complete(answer):
        break
    query = refine_query(answer)

4. Multi-Modal RAG

# Retrieve both text and images
text_results = text_retriever.query(question)
image_results = image_retriever.query(question)
context = combine_multimodal(text_results, image_results)

Resources & References

Key Papers

  • "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks" (Lewis et al.)
  • "REALM: Retrieval-Augmented Language Model Pre-Training" (Guu et al.)

Frameworks

Vector Databases

Embedding Models

Next Steps

  1. Choose your stack: Decide on framework (LangChain, LlamaIndex, etc.)
  2. Prepare documents: Process and chunk your knowledge base
  3. Select embeddings: Choose embedding model for your domain
  4. Pick vector DB: Select storage solution for scale
  5. Build pipeline: Implement retrieval and generation
  6. Evaluate: Test on sample questions and iterate
  7. Monitor: Track quality metrics in production

适合场景

01

研究助手

02

事实核查

03

知识库问答

04

带来源的搜索总结

能力概览

能力 1

组合搜索和大模型调用

能力 2

支持多来源检索和总结

能力 3

强调引用来源和事实核查

能力 4

适合研究型 Agent 流程

平台分布

Antigravity

26.09%
按下载量换算230

Claude Code

26.04%
按下载量换算229

trae

16.61%
按下载量换算146

Codex

12.17%
按下载量换算107

Gemini CLI

8.25%
按下载量换算73

windsurf

3.32%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills