Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.
日本語の概要は準備中です。原文の説明を表示しています。
Designs RAG retrieval for LLM grounding: chunking, BM25+vector hybrid, reranking, GraphRAG. Use when adding embeddings to SQLite FTS5 search or running held-out retrieval eval.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Operating posture
../ai-context-layer/references/retrieve-vs-preload-vs-finetune.md before building a RAG pipeline.Scope note: For generation-prompt structure and output contracts after retrieval, use ai-prompt-engineering.
Implementation note: This skill owns retrieval theory and evaluation concepts. For vector-brain builds with paste-ready SQL, pgvector assets, manifests, ingest scripts, and agent retrieval tool contracts, use ai-vector-brain.
scripts/retrieval_eval.py to measure recall@k, MRR, and nDCG. scripts/exact_search_baseline.py is exhaustive vector search for checking ANN loss; its hash embedder is a lexical smoke fixture, not a learned embedding benchmark.| Need | Recommended path | Use when | Avoid when |
|---|---|---|---|
| Small corpus fits in context | Long-context prompt or lightweight search | Low update rate, low audit burden | Corpus is large, fast-changing, or citation-critical |
| Provider-managed retrieval | Provider web-search server tool (look up the current versioned tool ID) or hosted file search | Fresh web data with citations, fast start, no infra to operate | You need residency controls, custom ranking internals, or corpus isolation beyond provider defaults |
| Provider-managed file/doc retrieval | OpenAI file-search (Responses API) | Standard docs/Q&A, limited infra appetite | You need custom ranking, strict residency controls, or deep retrieval tuning |
| Provider-managed doc retrieval on AWS | AWS Bedrock Knowledge Bases | AWS-native, want managed ingestion + embedding + retrieval with IAM/residency controls | You need cross-cloud portability or custom ranking internals → references/aws-bedrock-knowledge-bases.md |
| Source of truth is tools/APIs | Tool-first or MCP retrieval | Data lives in SQL, CRM, ticketing, SaaS APIs, or internal tools | You actually need semantic retrieval over large prose corpora |
| Website or research ingestion | Crawl/extract first, then index | The source starts as websites, reports, or broad web research | You only need one-off browsing instead of a maintained retrieval system |
| Whole-document or thematic questions | RAPTOR-style summary tree (recursive cluster + summarise, retrieve across levels) | Answers need synthesis across a long doc or many sections, no entity graph exists | Questions are passage-level lookups, or the corpus churns faster than the tree can be rebuilt → references/retrieval-patterns.md §6 |
| Exact joins or aggregations | SQL/graph retrieval | Questions need filters, joins, counts, or relationship traversal | Natural-language corpus lookup is the main problem |
| Standard knowledge retrieval | Hybrid search + rerank | Mixed lexical + semantic queries, high recall, controllable latency | A simpler hosted or tool-first option already solves the problem |
| Generated repo/context hub corpus | Graph-bounded hybrid (graph scopes, vector recalls, rerank) | A compiled multi-repo/context hub with an existing knowledge/code graph | The corpus has no graph, or simple semantic lookup already passes eval |
| High-precision retrieval | Late interaction / multivector retrieval | Near-duplicate docs, subtle wording differences, PDF pages, multilingual precision | Latency budget is tight and BM25+dense+reranking is already sufficient |
| PDFs, tables, diagrams | Multimodal document retrieval | OCR loses structure or layout meaning matters | Plain text extraction is already high quality |
| Production readiness proof | Golden eval + exact baseline + traces | You need to prove quality, not just describe architecture | One-off exploratory research with no durable corpus |
Need external knowledge?
├─ No -> Use direct prompting / standard prompt engineering
└─ Yes
├─ Data already lives behind tools, APIs, SQL, or SaaS?
│ └─ Start with tool-first or MCP retrieval
│
├─ Corpus fits comfortably in model context and changes slowly?
│ └─ Try long-context or hosted file search before custom indexing
│
├─ Need joins, counts, or relationship traversal?
│ └─ Use SQL, graph, or graph+vector hybrid retrieval
│ (paradigm choice: see ../software-database-design/SKILL.md#technology-selection)
│
├─ Need fresh web data or provider-managed file search without self-hosting?
│ └─ Evaluate managed retrieval first: provider web-search server tools,
│ hosted file-search, or other provider-native tools before building a custom stack
│ (see references/managed-retrieval-vs-self-hosted.md for decision criteria)
│
├─ Need retrieval over prose or mixed documents?
│ └─ Use sparse+dense hybrid as the default baseline
│
├─ Retrieval misses subtle matches or page-level structure?
│ └─ Add late interaction, multivector, or multimodal retrieval
│
├─ Precision still poor?
│ └─ Add reranking, filters, query rewriting, and stronger evals
│
└─ Same queries keep re-running synthesis? Need a reviewable knowledge asset?
└─ Switch from retrieval to knowledge compilation (P7 in ai-context-layer)
Route to ai-context-layer/references/knowledge-compilation-and-wiki-pattern.md
Blocks A15 (RAG re-run per turn instead of compiled knowledge)
ai-vector-brain must show the ACL filter at or before candidate generation.| Need | Route to |
|---|---|
| Product or site search for end users (engine choice, facets, autocomplete, merchandising, reindexing, search analytics) | ../software-search/SKILL.md |
Personal note collection where an LLM-maintained INDEX.md passes retrieval eval | ../docs-notes-retrieval/SKILL.md |
| Paste-ready SQL, DDL, pgvector indexes, or backend loader scripts | ../ai-vector-brain/SKILL.md |
| Building a repo/docs/compliance vector brain end to end | ../ai-vector-brain/SKILL.md |
| App context architecture, memory lifecycle, and grounding boundaries | ../ai-context-layer/SKILL.md |
| Agent topology and tool orchestration | ../ai-agents/SKILL.md |
| Bot UX, conversation flows, and escalation | ../ai-bot-builder/SKILL.md |
On-device iOS retrieval-stitch composer (Apple Foundation Models, @Generable, retrieval over local chunks with no-cloud guarantee) | ../software-ios-ai-engine/SKILL.md |
End-to-end natural conversational iOS surface composed with this skill + ai-context-layer + ai-vector-brain, Path A (Foundation Models) and Path B (vector-DB-only) | ../software-ios-ai-engine/references/composition-with-rag-context-vector.md |
| Cross-platform natural conversation (iOS / Android / web / Telegram-Discord-WhatsApp-Slack bots / voice / backend) with or without on-device models | ../ai-context-layer/references/conversational-surfaces-cross-platform.md |
Before changing chunking, embeddings, reranking, or the generator, label failures as corpus absence, ingest loss, candidate miss, ranking miss, context packing loss, citation mismatch, or answer-generation error. Run the generator once with oracle evidence and run retrieval against gold evidence IDs. If oracle context still fails, fix the answer contract or model path; if gold evidence never enters the candidate set, fix ingestion or retrieval. Tune only the stage that owns the measured loss and retain the previous stage as the control.
See references/quick-start-guide.md for detailed root-cause analysis of each anti-pattern below.
../ai-context-layer/references/anti-patterns-catalog.md)../ai-context-layer/references/knowledge-compilation-and-wiki-pattern.md)When users ask for "best" tools, models, or frameworks:
add_as_web_search: true.See references/research-and-ingestion-patterns.md for crawl/extract (Firecrawl-style), research loops (GPT Researcher-style), recurring data pipelines (dlt-style), and CLI evaluation workflows (simonw/llm-style). Core rule: separate crawl/extract from rank/retrieve, keep raw capture and chunks as distinct artifacts.
check_sources.py — validate sources.json · retrieval_eval.py — recall@k/MRR/nDCG · check_citation_support.py — evidence-ID verification · generate_synthetic_rag_testset.py — testset scaffolds · late_interaction_eval.py — ColBERT/ColPali offline eval (no inference runner) · exact_search_baseline.py — exact cosine/dot baseline · hybrid_rrf_demo.py — BM25 (k1/b) + vector + RRF smoke test
Architecture & choice: retrieval-choice-framework.md · managed-retrieval-vs-self-hosted.md · pipeline-architecture.md · aws-bedrock-knowledge-bases.md
Corpus & chunking: chunking-strategies.md · chunking-patterns.md · index-selection-guide.md · embedding-model-guide.md · research-and-ingestion-patterns.md · pdf-heavy-retrieval-playbook.md
Retrieval patterns: retrieval-patterns.md · vector-search-patterns.md · hybrid-fusion-patterns.md · bm25-tuning.md · graph-rag-patterns.md · contextual-retrieval-guide.md · advanced-rag-patterns.md · agentic-rag-patterns.md
Ranking & query: ranking-pipeline-guide.md · query-rewriting-patterns.md · backend-comparison-fixtures.md
Grounding & eval: grounding-checklists.md · confidence-scoring.md · abstention-recipe.md · rag-evaluation-guide.md
Ops & debugging: observability-tracing-contract.md · retrieval-debugging-runbook.md · rag-troubleshooting.md · rag-caching-patterns.md · multilingual-domain-patterns.md · security-red-team-cases.md
Product-search eval, learning to rank, click models, and search SLOs live in software-search: search-evaluation-guide.md (nDCG/MRR judged sets, reusable for retrieval eval) · learning-to-rank-pipeline.md · click-models-and-bias-correction.md · user-feedback-learning.md · distributed-search-slos.md · search-debugging.md
Onboarding: quick-start-guide.md - workflow, full template index, detailed anti-patterns · wiki-grounded-retrieval.md
Eval data: backend comparison template · golden retrieval predictions example · security red-team cases · RAG testset · search testset · search evaluation template
Ranking: ranking pipeline · reranker configuration
Retrieval variants: graph + vector · multimodal document · multivector · tool-first
Search index configs: BM25 · HNSW · hybrid search · IVF
../ai-context-layer/references/anti-patterns-catalog.md - A2, A10, A13, A15 anti-patterns referenced throughout this skill../ai-context-layer/references/retrieve-vs-preload-vs-finetune.md - Decision rubric: RAG vs long-context vs fine-tune../ai-context-layer/references/knowledge-compilation-and-wiki-pattern.md - P7 pattern for compiled knowledge (A15 fix)../ai-vector-brain/references/dev-context-hub-vector-recipe.md - Graph-bounded build path for generated-context corpora../software-ios-ai-engine/references/composition-with-rag-context-vector.md - iOS conversational RAG compositionGate before invoking: each foundation has a When to Apply / When to Skip section.
When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both. After applying it, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.
日本語の概要は準備中です。原文の説明を表示しています。
Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.
日本語の概要は準備中です。原文の説明を表示しています。
Owns instruction files: AGENTS.md, CLAUDE.md, personal and repo rules. Use when writing, pruning, auditing them, sharing rules across Claude and Codex, or fixing ignored rules.
日本語の概要は準備中です。原文の説明を表示しています。
Creates and audits agent skills: SKILL.md, references, scripts, runtime metadata. Use when writing, validating, or security-reviewing a skill, or fixing truncated skill listings.
日本語の概要は準備中です。原文の説明を表示しています。
Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.
日本語の概要は準備中です。原文の説明を表示しています。
Chooses subagent, team, workflow, or debate and launches it on Claude Code or Codex. Use when delegating, running agent review boards, or installing shared agents.
日本語の概要は準備中です。原文の説明を表示しています。