rag-architect
БесплатноЗапускает вложенные скриптыНе проверенDesigns and evaluates RAG pipelines: chunking analysis, retrieval metrics on your queries, first-pass designs with costs. Use when building a RAG system…
от borghei★ 1 250 звёзд на GitHubОб этом скилле
RAG Architect
The agent designs, implements and tunes retrieval-augmented generation pipelines from chunking through evaluation, and makes every choice (chunking, embedding model, vector store, retrieval mode, reranking) answer to a measured retrieval score on the user's own queries.
Core Capabilities
- Chunking strategy selection: fixed-size, sentence, paragraph, semantic, recursive or document-aware chunking, sized to the corpus.
- Embedding and vector-store choice: local vs API models and Pinecone, Weaviate, Qdrant, Chroma or pgvector by scale, latency, cost and data residency.
- Retrieval design: dense, sparse (BM25) or hybrid retrieval with Reciprocal Rank Fusion, plus cross-encoder reranking when precision matters most.
- Query transformations: HyDE, multi-query and step-back for style mismatch and ambiguous queries.
- Guardrails and evaluation: source attribution, groundedness checks, injection defences; IR metrics (Precision@K, Recall@K, MRR, NDCG) and RAGAS-style generation metrics.
When to Use
- Building a RAG system end to end, or replacing one component.
- Selecting a chunking strategy, embedding model or vector database.
- Diagnosing poor answers: deciding whether retrieval or generation is at fault.
- Setting up a retrieval regression test before changing the pipeline.
Clarify First
Before designing the pipeline, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Corpus characteristics: size, structure, languages and domain (drive chunking and the embedding shortlist).
- Scale, latency and cost constraints: query volume, budget, and whether data may leave the infrastructure.
- Retrieval quality target: the bar to meet (a high precision target usually means hybrid retrieval plus reranking).
- Query types: ambiguous, multi-hop or style-mismatched (decides which query transforms to try).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Workflow
- Build the ground truth first: 50 or more real queries with the documents that answer them. Without it no choice below can be verified.
- Draft the design with
rag_pipeline_designer.pyfrom a requirements file; treat its picks as a starting point. - Choose chunking with
chunking_optimizer.pyon a sample of the real corpus. - Shortlist embedding models using references/embedding_model_benchmark.md, embed the same chunks with each, and compare.
- Measure with
retrieval_evaluator.py. Validation checkpoint: the chosen configuration beats the TF-IDF baseline and meets the agreed target on Recall@k and MRR; read the worst queries by hand. - Done when the design, model ids and versions, chunk parameters and the evaluation scores are written down, and the evaluation runs as a regression test before any pipeline change.
Quick Start
# from engineering/rag-architect/ (the tools live at the skill root)
python3 rag_pipeline_designer.py assets/sample_requirements.json
python3 chunking_optimizer.py assets/corpus
python3 retrieval_evaluator.py assets/sample_queries.json assets/corpus assets/sample_ground_truth.json
python3 rag_pipeline_designer.py assets/flawed_requirements.json # exit 2: accuracy_priority must be a number
The evaluator's built-in TF-IDF baseline gets Precision@1 of 0.50 on the sample: two of four plain-language queries miss on wording, which is the gap dense or hybrid retrieval should close.
Tools Overview
| Tool | Purpose | Key flags | Exit codes |
|---|---|---|---|
chunking_optimizer.py |
Runs 12 chunking configurations over a document directory and recommends one with parameters | directory, --config, --extensions, --output, --verbose |
0 report; 2 missing directory or unreadable input |
retrieval_evaluator.py |
Precision@K, Recall@K, MRR, NDCG and failure analysis for a query set against a corpus (TF-IDF baseline retriever) | queries corpus ground_truth, --k-values 1 5 10, --output, --verbose |
0 report; 2 unreadable input |
rag_pipeline_designer.py |
Component picks, monthly cost estimate, Mermaid diagram and config templates from requirements | requirements, --output, --verbose |
0 design; 2 invalid requirements |
Requirements fields: document_types (list), document_count, avg_document_size (characters), queries_per_day (integers), query_patterns (list), latency_requirement, budget_monthly (number), accuracy_priority and cost_priority (numbers from 0 to 1), maintenance_complexity (low, medium or high). Embedding prices in the designer are OpenAI's published rates as of 2026-11 ($0.02 per 1M tokens for text-embedding-3-small, $0.13 per 1M for `
Установить rag-architect в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rag-architect?
Designs and evaluates RAG pipelines: chunking analysis, retrieval metrics on your queries, first-pass designs with costs. Use when building a RAG system, choosing chunking, embeddings or a vector store, or fixing poor retrieval.
Как установить скилл rag-architect?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rag-architect запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic