← Catalog

@sdillen/pi-brave-search

pi extension: web search via the Brave LLM Context API

Extension

Install

Install with PiG

pig install npm:@sdillen/pi-brave-search

Install with Pi

pi install npm:@sdillen/pi-brave-search
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./dist/brave-search.js"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.3 (README.md). PiG does not review it.

A pi extension that adds a web search tool backed by the Brave "LLM Context" API. Results are pre-extracted, LLM-optimized snippets (text, tables, code) with source and date, so no scraping is needed.

Install

pi install npm:@sdillen/pi-brave-search

Try it for a single run:

pi -e npm:@sdillen/pi-brave-search

API key

Lookup order:

  1. macOS Keychain (service pi-brave-search)
  2. BRAVE_API_KEY environment variable
  3. ~/.config/brave/api-key

Get a key at https://api-dashboard.search.brave.com. The key never leaves your machine and is never written to the LLM context.

Slash commands:

  • /brave-key status|set|delete: set reads the clipboard.
  • /brave-test: checks the key and the endpoint.

If the key is missing on a call, pi asks whether to store the clipboard contents in the Keychain.

Robustness

Rate limiting (429) and 5xx responses are retried with backoff, up to 3 times. The timeout is 30 s. If a result exceeds the token budget, it is truncated and the full output is written to a temp file, whose path is included in the result.

Full architecture notes and the development setup are in the repository README.

License

MIT