@jarcelao/pi-exa-api

Web search and content fetching for pi via the Exa API

Packages

Package details

extension

Install @jarcelao/pi-exa-api from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@jarcelao/pi-exa-api
Package
@jarcelao/pi-exa-api
Version
0.4.3
Published
May 31, 2026
Downloads
551/mo · 182/wk
Author
jarcelao
License
MIT
Types
extension
Size
49.4 KB
Dependencies
1 dependency · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-exa-api

Web search, content fetching, and code context for pi via the Exa API.

Installation

Install as a pi package:

pi install npm:@jarcelao/pi-exa-api

[!NOTE] This extension is tested up to pi-coding-agent v0.78.0

Configuration

You can configure your Exa API key using either method below. File-based auth takes priority over the environment variable.

Option 1 — Auth file (recommended)

Create ~/.pi/agent/exa-auth.json:

{
  "exaApiKey": "your-api-key-here"
}

Option 2 — Environment variable

Set your Exa API key as an environment variable before starting pi:

export EXA_API_KEY="your-api-key-here"
pi

Or add to your shell profile (~/.bashrc, ~/.zshrc, etc.) for persistence.

Check Configuration

Run the /exa-status command in pi to verify your API key is configured and see which source it was loaded from:

/exa-status

Usage

Web Search

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 query
  • contentType (optional) - Type of content to retrieve:
    • highlights (default) - Key excerpts from each result
    • text - Full text content (may be truncated)
    • summary - AI-generated summary
    • none - Metadata only (title, URL, date, author)
  • numResults (optional) - Number of results (1-100, default: 10)

Fetch URL Content

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 fetch
  • contentType (optional) - Type of content:
    • text (default) - Full page text
    • highlights - Key excerpts
    • summary - AI-generated summary
  • maxCharacters (optional) - Maximum characters to return (1000-100000)

Code Context

[!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 length
    • 50-100000 - Specific number of tokens (5000 is a good default, use 10000 when more context is needed)

Development

# Install dependencies
npm install

# Run tests
npm test

# Run linting
npm run lint

# Format code
npm run format

License

MIT