local-rag-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Local RAG Search Skill

本地RAG搜索技能

This skill enables you to effectively use the mcp-local-rag MCP server for intelligent web searches with semantic ranking. The server performs RAG-like similarity scoring to prioritize the most relevant results without requiring any external APIs.
本技能可让你借助mcp-local-rag MCP服务器,通过语义排序实现智能网页搜索。该服务器无需调用任何外部API,即可执行类RAG的相似度评分,优先返回最相关的结果。

Available Tools

可用工具

1.
rag_search_ddgs
- DuckDuckGo Search

1.
rag_search_ddgs
- DuckDuckGo搜索

Use this for privacy-focused, general web searches.
When to use:
  • User prefers privacy-focused searches
  • General information lookup
  • Default choice for most queries
Parameters:
  • query
    : Natural language search query
  • num_results
    : Initial results to fetch (default: 10)
  • top_k
    : Most relevant results to return (default: 5)
  • include_urls
    : Include source URLs (default: true)
适用于注重隐私的通用网页搜索。
适用场景:
  • 用户偏好注重隐私的搜索方式
  • 通用信息查询
  • 大多数查询的默认选择
参数:
  • query
    : 自然语言搜索查询词
  • num_results
    : 初始获取的结果数量(默认值:10)
  • top_k
    : 返回的最相关结果数量(默认值:5)
  • include_urls
    : 是否包含来源URL(默认值:true)

2.
rag_search_google
- Google Search

2.
rag_search_google
- Google搜索

Use this for comprehensive, technical, or detailed searches.
When to use:
  • Technical or scientific queries
  • Need comprehensive coverage
  • Searching for specific documentation
适用于全面、技术类或精细化搜索。
适用场景:
  • 技术或科学类查询
  • 需要全面覆盖信息
  • 搜索特定文档

3.
deep_research
- Multi-Engine Deep Research

3.
deep_research
- 多引擎深度研究

Use this for comprehensive research across multiple search engines.
When to use:
  • Researching complex topics requiring broad coverage
  • Need diverse perspectives from multiple sources
  • Gathering comprehensive information on a subject
Available backends:
  • duckduckgo
    : Privacy-focused general search
  • google
    : Comprehensive technical results
  • bing
    : Microsoft's search engine
  • brave
    : Privacy-first search
  • wikipedia
    : Encyclopedia/factual content
  • yahoo
    ,
    yandex
    ,
    mojeek
    ,
    grokipedia
    : Alternative engines
Default:
["duckduckgo", "google"]
适用于跨多个搜索引擎开展全面研究。
适用场景:
  • 研究需要广泛覆盖信息的复杂主题
  • 需要从多来源获取多样化视角
  • 收集某一主题的全面信息
可用后端引擎:
  • duckduckgo
    : 注重隐私的通用搜索
  • google
    : 全面的技术类结果
  • bing
    : 微软搜索引擎
  • brave
    : 隐私优先的搜索引擎
  • wikipedia
    : 百科/事实类内容
  • yahoo
    ,
    yandex
    ,
    mojeek
    ,
    grokipedia
    : 替代引擎
默认值:
["duckduckgo", "google"]

4.
deep_research_google
- Google-Only Deep Research

4.
deep_research_google
- 仅Google深度研究

Shortcut for deep research using only Google.
仅使用Google进行深度研究的快捷方式。

5.
deep_research_ddgs
- DuckDuckGo-Only Deep Research

5.
deep_research_ddgs
- 仅DuckDuckGo深度研究

Shortcut for deep research using only DuckDuckGo.
仅使用DuckDuckGo进行深度研究的快捷方式。

Best Practices

最佳实践

Query Formulation

查询词构建

  1. Use natural language: Write queries as questions or descriptive phrases
    • Good: "latest developments in quantum computing"
    • Good: "how to implement binary search in Python"
    • Avoid: Single keywords like "quantum" or "Python"
  2. Be specific: Include context and details
    • Good: "React hooks best practices for 2024"
    • Better: "React useEffect cleanup function best practices"
  1. 使用自然语言: 将查询词写成问题或描述性短语
    • 示例:"量子计算的最新发展"
    • 示例:"如何用Python实现二分查找"
    • 避免:使用单个关键词,如“量子”或“Python”
  2. 明确具体: 包含上下文和细节
    • 示例:"2024年React Hooks最佳实践"
    • 更优:"React useEffect清理函数最佳实践"

Tool Selection Strategy

工具选择策略

  1. Single Topic, Quick Answer → Use
    rag_search_ddgs
    or
    rag_search_google
    rag_search_ddgs(
        query="What is the capital of France?",
        top_k=3
    )
  2. Technical/Scientific Query → Use
    rag_search_google
    rag_search_google(
        query="Docker multi-stage build optimization techniques",
        num_results=15,
        top_k=7
    )
  3. Comprehensive Research → Use
    deep_research
    with multiple search terms
    deep_research(
        search_terms=[
            "machine learning fundamentals",
            "neural networks architecture",
            "deep learning best practices 2024"
        ],
        backends=["google", "duckduckgo"],
        top_k_per_term=5
    )
  4. Factual/Encyclopedia Content → Use
    deep_research
    with Wikipedia
    deep_research(
        search_terms=["World War II timeline", "WWII key battles"],
        backends=["wikipedia"],
        num_results_per_term=5
    )
  1. 单一主题、快速解答 → 使用
    rag_search_ddgs
    rag_search_google
    rag_search_ddgs(
        query="法国的首都是哪里?",
        top_k=3
    )
  2. 技术/科学类查询 → 使用
    rag_search_google
    rag_search_google(
        query="Docker多阶段构建优化技巧",
        num_results=15,
        top_k=7
    )
  3. 全面研究 → 使用
    deep_research
    并搭配多个搜索词
    deep_research(
        search_terms=[
            "机器学习基础",
            "神经网络架构",
            "2024年深度学习最佳实践"
        ],
        backends=["google", "duckduckgo"],
        top_k_per_term=5
    )
  4. 事实/百科类内容 → 使用搭配Wikipedia的
    deep_research
    deep_research(
        search_terms=["第二次世界大战时间线", "二战关键战役"],
        backends=["wikipedia"],
        num_results_per_term=5
    )

