ai-rag-pipeline by inferen-sh/skills
npx skills add https://github.com/inferen-sh/skills --skill ai-rag-pipeline通过 inference.sh CLI 构建 RAG(检索增强生成)管道。

需要 inference.sh CLI (
infsh)。安装说明
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 结合了:
这能产生更准确、更新及时且可验证的 AI 响应。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
[用户查询] -> [网络搜索] -> [带上下文的 LLM] -> [答案]
[查询] -> [多重搜索] -> [聚合] -> [LLM 分析] -> [报告]
[URLs] -> [内容提取] -> [分块] -> [LLM 摘要] -> [输出]
| 工具 | App ID | 最佳用途 |
|---|---|---|
| Tavily 搜索 | tavily/search-assistant | 带答案的 AI 驱动搜索 |
| Exa 搜索 | exa/search | 神经搜索,语义匹配 |
| Exa 回答 | exa/answer | 直接的事实性回答 |
| 工具 | App ID | 最佳用途 |
|---|---|---|
| Tavily 提取 | tavily/extract | 从 URL 中提取干净内容 |
| Exa 提取 | exa/extract | 分析网页内容 |
| 模型 | App 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 | 长上下文 |
# 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.\"
}"
# 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?"
}'
# 差:太模糊
"AI news"
# 好:具体且有上下文
"latest developments in large language models January 2024"
# 在发送给 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\"
}"
始终要求 LLM 引用来源:
infsh app run openrouter/claude-sonnet-45 --input '{
"prompt": "... Always cite sources in [Source Name](URL) format."
}'
# 第一轮:广泛搜索
INITIAL=$(infsh app run tavily/search-assistant --input '{"query": "topic overview"}')
# 第二轮:根据初步发现深入挖掘
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@infsh-cli
浏览所有应用:infsh app list
每周安装量
7.2K
代码仓库
GitHub 星标数
202
首次出现
14 天前
安全审计
安装于
claude-code5.8K
gemini-cli5.2K
codex5.2K
opencode5.2K
amp5.2K
kimi-cli5.2K
Build RAG (Retrieval Augmented Generation) pipelines via inference.sh CLI.

Requires inference.sh CLI (
infsh). Install instructions
infsh login
# Simple RAG: Search + 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 combines:
This produces more accurate, up-to-date, and verifiable AI responses.
[User Query] -> [Web Search] -> [LLM with Context] -> [Answer]
[Query] -> [Multiple Searches] -> [Aggregate] -> [LLM Analysis] -> [Report]
[URLs] -> [Content Extraction] -> [Chunking] -> [LLM Summary] -> [Output]
| Tool | App ID | Best For |
|---|---|---|
| Tavily Search | tavily/search-assistant | AI-powered search with answers |
| Exa Search | exa/search | Neural search, semantic matching |
| Exa Answer | exa/answer | Direct factual answers |
| Tool | App ID | Best For |
|---|---|---|
| Tavily Extract | tavily/extract | Clean content from URLs |
| Exa Extract | exa/extract | Analyze web content |
| Model | App ID | Best For |
|---|---|---|
| Claude Sonnet 4.5 | openrouter/claude-sonnet-45 | Complex analysis |
| Claude Haiku 4.5 | openrouter/claude-haiku-45 | Fast processing |
| GPT-4o | openrouter/gpt-4o | General purpose |
| Gemini 2.5 Pro | openrouter/gemini-25-pro | Long context |
# 1. Search for information
SEARCH_RESULT=$(infsh app run tavily/search-assistant --input '{
"query": "What are the latest breakthroughs in quantum computing 2024?"
}')
# 2. Generate grounded response
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.\"
}"
# Search multiple sources
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"}')
# Combine and analyze
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.\"
}"
# 1. Extract content from specific URLs
CONTENT=$(infsh app run tavily/extract --input '{
"urls": [
"https://example.com/research-paper",
"https://example.com/industry-report"
]
}')
# 2. Analyze extracted content
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 to verify
CLAIM="AI will replace 50% of jobs by 2030"
# 1. Search for evidence
EVIDENCE=$(infsh app run tavily/search-assistant --input "{
\"query\": \"$CLAIM evidence studies research\"
}")
# 2. Verify claim
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. Initial research
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. Generate comprehensive report
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\"
}"
# Use Exa Answer for direct factual questions
infsh app run exa/answer --input '{
"question": "What is the current market cap of NVIDIA?"
}'
# Bad: Too vague
"AI news"
# Good: Specific and contextual
"latest developments in large language models January 2024"
# Summarize long search results before sending to LLM
SEARCH=$(infsh app run tavily/search-assistant --input '{"query": "..."}')
# If too long, summarize first
SUMMARY=$(infsh app run openrouter/claude-haiku-45 --input "{
\"prompt\": \"Summarize these search results in bullet points: $SEARCH\"
}")
# Then use summary for analysis
infsh app run openrouter/claude-sonnet-45 --input "{
\"prompt\": \"Based on this research summary, provide insights: $SUMMARY\"
}"
Always ask the LLM to cite sources:
infsh app run openrouter/claude-sonnet-45 --input '{
"prompt": "... Always cite sources in [Source Name](URL) format."
}'
# First pass: broad search
INITIAL=$(infsh app run tavily/search-assistant --input '{"query": "topic overview"}')
# Second pass: dive deeper based on findings
DEEP=$(infsh 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=$(infsh app run tavily/search-assistant --input "{\"query\": \"$query\"}")
# Analyze
infsh 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
Browse all apps: infsh app list
Weekly Installs
7.2K
Repository
GitHub Stars
202
First Seen
14 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code5.8K
gemini-cli5.2K
codex5.2K
opencode5.2K
amp5.2K
kimi-cli5.2K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装