Skip to main content

npm

@tavily/pi-extension

Get API Key

Sign up at tavily.com

Introduction

Pi is a minimal terminal coding agent and harness that you can extend with TypeScript extensions, skills, prompt templates, and themes. Tavily integrates with Pi through the official npm package:
@tavily/pi-extension
Install it in Pi with:
pi install npm:@tavily/pi-extension

What this adds to Pi

The Tavily Pi extension adds two Tavily-powered tools:
  • web_search — search the web with Tavily Search
  • web_fetch — extract content from one or more URLs with Tavily Extract
These are Pi extension tools, not Pi built-in tools.

Requirements

  • Pi installed locally
  • A Tavily API key

Authentication

Version 1 uses an API key via environment variable:
export TAVILY_API_KEY=tvly-...
OAuth or Pi-native login for Tavily is not included yet.

Install

If Pi is not installed yet, install it first:
npm install -g @mariozechner/pi-coding-agent
Export your Tavily API key in the same shell where you will launch Pi:
export TAVILY_API_KEY=tvly-...
Install the published npm package into Pi:
pi install npm:@tavily/pi-extension
After installation, make sure the extension resource is enabled:
pi config
If the package is installed but web_search or web_fetch do not appear, this is the first thing to check.
Start a fresh Pi session in a clean directory:
mkdir -p /tmp/pi-tavily-test
cd /tmp/pi-tavily-test
export TAVILY_API_KEY=tvly-...
pi --no-session
Then ask Pi:
What tools do you have available right now? Reply with only the tool names.
You should see web_search and web_fetch in the available tools.

Example prompts

Use the web_search tool to 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.

Fetch

Use the web_fetch tool to 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/extract

Troubleshooting

If Pi says it cannot access the web or Tavily tools do not appear, check these in order:
  1. Is the package installed?
    pi list
    
  2. Is the extension resource enabled?
    pi config
    
  3. Is the API key set in the same shell where Pi is launched?
    echo $TAVILY_API_KEY
    
  4. Are you starting a fresh session?
    pi --no-session
    

Learn more