@vipinsights/gemini-web-search-grounding
Minimal web_search for pi using Gemini's Grounding with Google Search. Gemini models only; no URL fetching.
Package details
Install @vipinsights/gemini-web-search-grounding from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@vipinsights/gemini-web-search-grounding- Package
@vipinsights/gemini-web-search-grounding- Version
1.2.0- Published
- Nov 20, 2026
- Downloads
- 675/mo · 147/wk
- Author
- michael.couillard
- License
- MIT
- Types
- extension
- Size
- 9.2 KB
- Dependencies
- 0 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
gemini-web-search-grounding
Minimal web_search tool for pi using Gemini's Grounding with Google Search. Derived from ttttmr/pi-web-search (MIT).
https://www.npmjs.com/package/@vipinsights/gemini-web-search-grounding
Scope
- One tool:
web_search(query). Returns a grounded answer plus source links. - Gemini only: runs on pi's current model, and only when it uses the
google-generative-aiAPI. Any other model returns an error. - Auth: the env var pi uses for Gemini (
GEMINI_API_KEY). No/logincredentials, no config files. - No
url_context, no URL parameters, no URL fetching, no other vendors.
How it works
The search is Gemini's own built-in Grounding with Google Search tool, not a separate search API.
- One
generateContentcall to pi's current Gemini model, withtools: [{google_search: {}}]as the only tool. - The request holds just the query string: no system prompt, chat history, or files.
- Gemini runs the Google searches server-side and answers from the results.
- Sources come from the response's
groundingMetadata(webSearchQueries,groundingChunks).
Configuration
Search calls reuse pi's current model, but with their own thinking level and timeout.
| Env var | Default | Purpose |
|---|---|---|
WEB_SEARCH_THINKING_LEVEL |
low |
minimal/low/medium/high; set to empty for Gemini 2.5 models, which reject it |
WEB_SEARCH_TIMEOUT_MS |
15000 |
Search timeout; no retries |
Install
Requires Pi 1.5.0 or newer. Do not load it alongside pi-web-search; both register web_search.
pi install npm:@vipinsights/gemini-web-search-grounding
Replace the previous web search tool
List installed packages and find the old one (e.g.
pi-web-search):pi listRemove it:
pi remove npm:pi-web-searchInstall this one:
pi install npm:@vipinsights/gemini-web-search-groundingSet
GEMINI_API_KEY, restart Pi, and select a Gemini model.If
web_searchis still registered twice, checkpackagesandextensionsin~/.pi/agent/settings.json(and the project's.pi/settings.json) for leftoverpi-web-searchentries and delete them.
Publish to npm
- Log in (once):
npm login - Confirm
nameandversioninpackage.json; the name must be unused on npm. - Run checks:
npm test && npm run typecheck - Preview the tarball:
npm pack --dry-run(onlysrcandREADME.mdshould ship) - Publish:
npm publish --access public - Verify:
pi install npm:@vipinsights/gemini-web-search-grounding - For later releases:
npm version patch|minor|major, thennpm publish --access public
The pi-package keyword in package.json makes it discoverable as a Pi package.
Test
npm test
npm run typecheck