ai-rag-pipeline について
ai-rag-pipelineは、inference.sh CLI(belt)で検索拡張生成のワークフローを構築するスキルです。外部情報とLLMを組み合わせる調査やエージェントの用途向けに、検索、抽出、複数ソース分析の例を提供します。
主な機能
- 01検索結果とLLMの回答を組み合わせ
- 02複数ソースの調査と集約
- 03URLからコンテンツを抽出・処理
- 04ファクトチェックとレポートの例
活用シーン
- 01ウェブ検索を根拠とする回答の生成
- 02複数ソースの要約と比較
- 03ウェブコンテンツの抽出と要約
- 04主張を検証するための証拠検索
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ inference-sh/ skills --skill ai-rag-pipelineインストール後、Claude Code で/ai-rag-pipelineを入力して読み込まれたか確認します。
詳細
belt CLI スキルをインストール:
npx skills add belt-sh/cli
AI RAG パイプライン
inference.sh CLI を使って RAG(検索拡張生成)パイプラインを構築します。

クイックスタート
inference.sh CLI(
belt)が必要です。インストール手順
belt login
# Simple RAG: Search + LLM
SEARCH=$(belt app run tavily/search-assistant --input '{"query": "latest AI developments 2024"}')
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Based on this research, summarize the key trends: $SEARCH\"
}"
RAG とは?
RAG は次の要素を組み合わせます。
- 検索:外部ソースから関連情報を取得します
- 拡張:取得したコンテキストをプロンプトに追加します
- 生成:LLM がコンテキストを使って応答を生成します
これにより、より正確で最新かつ検証可能な AI の応答が得られます。
RAG パイプラインのパターン
パターン 1:シンプルな検索+回答
[User Query] -> [Web Search] -> [LLM with Context] -> [Answer]
パターン 2:複数ソースの調査
[Query] -> [Multiple Searches] -> [Aggregate] -> [LLM Analysis] -> [Report]
パターン 3:抽出+処理
[URLs] -> [Content Extraction] -> [Chunking] -> [LLM Summary] -> [Output]
利用可能なツール
検索ツール
| ツール | アプリ ID | 最適な用途 |
|---|---|---|
| Tavily 検索 | tavily/search-assistant | 回答付きの AI 検索 |
| Exa 検索 | exa/search | ニューラル検索、意味的マッチング |
| Exa 回答 | exa/answer | 事実に基づく直接的な回答 |
抽出ツール
| ツール | アプリ ID | 最適な用途 |
|---|---|---|
| Tavily 抽出 | tavily/extract | URL からクリーンなコンテンツを取得 |
| Exa 抽出 | exa/extract | Web コンテンツの分析 |
LLM ツール
| モデル | アプリ ID | 最適な用途 |
|---|---|---|
| Claude Sonnet 4.5 | openrouter/claude-sonnet-45 | 複雑な分析 |
| Claude Haiku 4.5 | openrouter/claude-haiku-45 | 高速な処理 |
| GPT-4o | openrouter/gpt-4o | 汎用 |
| Gemini 2.5 Pro | openrouter/gemini-25-pro | 長いコンテキスト |
パイプラインの例
基本的な RAG パイプライン
# 1. Search for information
SEARCH_RESULT=$(belt app run tavily/search-assistant --input '{
"query": "What are the latest breakthroughs in quantum computing 2024?"
}')
# 2. Generate grounded response
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"You are a research assistant. Based on the following search results, provide a comprehensive summary with citations.
Search Results:
$SEARCH_RESULT
Provide a well-structured summary with source citations.\"
}"
複数ソースの調査
# Search multiple sources
TAVILY=$(belt app run tavily/search-assistant --input '{"query": "electric vehicle market trends 2024"}')
EXA=$(belt app run exa/search --input '{"query": "EV market analysis latest reports"}')
# Combine and analyze
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Analyze these research results and identify common themes and contradictions.
Source 1 (Tavily):
$TAVILY
Source 2 (Exa):
$EXA
Provide a balanced analysis with sources.\"
}"
URL コンテンツの分析
# 1. Extract content from specific URLs
CONTENT=$(belt app run tavily/extract --input '{
"urls": [
"https://example.com/research-paper",
"https://example.com/industry-report"
]
}')
# 2. Analyze extracted content
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Analyze these documents and extract key insights:
$CONTENT
Provide:
1. Key findings
2. Data points
3. Recommendations\"
}"
ファクトチェックのパイプライン
# Claim to verify
CLAIM="AI will replace 50% of jobs by 2030"
# 1. Search for evidence
EVIDENCE=$(belt app run tavily/search-assistant --input "{
\"query\": \"$CLAIM evidence studies research\"
}")
# 2. Verify claim
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Fact-check this claim: '$CLAIM'
Based on the following evidence:
$EVIDENCE
Provide:
1. Verdict (True/False/Partially True/Unverified)
2. Supporting evidence
3. Contradicting evidence
4. Sources\"
}"
調査レポートの生成
TOPIC="Impact of generative AI on creative industries"
# 1. Initial research
OVERVIEW=$(belt app run tavily/search-assistant --input "{\"query\": \"$TOPIC overview\"}")
STATISTICS=$(belt app run exa/search --input "{\"query\": \"$TOPIC statistics data\"}")
OPINIONS=$(belt app run tavily/search-assistant --input "{\"query\": \"$TOPIC expert opinions\"}")
# 2. Generate comprehensive report
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Generate a comprehensive research report on: $TOPIC
Research Data:
== Overview ==
$OVERVIEW
== Statistics ==
$STATISTICS
== Expert Opinions ==
$OPINIONS
Format as a professional report with:
- Executive Summary
- Key Findings
- Data Analysis
- Expert Perspectives
- Conclusion
- Sources\"
}"
ソース付きのクイック回答
# Use Exa Answer for direct factual questions
belt app run exa/answer --input '{
"question": "What is the current market cap of NVIDIA?"
}'
ベストプラクティス
1. クエリの最適化
# Bad: Too vague
"AI news"
# Good: Specific and contextual
"latest developments in large language models January 2024"
2. コンテキストの管理
# Summarize long search results before sending to LLM
SEARCH=$(belt app run tavily/search-assistant --input '{"query": "..."}')
# If too long, summarize first
SUMMARY=$(belt app run openrouter/claude-haiku-45 --input "{
\"prompt\": \"Summarize these search results in bullet points: $SEARCH\"
}")
# Then use summary for analysis
belt app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Based on this research summary, provide insights: $SUMMARY\"
}"
3. ソースの明記
LLM にソースを引用するよう必ず指示してください。
belt app run openrouter/claude-sonnet-45 --input '{
"prompt": "... Always cite sources in [Source Name](URL) format."
}'
4. 反復的な調査
# First pass: broad search
INITIAL=$(belt app run tavily/search-assistant --input '{"query": "topic overview"}')
# Second pass: dive deeper based on findings
DEEP=$(belt app run tavily/search-assistant --input '{"query": "specific aspect from initial search"}')
パイプラインのテンプレート
エージェント調査ツール
#!/bin/bash
# research.sh - Reusable research function
research() {
local query="$1"
# Search
local results=$(belt app run tavily/search-assistant --input "{\"query\": \"$query\"}")
# Analyze
belt app run openrouter/claude-haiku-45 --input "{
\"prompt\": \"Summarize: $results\"
}"
}
research "your query here"
関連スキル
# Web search tools
npx skills add inference-sh/skills@web-search
# LLM models
npx skills add inference-sh/skills@llm-models
# Content pipelines
npx skills add inference-sh/skills@ai-content-pipeline
# Full platform skill
npx skills add inference-sh/skills@infsh-cli
すべてのアプリを表示:belt app list
ドキュメント
- エージェントへのツールの追加 - エージェントへのツール統合
- 調査エージェントの構築 - 詳細ガイド
コメント
Markdown 対応