← Back to Skills Marketplace
Double search(Tavily + Kimi)
by
wjs028-coder
· GitHub ↗
· v1.0.0
· MIT-0
110
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install double-search
Description
双搜索功能 (Tavily + Kimi) - 支持并行搜索和结果合并
README (SKILL.md)
Double Search Skill
双重搜索功能,同时使用Tavily和Kimi搜索引擎,提供更全面、准确的搜索结果。
功能特性
- ✅ 双引擎并行搜索:同时使用Tavily和Kimi
- ✅ 智能结果合并:自动合并、去重和排序
- ✅ 异步高效:基于asyncio的高性能实现
- ✅ 错误容错:单个搜索失败不影响整体
- ✅ 灵活配置:支持环境变量和配置文件
快速开始
1. 安装Python依赖
pip install aiohttp python-dotenv
2. 设置环境变量
在.env文件中添加:
TAVILY_API_KEY=tvly-xxxxxxxxxxxx
KIMI_API_KEY=your_kimi_api_key_here
或者设置系统环境变量:
export TAVILY_API_KEY="tvly-xxxxxxxxxxxx"
export KIMI_API_KEY="your_kimi_api_key_here"
3. 基本使用
from double_search import DoubleSearcher
async def search_example():
searcher = DoubleSearcher()
# 执行搜索
results = await searcher.search("人工智能发展趋势")
# 打印结果
print(f"搜索结果: {results}")
# 查看各个搜索引擎的结果
print(f"Tavily结果: {results.get('tavily', [])}")
print(f"Kimi结果: {results.get('kimi', [])}")
return results
API文档
DoubleSearcher类
初始化
searcher = DoubleSearcher()
search方法
async def search(
query: str,
merge_results: bool = True,
limit_per_source: int = 5
) -> Dict[str, Any]
参数:
query(str): 搜索查询字符串merge_results(bool): 是否合并结果(默认True)limit_per_source(int): 每个搜索源返回的结果数量(默认5)
返回:
{
"query": "搜索内容",
"merged_results": [
{
"title": "结果标题",
"url": "https://example.com",
"snippet": "结果摘要",
"source": "tavily"
}
],
"source_breakdown": {
"tavily": [...],
"kimi": [...]
}
}
高级用法
1. 不合并结果
results = await searcher.search(
query="技术趋势",
merge_results=False
)
# 结果按搜索源分开
print(results['tavily'])
print(results['kimi'])
2. 限制每个源的结果数量
results = await searcher.search(
query="市场分析",
limit_per_source=3
)
3. 自定义结果处理
results = await searcher.search("投资策略")
# 只获取Tavily的结果
tavily_results = results.get('tavily', [])
# 只获取Kimi的结果
kimi_results = results.get('kimi', [])
# 获取合并的结果
all_results = results.get('merged_results', [])
配置管理
环境变量配置
# 必需
TAVILY_API_KEY=tvly-xxxxxxxxxxxx
# 可选(不设置则只使用Tavily)
KIMI_API_KEY=your_kimi_api_key_here
配置文件支持
支持.env文件:
# .env文件示例
TAVILY_API_KEY=tvly-xxxxxxxxxxxx
KIMI_API_KEY=your_kimi_api_key_here
错误处理
async def safe_search(query: str):
searcher = DoubleSearcher()
try:
results = await searcher.search(query)
if not results['merged_results']:
return {"error": "搜索无结果", "query": query}
return results
except Exception as e:
return {"error": f"搜索失败: {str(e)}", "query": query}
性能优化
并行搜索效率
- Tavily和Kimi同时搜索,总时间接近较慢的搜索引擎
- 适合需要全面结果的场景
结果缓存
from functools import lru_cache
class CachedSearcher(DoubleSearcher):
@lru_cache(maxsize=100)
async def search(self, query: str, ...):
return await super().search(query, ...)
使用场景
1. 内容创作
async def research_topic(topic):
searcher = DoubleSearcher()
results = await searcher.search(topic)
# 分析多个来源
insights = analyze_results(results)
return insights
2. 财经分析
async def financial_analysis(ticker):
searcher = DoubleSearcher()
query = f"{ticker} 财经分析"
results = await searcher.search(query)
# 过滤财经相关结果
financial_news = filter_financial_content(results)
return financial_news
3. 代码搜索
async def code_search(problem):
searcher = DoubleSearcher()
results = await searcher.search(problem)
# 优先获取技术相关结果
technical_results = filter_tech_content(results)
return technical_results
故障排除
问题1:搜索无结果
# 检查API keys
echo $TAVILY_API_KEY
echo $KIMI_API_KEY
# 验证API keys有效性
问题2:Python模块未找到
# 确保在正确的工作目录
cd ~/.openclaw/skills/double-search
# 检查Python路径
which python3
问题3:依赖缺失
# 安装依赖
pip install aiohttp python-dotenv
版本信息
- 版本: 1.0.0
- Python版本: 3.8+
- 更新日期: 2026-03-27
- 兼容性: OpenClaw skill系统
Usage Guidance
This skill appears to do what it claims: run parallel searches against Tavily and optionally Kimi. Before installing, verify you trust the external endpoints (https://api.tavily.com and https://api.moonshot.cn) because the skill will send your API keys and search queries to them. Note the registry metadata erroneously marks KIMI_API_KEY as required even though Kimi is optional — you can run with only TAVILY_API_KEY. Run install.sh in an environment where pip installs are acceptable (it will install aiohttp and python-dotenv), and avoid supplying high-privilege or unrelated credentials. If you have security concerns, review the included __init__.py (network calls are explicit) or run the code in an isolated environment and use API keys with limited scope. If you want the metadata corrected, request that KIMI_API_KEY be marked optional in registry fields.
Capability Analysis
Type: OpenClaw Skill
Name: double-search
Version: 1.0.0
The 'double-search' skill is a legitimate implementation of a search aggregator using the Tavily and Kimi (Moonshot AI) APIs. The Python code in `__init__.py` uses standard asynchronous requests via `aiohttp` to official endpoints (api.tavily.com and api.moonshot.cn), and the `install.sh` script performs routine environment checks and dependency installation without any suspicious behavior or obfuscation.
Capability Assessment
Purpose & Capability
Name/description (double-search using Tavily and Kimi) match the code, which calls Tavily and Kimi APIs. One inconsistency: registry-level required env vars list both TAVILY_API_KEY and KIMI_API_KEY as required, while the SKILL.md/README and runtime code treat KIMI_API_KEY as optional (only loads Kimi if KIMI_API_KEY is set). This is likely a metadata inaccuracy rather than malicious behavior.
Instruction Scope
SKILL.md instructions are limited to installing Python deps, setting environment variables or a .env file, and using the provided Python API. The runtime code performs network requests only to the declared search endpoints (https://api.tavily.com/search and https://api.moonshot.cn/v1/chat/completions) and does not attempt to read unrelated system files or secrets.
Install Mechanism
No risky remote downloads. The included install.sh uses pip to install aiohttp and python-dotenv and writes a local .env template; this is standard. There is no download-from-arbitrary-URL or extracted archive behavior.
Credentials
Requests TAVILY_API_KEY (primary) and KIMI_API_KEY. These are proportionate to the skill's function. Minor inconsistency: registry metadata marks both env vars as required, but code & docs treat KIMI_API_KEY as optional — you don't need to provide KIMI if you only want Tavily. No other unrelated credentials are requested.
Persistence & Privilege
Skill does not request always:true nor attempt to modify other skills or system-wide configs. It writes a .env file into its own directory via install.sh (expected), and runs normal Python test code. Autonomous invocation is allowed by default but not combined with other red flags.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install double-search - After installation, invoke the skill by name or use
/double-search - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of double-search: parallel search and result merging via Tavily + Kimi.
- Supports dual-engine parallel search (Tavily and Kimi) for broader, more accurate results
- Intelligent result merging: deduplication and sorting
- Asynchronous, high-performance implementation
- Fault tolerance: single search failure doesn’t affect overall results
- Flexible configuration via environment variables or .env file
- Simple Python API with advanced usage and troubleshooting guides
Metadata
Frequently Asked Questions
What is Double search(Tavily + Kimi)?
双搜索功能 (Tavily + Kimi) - 支持并行搜索和结果合并. It is an AI Agent Skill for Claude Code / OpenClaw, with 110 downloads so far.
How do I install Double search(Tavily + Kimi)?
Run "/install double-search" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Double search(Tavily + Kimi) free?
Yes, Double search(Tavily + Kimi) is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Double search(Tavily + Kimi) support?
Double search(Tavily + Kimi) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Double search(Tavily + Kimi)?
It is built and maintained by wjs028-coder (@wjs028-coder); the current version is v1.0.0.
More Skills