This skill utilizes the Tavily MCP server, providing clean, real-time web search results optimized for LLMs and RAG pipelines.
Execution Environment
| Path Type | Path | Base Directory |
|---|---|---|
| Skill Directory | ~/.pi/agent/skills/tavily-search-free/ |
Fixed Location |
| Main Script | ~/.pi/agent/skills/tavily-search-free/executor.py |
Skill Directory |
| Usage | pi Automatic invocation or manual execution |
No manual execution required |
API Key Configuration
Supports multiple Key rotation to improve request concurrency.
Configuration Method: In the .env file, separate multiple Keys with commas:
TAVILY_API_KEY=key1,key2,key3
View Key Status:
uv run executor.py --key-status
Available Tools
| Tool | Description |
|---|---|
tavily_search |
Web search (news, facts, data) |
tavily_extract |
Extract content from URL (markdown/text) |
tavily_crawl |
Crawl website (configurable depth) |
tavily_map |
Map website structure |
tavily_research |
Comprehensive research (multiple sources) |
Usage
Method 1: Automatic invocation via pi (recommended)
pi Will automatically invoke this skill for web search, no need to manually execute commands.
Method 2: Manual execution
# 从技能目录执行
cd ~/.pi/agent/skills/tavily-search-free
# 列出所有工具
uv run executor.py --list
# 搜索
uv run executor.py --call '{"tool": "tavily_search", "arguments": {"query": "搜索内容"}}'
# 提取 URL 内容
uv run executor.py --call '{"tool": "tavily_extract", "arguments": {"urls": ["https://example.com"]}}'
# 爬取网站
uv run executor.py --call '{"tool": "tavily_crawl", "arguments": {"url": "https://example.com", "max_depth": 2}}'
# 映射网站
uv run executor.py --call '{"tool": "tavily_map", "arguments": {"url": "https://example.com"}}'
# 综合研究
uv run executor.py --call '{"tool": "tavily_research", "arguments": {"input": "研究主题"}}'
Parameter Description
tavily_search
| Parameter | Required | Default Value | Description |
|---|---|---|---|
query |
Yes | - | Search query content |
max_results |
No | 5 | Maximum number of returned results |
search_depth |
No | basic | Search depth:basic/advanced/fast/ultra-fast |
time_range |
No | null | Time range:day/week/month/year |
tavily_extract
| Parameter | Required | Default Value | Description |
|---|---|---|---|
urls |
Yes | - | URL list |
extract_depth |
No | basic | Extraction depth:basic/advanced |
format |
No | markdown | Output format:markdown/text |
Output Format
The script outputs in JSON format, containing search results or extracted content.
Monitoring and Statistics
# 查看状态
uv run executor.py --status
# 查看统计
uv run executor.py --stats
# 查看日志
uv run executor.py --logs 100
Path Description
- Script Location:
~/.pi/agent/skills/tavily-search-free/executor.py - Configuration Location:
~/.pi/agent/skills/tavily-search-free/mcp-config.json - Environment Variables:
~/.pi/agent/skills/tavily-search-free/.env - Dependency Installation: Use
uv syncfor automatic management
Based on the Tavily MCP server, supports 5 tools, progressive loading saves context