ai-rag-pipeline
Webサーチとリードモデル(LLM)を組み合わせたRAG(検索強化生成)パイプラインを構築できます。利用可能なツール:Tavily Search、Exa Search、Exa Answer、Claude、GPT-4、OpenRouterを経由したGemini。リサーチ、ファクトチェック、根拠のある回答生成、知識検索などの機能に対応しており、AIエージェント、リサーチアシスタント、ファクトチェッカーなど様々な用途で活用できます。
description の原文を見る
Build RAG (Retrieval Augmented Generation) pipelines with web search and LLMs. Tools: Tavily Search, Exa Search, Exa Answer, Claude, GPT-4, Gemini via OpenRouter. Capabilities: research, fact-checking, grounded responses, knowledge retrieval. Use for: AI agents, research assistants, fact-c...
SKILL.md 本文
AI RAG パイプライン
使用する場合
必要に応じてこのスキルを使用して、指定された自動化タスクを実行します。
inference.sh CLIを使用してRAG(Retrieval Augmented Generation)パイプラインを構築します。

クイックスタート
curl -fsSL https://cli.inference.sh | sh && infsh login
# シンプルなRAG:検索 + LLM
SEARCH=$(infsh app run tavily/search-assistant --input '{"query": "latest AI developments 2024"}')
infsh app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Based on this research, summarize the key trends: $SEARCH\"
}"
RAGとは?
RAGは以下を組み合わせたものです:
- 検索(Retrieval): 外部ソースから関連情報を取得
- 拡張(Augmentation): 取得したコンテキストをプロンプトに追加
- 生成(Generation): LLMがコンテキストを使用して応答を生成
これにより、より正確で最新の、かつ検証可能なAI応答が得られます。
RAGパイプラインパターン
パターン1:シンプルな検索 + 回答
[ユーザークエリ] -> [ウェブ検索] -> [コンテキスト付きLLM] -> [回答]
パターン2:複数ソース研究
[クエリ] -> [複数検索] -> [集約] -> [LLM分析] -> [レポート]
パターン3:抽出 + 処理
[URL] -> [コンテンツ抽出] -> [チャンキング] -> [LLM要約] -> [出力]
利用可能なツール
検索ツール
| ツール | アプリID | 最適用途 |
|---|---|---|
| Tavily Search | tavily/search-assistant | AI搭載の回答付き検索 |
| Exa Search | exa/search | ニューラル検索、セマンティックマッチング |
| Exa Answer | exa/answer | 直接的な事実回答 |
抽出ツール
| ツール | アプリID | 最適用途 |
|---|---|---|
| Tavily Extract | tavily/extract | URLからのクリーンなコンテンツ |
| Exa Extract | exa/extract | ウェブコンテンツの分析 |
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_RESULT=$(infsh app run tavily/search-assistant --input '{
"query": "What are the latest breakthroughs in quantum computing 2024?"
}')
# 2. 根拠のある応答を生成
infsh 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.\"
}"
複数ソース研究
# 複数のソースを検索
TAVILY=$(infsh app run tavily/search-assistant --input '{"query": "electric vehicle market trends 2024"}')
EXA=$(infsh app run exa/search --input '{"query": "EV market analysis latest reports"}')
# 統合して分析
infsh 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. 特定のURLからコンテンツを抽出
CONTENT=$(infsh app run tavily/extract --input '{
"urls": [
"https://example.com/research-paper",
"https://example.com/industry-report"
]
}')
# 2. 抽出したコンテンツを分析
infsh 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="AI will replace 50% of jobs by 2030"
# 1. エビデンスを検索
EVIDENCE=$(infsh app run tavily/search-assistant --input "{
\"query\": \"$CLAIM evidence studies research\"
}")
# 2. クレームを検証
infsh 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. 初期研究
OVERVIEW=$(infsh app run tavily/search-assistant --input "{\"query\": \"$TOPIC overview\"}")
STATISTICS=$(infsh app run exa/search --input "{\"query\": \"$TOPIC statistics data\"}")
OPINIONS=$(infsh app run tavily/search-assistant --input "{\"query\": \"$TOPIC expert opinions\"}")
# 2. 包括的なレポートを生成
infsh 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\"
}"
ソース付きクイック回答
# ファクトチェック質問にはExa Answerを使用
infsh app run exa/answer --input '{
"question": "What is the current market cap of NVIDIA?"
}'
ベストプラクティス
1. クエリの最適化
# 悪い例:不明瞭
"AI news"
# 良い例:具体的でコンテキスト指向
"latest developments in large language models January 2024"
2. コンテキスト管理
# LLMに送信する前に長い検索結果を要約
SEARCH=$(infsh app run tavily/search-assistant --input '{"query": "..."}')
# 長い場合は、まず要約
SUMMARY=$(infsh app run openrouter/claude-haiku-45 --input "{
\"prompt\": \"Summarize these search results in bullet points: $SEARCH\"
}")
# その後、分析に要約を使用
infsh app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Based on this research summary, provide insights: $SUMMARY\"
}"
3. ソースの表示
常にLLMにソースを引用するよう指示します:
infsh app run openrouter/claude-sonnet-45 --input '{
"prompt": "... Always cite sources in [Source Name](URL) format."
}'
4. イテラティブな研究
# 第1パス:広範な検索
INITIAL=$(infsh app run tavily/search-assistant --input '{"query": "topic overview"}')
# 第2パス:初期検索から得られた知見に基づいて詳く掘り下げる
DEEP=$(infsh app run tavily/search-assistant --input '{"query": "specific aspect from initial search"}')
パイプラインテンプレート
エージェント研究ツール
#!/bin/bash
# research.sh - 再利用可能な研究関数
research() {
local query="$1"
# 検索
local results=$(infsh app run tavily/search-assistant --input "{\"query\": \"$query\"}")
# 分析
infsh app run openrouter/claude-haiku-45 --input "{
\"prompt\": \"Summarize: $results\"
}"
}
research "your query here"
関連スキル
# ウェブ検索ツール
npx skills add inference-sh/skills@web-search
# LLMモデル
npx skills add inference-sh/skills@llm-models
# コンテンツパイプライン
npx skills add inference-sh/skills@ai-content-pipeline
# フルプラットフォームスキル
npx skills add inference-sh/skills@inference-sh
すべてのアプリを確認:infsh app list
ドキュメント
- エージェントへのツール追加 - エージェントツール統合
- 研究エージェントの構築 - 完全ガイド
ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ
詳細情報
- 作者
- JantonioFC
- ライセンス
- MIT
- 最終更新
- 2026/5/9
Source: https://github.com/JantonioFC/skillsbank / ライセンス: MIT