Important
Development of this extension has been moved to jarcelao/pi-extensions
Web search, content fetching, and code context for pi via the Exa API.
Install as a pi package:
pi install npm:@jarcelao/pi-exa-apiNote
This extension is tested up to pi-coding-agent v0.78.0
You can configure your Exa API key using either method below. File-based auth takes priority over the environment variable.
Create ~/.pi/agent/exa-auth.json:
{
"exaApiKey": "your-api-key-here"
}Set your Exa API key as an environment variable before starting pi:
export EXA_API_KEY="your-api-key-here"
piOr add to your shell profile (~/.bashrc, ~/.zshrc, etc.) for persistence.
Run the /exa-status command in pi to verify your API key is configured and see which source it was loaded from:
/exa-status
The agent can use exa_search to find information on the web:
Search for recent developments in quantum computing
Parameters:
query(required) - Natural language search querycontentType(optional) - Type of content to retrieve:highlights(default) - Key excerpts from each resulttext- Full text content (may be truncated)summary- AI-generated summarynone- Metadata only (title, URL, date, author)
numResults(optional) - Number of results (1-100, default: 10)
The agent can use exa_fetch to extract content from a specific URL:
Fetch the content from https://example.com/article
Parameters:
url(required) - URL to fetchcontentType(optional) - Type of content:text(default) - Full page texthighlights- Key excerptssummary- AI-generated summary
maxCharacters(optional) - Maximum characters to return (1000-100000)
Important
On July 1, 2026, I aim to retire this tool from the extension.
From experience, most models opt to use the search and fetch tools instead, which still gives satisfactory results.
You can already try this out in the feat/remove-context branch. For any feedback, feel free to raise an issue.
The agent can use exa_code_context to find code snippets and examples from open source libraries and repositories:
Find examples of React hooks for state management
It's ideal for understanding how libraries, frameworks, or programming concepts are implemented in practice.
Parameters:
query(required) - Search query for code snippets and examples (1-2000 characters)tokensNum(optional) - Token limit for the response:"dynamic"(default) - Automatically determine optimal response length50-100000- Specific number of tokens (5000 is a good default, use 10000 when more context is needed)
# Install dependencies
npm install
# Run tests
npm test
# Run linting
npm run lint
# Format code
npm run formatMIT