An AI-powered QGIS plugin for running WhiteboxTools through natural language using Ollama, Claude, OpenAI, or Gemini as the reasoning engine.
- Natural Language Interface: Describe your analysis in plain English
- Multiple LLM Backends: Ollama (local), Claude, OpenAI, Gemini
- Dynamic Algorithm Discovery: Automatically discovers WhiteboxTools algorithms from QGIS Processing
- Smart Parameter Validation: Validates all parameters against algorithm schemas
- Automatic Output Loading: Results are automatically added to your QGIS project
- Safe Execution: Uses QGIS Processing API, not shell commands
- QGIS 3.28+ installed
- WhiteboxTools Processing Provider installed and enabled in QGIS
- Ollama (for local LLM) or API keys for Claude/OpenAI/Gemini
# Clone the repository
git clone https://github.com/opengeos/qgis-whitebox-agent.git
cd whitebox-agent
# Install to QGIS plugins directory
python install_plugin.pyOr manually copy the whitebox_agent folder to your QGIS plugins directory:
- Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - macOS:
~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ - Windows:
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\
- Restart QGIS
- Go to Plugins → Manage and Install Plugins
- Search for "Whitebox AI Agent"
- Check the box to enable it
- Install Ollama from https://ollama.ai
- Pull a model:
ollama pull llama3.1 - Start Ollama:
ollama serve - In the plugin settings, select "Ollama" as the provider
- Get an API key from https://console.anthropic.com
- In the plugin Settings panel, enter your API key
- Select "Claude" as the provider
- Get an API key from https://platform.openai.com
- In the plugin Settings panel, enter your API key
- Select "OpenAI" as the provider
- Get an API key from https://aistudio.google.com
- In the plugin Settings panel, enter your API key
- Select "Gemini" as the provider
- Load Data: Add raster/vector layers to your QGIS project
- Open Chat Panel: Click the Whitebox AI Agent icon in the toolbar
- Ask Questions: Type natural language requests like:
- "Fill depressions in my DEM"
- "Calculate flow accumulation"
- "Extract stream network with threshold 1000"
- "What algorithms can I use for watershed analysis?"
User: Fill the sinks in my DEM layer
Agent: ✅ Successfully executed whitebox:FillDepressions
Loaded layers: dem_filled
User: Now calculate flow accumulation
Agent: ✅ Successfully executed whitebox:D8FlowAccumulation
Loaded layers: flow_accumulation
User: Extract streams with a threshold of 500
Agent: ✅ Successfully executed whitebox:ExtractStreams
Loaded layers: streams
whitebox_agent/
├── __init__.py # Plugin entry point
├── whitebox_agent.py # Main plugin class
├── metadata.txt # Plugin metadata
├── core/
│ ├── processing_registry.py # Algorithm discovery
│ ├── context_builder.py # LLM context generation
│ ├── llm_client.py # Multi-provider LLM client
│ └── agent_executor.py # Action execution
├── dialogs/
│ ├── chat_dock.py # Chat interface
│ └── settings_dock.py # Settings panel
└── icons/
├── icon.svg
├── settings.svg
└── about.svg
- Processing Registry Adapter: Discovers all WhiteboxTools algorithms from QGIS Processing registry at runtime
- Context Builder: Builds structured context including available algorithms and loaded layers
- LLM Client: Unified client supporting Ollama, Claude, OpenAI, and Gemini
- Agent Executor: Executes actions returned by the LLM (run algorithm, ask user, explain)
The LLM returns structured JSON responses:
{
"action": "run_algorithm",
"algorithm_id": "whitebox:FillDepressions",
"params": {
"dem": "layer_id_here",
"output": "TEMP"
},
"load_outputs": true
}Supported actions:
ask_user: Request information from the userselect_algorithm: Suggest candidate algorithmsrun_algorithm: Execute a processing algorithmexplain: Provide explanation or information
# Test outside QGIS (LLM client only)
python test_plugin.pyFor full testing, the plugin must be run inside QGIS with WhiteboxTools installed.
The data/ folder contains sample datasets for testing:
dem.tif: Sample Digital Elevation Modelbasin.geojson: Sample watershed boundary
- Python 3.10+
- PyQt5 (bundled with QGIS)
- QGIS 3.28+
# Activate the geo conda environment
conda activate geo
# Run QGIS from command line
qgis- Algorithm Validation: All algorithm IDs are validated against the QGIS Processing registry
- Parameter Validation: Parameters are validated against algorithm schemas
- Layer Validation: Input layers are validated against the current project
- No Shell Execution: All processing runs through QGIS Processing API
- Temporary Outputs: Uses QGIS temporary outputs by default
Make sure WhiteboxTools Processing provider is installed:
- Go to Plugins → Manage and Install Plugins
- Search for "WhiteboxTools" or "WBT"
- Install and enable the WhiteboxTools plugin
- Make sure Ollama is running:
ollama serve - Check if the model is pulled:
ollama list - Verify the base URL in settings (default:
http://localhost:11434)
- Open the Settings panel
- Enter your API key for the selected provider
- Click "Test Connection" to verify
- Save settings
MIT License - see LICENSE for details.
Contributions are welcome! Please open an issue or submit a pull request.
- WhiteboxTools by John Lindsay
- QGIS - The leading Free and Open Source GIS
- Ollama - Run LLMs locally