pi-web-search-research-llm-gcp

Vertex AI Gemini grounded web search, research, and direct URL extraction tools for Pi, using Google Cloud Agent Platform credentials.

Packages

Package details

extension

Install pi-web-search-research-llm-gcp from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-web-search-research-llm-gcp
Package
pi-web-search-research-llm-gcp
Version
0.3.0
Published
Sep 23, 2026
Downloads
190/mo · 174/wk
Author
nilskluewer
License
MIT
Types
extension
Size
2.1 MB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "image": "https://raw.githubusercontent.com/nilskluewer/pi-web-search-research-llm-gcp/main/assets/screenshots/web-search-tools.png",
  "extensions": [
    "./extensions/vertex-gemini-search.ts"
  ]
}

Security note

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

README

pi-web-search-research-llm-gcp

Web search & research tools for the Pi coding agent, backed by Vertex AI Gemini with Google Search grounding and Google Cloud Agent Platform credentials.

This uses Google Cloud credentials, not a Gemini API key.

Setup

  1. Install: pi install npm:pi-web-search-research-llm-gcp
  2. Authenticate: gcloud auth login
  3. In Pi: /setup-search → project ID → region → tool → available Gemini model. Saved across sessions; no restart needed. Enable Vertex AI in the project.

Tools

Registers three tools the model can call:

  • web_search — quick fact-check / verification. Returns a concise synthesized answer + source URLs.
  • web_research — in-depth research on complex topics. Returns a structured answer with documentation details, code snippets, and source URLs.
  • web_fetch — reads one public webpage through Gemini url_context and extracts its substantive content into Markdown.

The search and research tools:

  • Ground answers with Google Search.
  • Can read specific URLs passed in the query via Gemini url_context.
  • Use high thinking for the configured Gemini 3.5 Flash-Lite and Gemini 3.7 Flash models.
  • Resolve Gemini vertexaisearch.cloud.google.com redirect links to clean destination URLs.
  • Render source URLs as OSC-8 terminal hyperlinks in the Pi TUI when supported by your terminal.
  • Prefix results with a compact, brutalist high-contrast Vertex AI provenance/cost summary in Pi TUI, including the actual flex pricing or standard pricing tier used for that call.

web_fetch uses URL Context only, without Google Search. It asks Gemini to:

Extract all information from this webpage into Markdown.

The result is model-generated Markdown, not a byte-for-byte copy of the original webpage.

Preview

Available web search, fetch, and research tools

Web search result with sources and cost summary

Web research result with structured analysis and sources

Configuration

Run /setup-search again to change the project, region, or model (web_search, web_research, web_fetch, or all). Settings are saved in Pi's vertex-gemini-search.json and take precedence over VERTEX_PROJECT_ID, VERTEX_REGION, and model environment variables. Without setup, those variables remain supported; the region defaults to eu. Authentication uses VERTEX_ACCESS_TOKEN or gcloud auth print-access-token.

Model environment variables: GEMINI_MODEL_SHORT, GEMINI_MODEL_LONG, GEMINI_MODEL_FETCH (defaults: gemini-3.5-flash-lite, gemini-3.7-flash, gemini-3.1-flash-lite). The setup command lists current Gemini text models and checks access to your choice.

Cost estimate configuration

Each result includes a compact estimated cost summary, for example:

◆ Gemini Search [gemini-3.5-flash-lite, eu, €0.0131/$0.0141, 2 sources, standard pricing]

Defaults:

  • GEMINI_SEARCH_GROUNDING_USD_PER_1000=14
  • USD_TO_EUR=0.93
  • VERTEX_FLEX_TOKEN_DISCOUNT=0.5

The estimate uses response token counts from Vertex AI and approximate list token rates. Gemini 3.7 Flash research calls use the introductory rate of $0.75 per 1M input tokens and $3.75 per 1M output tokens through December 31, 2026. Regional endpoint pricing may differ. URL Context results report token costs, but the estimate does not add a Google Search grounding charge because web_fetch does not use Google Search. Flex is preferred by default via the Vertex AI Flex PayGo headers. If the project or region does not support Flex, the extension falls back to the standard tier and reports standard pricing in that result.

Pricing-tier command

Use the Pi command below to inspect or change the pricing preference for the current session:

/search-pricing
/search-pricing flex
/search-pricing standard

flex is the default and falls back to standard when Flex is unavailable. standard bypasses Flex entirely. The command does not persist across Pi sessions.

License

MIT