pi-gemini-search

Web search & research tools for the Pi coding agent, backed by the Gemini API with Google Search grounding — keeps raw page noise out of your context.

Packages

Package details

extension

Install pi-gemini-search from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-gemini-search
Package
pi-gemini-search
Version
0.1.1
Published
Jun 27, 2026
Downloads
345/mo · 345/wk
Author
nilskluewer
License
MIT
Types
extension
Size
18.1 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions/gemini-search.ts"
  ]
}

Security note

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

README

pi-gemini-search

npm version License: MIT

Web search & research tools for the Pi coding agent, backed by the Gemini API with Google Search grounding. The agent can call them autonomously to pull fresh information from the web — without dumping raw page contents into your conversation.

The key idea: search context stays inside the tool result. Gemini does the searching and reading, then returns only a synthesized answer plus source URLs, so your main context stays lean. No headless browser, no page-scraping noise.

Tools

Registers two tools the model can call:

  • web_search — quick fact-check / verification. Returns a concise synthesized answer (a few sentences) + source URLs. Use for version numbers, dates, single facts, a quick second opinion. Uses url_context too, so you can hand it URLs to cross-check.
  • web_research — in-depth research on a complex topic. Returns a thorough, structured answer + source URLs. Use for multi-faceted topics, how-tos, architecture opinions, grounded second opinions.

Both tools:

  • Ground answers with Google Search (never answer from memory alone).
  • Can read specific URLs you pass via the Gemini url_context tool — include background, constraints, prior conclusions, docs URLs in the query; more context = better answer.
  • Resolve Gemini's vertexaisearch.cloud.google.com redirect links to their pure destination URLs (via the 302 location header) so only clean links enter your context.

API key

The extension needs a Gemini API key. Resolution order:

  1. GEMINI_API_KEY environment variable
  2. ~/.pi/agent/auth.json with a gemini entry:
    { "gemini": { "key": "..." } }
    

Get a key from Google AI Studio.

Install

pi install npm:pi-gemini-search

Or from GitHub:

pi install git:github.com/nilskluewer/pi-gemini-search
# or pin a version:
pi install git:github.com/nilskluewer/pi-gemini-search@v0.1.0

Try without installing:

pi -e git:github.com/nilskluewer/pi-gemini-search

How it differs from just using curl

You already have bash + curl. This package is for when you don't have a specific URL, or want a synthesized answer rather than a verbatim page dump:

  • Quick fact / no URL / broad researchweb_search / web_research (synthesized, lean, lossy).
  • Specific doc page you need verbatim → fetch the .md with curl (full fidelity). Many Mintlify-hosted docs serve clean Markdown when you append .md to the URL.

License

MIT