@tavily/pi-extension
v0.1.2
Published
Official Tavily extension for the Pi coding agent
Readme
pi-tavily
Official Tavily extension for the Pi coding agent.
Published package name:
@tavily/pi-extensionInstall in Pi with:
pi install npm:@tavily/pi-extensionWhat it adds
This extension adds two Tavily-powered tools to Pi:
web_search— search the web with Tavily Searchweb_fetch— extract content from one or more URLs with Tavily Extract
Authentication
v1 uses an API key via environment variable:
export TAVILY_API_KEY=tvly-...OAuth / Pi-native login flow is not included yet.
Install
From npm
pi install npm:@tavily/pi-extensionLocal development
From this repo:
npm install
pi -e ./index.tsIsolated local testing
To test only this extension without other skills/extensions interfering:
pi --no-session --no-skills --no-prompt-templates --no-context-files --no-extensions -e ./index.tsExample prompts
Search
Search the web for the latest Tavily announcements.Search the web for recent Tavily news from the last month. Use news topic, advanced depth, include an answer, and include favicons.Search the web for the exact phrase "Tavily Search" and exclude reddit.com.Fetch / extract
Fetch https://docs.tavily.com and summarize it.Fetch these pages and compare them:
https://docs.tavily.com/documentation/api-reference/endpoint/search
https://docs.tavily.com/documentation/api-reference/endpoint/extractFetch these URLs and extract only content relevant to API credits and pricing:
https://docs.tavily.com/documentation/api-reference/endpoint/search
https://docs.tavily.com/documentation/api-reference/endpoint/extractTool behavior
web_search
Backed by Tavily Search.
Supports the full v1 parameter surface defined in docs/tool-contract.md, including:
search_depthtopictime_rangestart_date/end_dateinclude_domains/exclude_domainsinclude_answerinclude_raw_contentinclude_imagesinclude_faviconauto_parametersexact_matchinclude_usage
web_fetch
Backed by Tavily Extract.
Supports the full v1 parameter surface defined in docs/tool-contract.md, including:
urlsquerychunks_per_sourceextract_depthformatinclude_imagesinclude_favicontimeoutinclude_usage
Validation rules
The extension currently enforces a few important contract rules:
web_search.chunks_per_sourcerequiressearch_depth: "advanced"web_search.countryis only valid withtopic: "general"web_fetch.chunks_per_sourcerequiresqueryweb_fetchallows a maximum of 20 URLs
Notes
- Public Pi tool parameters use Tavily-style
snake_case. - For deep page extraction, prefer
web_searchto discover URLs first, thenweb_fetchto extract selected pages. - Large outputs may be truncated for Pi context safety, with the full output saved to a temp file.
Releasing
See RELEASING.md for the local test, packaging, and npm publish workflow.
Contract
The public tool contract for v1 lives here:
docs/tool-contract.md
Repository name vs package name
This repository is named pi-tavily, while the published npm package is:
@tavily/pi-extension