Repository navigation
Repository layout
github-actions[bot] edited this page Oct 25, 2026
·
1 revision
This page comes from
site/content/development/layout.mdin the repository and is regenerated on every merge tomain. To correct it, edit that file; changes made here are overwritten.
The repository is a single tree: one GPL v2 codebase with no second copy to keep in sync (an earlier version maintained two parallel trees; see the [1.4.0] changelog entry). The plugin has no build step; the only artefact is the release zip.
cartogen-ai-qgis-plugin/
├── __init__.py plugin entry point (classFactory); bootstraps the namespace package
├── plugin_main.py initGui / unload, toolbar action, dock, Processing provider
├── metadata.txt QGIS plugin manifest, with the embedded changelog
├── plugin_upload.py builds the release zip (top folder cartogen_ai_plugin)
├── src/cartogen_ai/ the code (below)
├── tests/ unit tests (no QGIS needed) and *_live.py tests (need QGIS)
├── docs/ living references, trackers, dated reports, release_smoke_assets, images
├── tools/ developer scripts (live test pack, audits, task derivation)
├── site/ this documentation site (generator, theme, authored pages)
├── service/ unfinished hosted-gateway prototype; NOT part of the plugin
├── branding/ logos and brand guidelines
└── .github/workflows/ tests, release, Pages
core/
├── agent/ the agent core
│ ├── agent_orchestrator.py CartogenAi: the tool-calling loop
│ ├── tool_dispatcher.py GUI-thread bridge for tools
│ ├── usage_tracker.py, history_manager.py
│ ├── loop_guard.py, output_router.py, task_matcher.py, task_register(.json)
│ ├── prompts.py, capabilities.py, chains.py, step_runner.py, discovery.py
│ ├── memory.py, chat_persistence.py, results_store.py, lineage.py, provenance.py
│ ├── scheduler.py, cancel_signal.py, project_session.py, evidence.py, api_trace.py
│ ├── services/ script_isolation.py and its worker process
│ └── tools/ 294 tools, one module per domain, plus _helpers
├── services/ prompt refiner, tool router, response guard, task runner, learning
├── models/ confidence, sensitivity, egress gate, plan gate, model view, transactions, dataset status
├── validators/ schema contracts, P-code depth validation
├── representation/ map representation planner (profiler, planner, applier)
├── ui/ dock, dialogs, chat formatting (Qt-free), icons, theme
├── logger.py, exceptions.py, net.py, proxy.py, release_notes.py
infrastructure/
├── auth.py credentials: QGIS Auth Manager or session memory only
├── deps.py optional-dependency checks
├── settings_keys.py every QgsSettings key, namespaced cartogen_ai/
└── providers/ OpenRouter, Gemini, Ollama, Cartogen stub, OpenAI and Claude (not offered)
processing/ QGIS Processing provider (hub siting, service area)
-
cartogen_aiis a PEP 420 namespace package (no__init__.pyinsrc/cartogen_ai/). The release zip's top folder iscartogen_ai_plugin, nevercartogen_ai: a folder of that exact name in the plugins directory would be a regular package that shadows the namespace package and breaks everycartogen_ai.coreimport.plugin_upload.pyrefuses to build with that name. The name must also be a valid Python identifier, which plugins.qgis.org requires, so it contains no dots and does not start with a digit. -
Entry points stay at the repo root (
__init__.py,plugin_main.py) because QGIS imports the plugin folder by name. -
agent_orchestrator.pyis the one big file (about 2,000 lines). It was split once (dispatcher, usage tracker and history manager were extracted in the Phase 11 restructuring) and_run_implhas been kept below the lint complexity limit by moving logic into helpers. -
What ships in the zip is deliberately small: only
README.md,USER_GUIDE.md,TOOLS_REFERENCE.md, the humanitarian catalogue and the screenshots fromdocs/; no tests, notools/, nosite/, noservice/, no sample data, no binary documents, no hidden files.tests/test_directory_validator.pychecks the built zip against the plugin directory's rules.
- Every module that touches
qgis.corehas its ownQGIS_AVAILABLEguard and degrades without it. - Tool modules put pure parsers and decision logic in separate functions from the QGIS-touching code, so they are testable offline.
- Settings keys live only in
settings_keys.py. Qt 6 scoped enums (Qgis.MessageLevel.Critical), imports throughqgis.PyQt, neverPyQt5/PyQt6. - Frozen documents are never edited after the fact; see Contributing.
Cartogen AI 1.18.5 · generated from the repository at commit 26536e9f75 on 2026-11-12 · this wiki is rebuilt on every merge to main; edits made in the browser are overwritten, so correct the source files instead.
Get started
How it works
- Architecture overview
- The agent loop
- Threads, tasks and Stop
- Tools and routing
- Providers and networking
- Memory, state and results
- Guards and honesty checks
- The dock and dialogs
- Processing provider
Tools and data
- Tool reference
- AI Imagery Feature Extraction
- Data Analysis & Prediction
- Database & Workflows
- Export & Reporting
- Humanitarian Data (HDX / OSM / geoBoundaries)
- Humanitarian Logistics
- Monitoring & Scheduling
- Print Layouts
- Project Management
- Raster
- Reporting & Document Analysis
- Satellite Imagery & Vision
- Styling & Labeling
- System, Search & Scripting
- Task & Memory Management
- Vector & Geoprocessing
- More tools, by module
- Task register
- External data sources
Humanitarian GIS
Security and privacy
Develop
Project