This extension adds web searching capabilities to the pi coding agent by integrating with an Ollama-based web search API.
The ollama-web-search extension allows the AI agent to perform external web queries to retrieve up-to-date information, documentation, or general knowledge that may not be present in its training data.
- Customizable Search: Ability to configure the API endpoint and API key via settings.
- Result Control: Option to specify the maximum number of results returned.
- Integrated Tooling: Registers a
web searchtool that can be called by the agent during a session.
The extension reads its configuration from .pi/settings.json in the project root.
{
"ollamaWebSearchSettings": {
"enabled": boolean,
"url": "string",
"apiKey": "string (optional)",
"defaultMaxResults": number
}
}enabled: Set totrueto enable the extension.url: The endpoint of your Ollama web search API.apiKey: (Optional) Your API key for authentication.defaultMaxResults: (Optional) The default number of search results to return (defaults to 3).
- Description: Uses ollama's web search api to search the web for information.
- Parameters:
query(string): The search query to execute.max_results(number, optional): The maximum number of results to return. Defaults to 3.
- Built using the
@mariozechner/pi-coding-agentAPI. - Implements a dynamic tool registration based on the
enabledflag in the configuration. - Handles API communication via
fetchwith support for Bearer token authentication.
- Node.js
- npm or yarn
- TypeScript
To build the extension, run:
npm run buildThis project follows the Git Karma style for commit messages. Commits should be prefixed with a type and an optional scope:
type(scope): description
Common types used in this project:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, etc)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or other non-source files