Parameter Tuning

参数调优

For quick answers:
  • num_results=5-10
    ,
    top_k=3-5
For comprehensive research:
  • num_results=15-20
    ,
    top_k=7-10
For deep research:
  • num_results_per_term=10-15
    ,
    top_k_per_term=3-5
  • Use 2-5 related search terms
  • Use 1-3 backends (more = more comprehensive but slower)
快速解答场景:
  • num_results=5-10
    ,
    top_k=3-5
全面研究场景:
  • num_results=15-20
    ,
    top_k=7-10
深度研究场景:
  • num_results_per_term=10-15
    ,
    top_k_per_term=3-5
  • 使用2-5个相关搜索词
  • 使用1-3个后端引擎(数量越多覆盖越全面,但速度越慢)

Workflow Examples

工作流示例

Example 1: Current Events

示例1:时事查询

Task: "What happened at the UN climate summit last week?"

1. Use rag_search_google for recent news coverage
2. Set top_k=7 for comprehensive view
3. Present findings with source URLs
任务: "上周联合国气候峰会发生了什么?"

1. 使用rag_search_google获取近期新闻报道
2. 设置top_k=7以获取全面视角
3. 附带来源URL呈现研究结果

Example 2: Technical Deep Dive

示例2:技术深度探究

Task: "How do I optimize PostgreSQL queries?"

1. Use deep_research with multiple specific terms:
   - "PostgreSQL query optimization techniques"
   - "PostgreSQL index best practices"
   - "PostgreSQL EXPLAIN ANALYZE tutorial"
2. Use backends=["google", "stackoverflow"] if available
3. Synthesize findings into actionable guide
任务: "如何优化PostgreSQL查询?"

1. 使用deep_research并搭配多个具体搜索词:
   - "PostgreSQL查询优化技巧"
   - "PostgreSQL索引最佳实践"
   - "PostgreSQL EXPLAIN ANALYZE教程"
2. 若支持,使用backends=["google", "stackoverflow"]
3. 将研究结果整合为可操作的指南

Example 3: Multi-Perspective Research

示例3:多视角研究

Task: "Research the impact of remote work on productivity"

1. Use deep_research with diverse search terms:
   - "remote work productivity statistics 2024"
   - "hybrid work model effectiveness studies"
   - "work from home challenges research"
2. Use backends=["google", "duckduckgo"] for broad coverage
3. Synthesize different perspectives and studies
任务: "研究远程办公对生产力的影响"

1. 使用deep_research并搭配多样化搜索词:
   - "2024年远程办公生产力统计数据"
   - "混合办公模式有效性研究"
   - "居家办公挑战研究"
2. 使用backends=["google", "duckduckgo"]以获取广泛覆盖
3. 整合不同视角和研究结论

Guidelines

指南

  1. Always cite sources: When
    include_urls=True
    , reference the source URLs in your response
  2. Verify recency: Check if the content appears current and relevant
  3. Cross-reference: For important facts, use multiple search terms or engines
  4. Respect privacy: Use DuckDuckGo for general queries unless specific needs require Google
  5. Batch related queries: When researching a topic, create multiple related search terms for deep_research
  6. Semantic relevance: Trust the RAG scoring - top results are semantically closest to the query
  7. Explain your choice: Briefly mention which tool you're using and why
  1. 始终引用来源: 当
    include_urls=True
    时,在回复中引用来源URL
  2. 验证时效性: 检查内容是否最新且相关
  3. 交叉验证: 对于重要事实,使用多个搜索词或引擎
  4. 注重隐私: 除非有特定需求,否则优先使用DuckDuckGo进行通用查询
  5. 批量处理相关查询: 研究某一主题时,创建多个相关搜索词用于deep_research
  6. 语义相关性: 信任RAG评分——排名靠前的结果与查询词的语义最接近
  7. 说明选择理由: 简要提及你使用的工具及原因

Error Handling

错误处理

If a search returns insufficient results:
  1. Try rephrasing the query with different keywords
  2. Switch to a different backend
  3. Increase
    num_results
    parameter
  4. Use
    deep_research
    with multiple related search terms
若搜索返回结果不足:
  1. 尝试用不同关键词改写查询词
  2. 切换至其他后端引擎
  3. 增大
    num_results
    参数值
  4. 使用搭配多个相关搜索词的
    deep_research

Privacy Considerations

隐私注意事项

  • DuckDuckGo: Privacy-focused, doesn't track users
  • Google: Most comprehensive but tracks searches
  • Recommend DuckDuckGo as default unless user specifically needs Google's coverage
  • DuckDuckGo: 注重隐私,不会追踪用户
  • Google: 覆盖最全面,但会追踪搜索记录
  • 推荐优先使用DuckDuckGo,除非用户明确需要Google的覆盖范围

Performance Notes

性能说明

  • First search may be slower (model loading)
  • Subsequent searches are faster (cached models)
  • More backends = more comprehensive but slower
  • Adjust
    num_results
    and
    top_k
    based on use case
  • 首次搜索可能较慢(模型加载中)
  • 后续搜索速度更快(模型已缓存)
  • 后端引擎越多,覆盖越全面,但速度越慢
  • 根据使用场景调整
    num_results
    top_k
    参数