@cltec/pi-ollama-web-search

A pi extension package that exposes Ollama Web Search as a custom tool.

Package details

extension

Install @cltec/pi-ollama-web-search from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@cltec/pi-ollama-web-search
Package
@cltec/pi-ollama-web-search
Version
0.1.0
Published
May 3, 2026
Downloads
not available
Author
cirius1792
License
MIT
Types
extension
Size
12.7 KB
Dependencies
0 dependencies · 2 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

@cltec/pi-ollama-web-search

A reusable pi package that exposes Ollama Web Search as a custom pi tool.

What it provides

This package registers one production tool:

  • ollama_web_search

The tool accepts a search query and returns Ollama web search results with title, URL, and content.

Version 1 intentionally does not include web fetch, query caching, custom secret storage, or search-agent orchestration.

Install

Install from npm:

pi install npm:@cltec/pi-ollama-web-search

Or install directly from GitHub:

pi install git:github.com/Cirius1792/pi-ollama-web-search

Then start or reload pi.

Authentication

Create an Ollama API key at:

https://ollama.com/settings/keys

Export it before starting pi:

export OLLAMA_API_KEY="your_api_key_here"
pi

For persistent setup, add the export to your shell profile such as ~/.profile, ~/.bashrc, or ~/.zshrc.

Usage

Ask pi a question that benefits from web search. The model can call ollama_web_search when it needs current or external information.

Example prompt:

Search the web for recent Ollama Web Search API documentation and summarize what changed.

Dev mode

A debug slash command is available only when dev mode is enabled.

Enable it before starting pi:

export PI_OLLAMA_SEARCH_DEV=1
pi

Then run:

/ollama-search what is ollama?

The debug command is intended for local testing and troubleshooting. It is not part of the normal user workflow.

Changing PI_OLLAMA_SEARCH_DEV requires restarting pi or reloading extensions.

Troubleshooting

OLLAMA_API_KEY is not set

Set the API key before starting pi:

export OLLAMA_API_KEY="your_api_key_here"

If you added it to ~/.profile, reload your shell or source the file before starting pi:

source ~/.profile
pi

HTTP 401 or 403

The API key is present but Ollama rejected it. Create a new key at https://ollama.com/settings/keys and restart pi with the new value.

Network errors

Check that your network can reach:

https://ollama.com/api/web_search

Development

Install dependencies:

npm install

Run checks:

npm run typecheck
npm test

Release instructions are in docs/release.md.

The test suite uses unit tests and a local mock HTTP server. CI does not call the live Ollama API.

Manual live verification is optional:

source ~/.profile
export PI_OLLAMA_SEARCH_DEV=1
pi -e ./src/index.ts

Then run:

/ollama-search what is ollama?