@jarcelao/pi-exa-api

Web search and content fetching for pi via the Exa API

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.3.0
Published
Apr 28, 2026
Downloads
270/mo · 143/wk
Author
jarcelao
License
MIT
Types
extension
Size
45.2 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.70.6

Configuration

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:

/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

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