Natural language interface to build geoprocessing workflows in QGIS
QGIS AI Model Builder is a QGIS plugin that converts natural language instructions into complete geoprocessing workflows. Describe your spatial task in plain language, and the plugin generates a Processing pipeline that you can visualize, edit, and execute directly in QGIS.
- Natural Language Input: Describe workflows in plain language (e.g., "create a 1000m buffer around parcels and calculate area in hectares")
- Automatic Pipeline Generation: Converts instructions into structured QGIS Processing workflows
- Workflow Visualization: View pipeline steps and parameters before execution
- Model Designer Integration: Export and open workflows in QGIS Model Designer for manual editing
- Layer Detection: Automatically suggests the best matching layer based on name, geometry type, and active layer
- Background Execution: Runs workflows using QgsTask to prevent UI freezing
The MVP version supports the following QGIS Processing algorithms:
- Buffer (
native:buffer) - Reproject (
native:reprojectlayer) - Field Calculator (
native:fieldcalculator) - Fix Geometries (
native:fixgeometries) - Dissolve (
native:dissolve) - Clip (
native:clip) - Intersection (
native:intersection)
- Open QGIS
- Go to Plugins → Manage and Install Plugins
- Search for "QGIS AI Model Builder"
- Click Install Plugin
- Download or clone this repository
- Copy the plugin folder to your QGIS plugins directory:
- Windows:
C:\Users\<username>\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ - Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - macOS:
~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/
- Windows:
- Restart QGIS
- Enable the plugin in Plugins → Manage and Install Plugins → Installed
- QGIS 3.28 or higher
- Python 3.9 or higher
- Open the Plugin: Go to Plugins → AI Model Builder (or use the toolbar button)
- Describe Your Workflow: Type your spatial task in natural language
- Example: "buffer the parcels by 1000 meters, dissolve by municipality and calculate total area"
- Generate Workflow: Click Generate Workflow to create the pipeline
- Preview Steps: Review the generated workflow steps and parameters
- Execute or Edit:
- Click Run Workflow to execute directly
- Click Open in Model Designer to edit the workflow manually
Input: "Create a 1000 meter buffer around parcels and calculate area in hectares"
Generated Pipeline:
1. Reproject layer (if CRS is geographic)
2. Buffer (distance: 1000m)
3. Add field (area_ha)
4. Calculate area (expression: $area / 10000)
# Clone the repository
git clone https://github.com/lcsmarcone/modelai.git
cd modelai
# Install Poetry (if not already installed)
# See: https://python-poetry.org/docs/#installation
# Install dependencies
poetry install# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=.
# Run specific test file
poetry run pytest tests/test_pipeline_generation.py# Lint code
poetry run ruff check .
# Format code
poetry run ruff format .modelai/
├── core/ # Core functionality
│ ├── planner.py # Pipeline generation
│ ├── pipeline_executor.py # Workflow execution
│ ├── layer_resolver.py # Layer detection
│ └── pipeline_schema.py # Pipeline validation
├── ui/ # User interface
│ ├── main_dialog.py # Main plugin dialog
│ └── pipeline_view.py # Pipeline visualization
├── models/ # Model export
│ └── model_exporter.py # Model Designer export
├── tests/ # Test suite
└── docs/ # Documentation
- ✅ Basic pipeline generation from natural language
- ✅ Workflow visualization
- ✅ Background execution
- ✅ Layer detection
- ✅ Model Designer integration
- LLM integration (OpenAI, Claude, local models)
- Advanced workflow graph engine
- Iterative workflow editing
- Field resolver
- Automatic CRS handling
- Privacy modes (metadata-only, sample data)
- Multiple LLM provider support
See FULL_VISION.md for the complete roadmap.
Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the GNU General Public License v2.0 (GPL-2.0) - see the LICENSE file for details.
- Built for the QGIS Processing Framework
- Inspired by the need for more accessible geoprocessing workflows
- Issues: GitHub Issues
- Documentation: See docs/ folder
- QGIS Plugin Repository: Coming Soon
🚧 This plugin is currently in MVP development phase
The plugin is experimental and under active development. Features may change between versions.