rag-agent-builder
БесплатноЗапускает вложенные скриптыНе проверенBuild Retrieval-Augmented Generation (RAG) applications that combine LLM capabilities with external knowledge sources. Covers vector databases, embeddings…
от qodex-ai★ 50 звёзд на GitHubОб этом скилле
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 pipelineretrieval_strategies.py- Hybrid search, reranking, and filteringagentic_rag.py- Agent-controlled retrieval with iterative refinement
Utilities: See
scripts/directory for helper modules:embedding_management.py- Embedding generation, normalization, and cachingvector_db_manager.py- Vector database abstraction and factoryrag_evaluation.py- Retrieval and answer quality metrics
Overview
RAG systems combine three key components:
- Document Retrieval - Find relevant information from knowledge bases
- Context Integration - Pass retrieved context to the LLM
- 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)
`
Установить rag-agent-builder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rag-agent-builder?
Build Retrieval-Augmented Generation (RAG) applications that combine LLM capabilities with external knowledge sources. Covers vector databases, embeddings, retrieval strategies, and response generation. Use when building document Q&A systems, knowledge base applications, enterprise search, or combining LLMs with custom data.
Как установить скилл rag-agent-builder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rag-agent-builder запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic