Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors GeoAgent’s QGIS automation architecture to reduce redundancy and memory usage by introducing a multi-step “outer workflow” graph plus a single-task geoprocessing sub-graph, and by caching the QGIS processing registry metadata for faster algorithm discovery.
Changes:
- Added a cached processing algorithm catalog and a new token/tag-based local scoring algorithm finder.
- Replaced the previous processing graphs with a new multi-step workflow (
agents/workflow.py) and a single-task geoprocessing sub-graph (agents/geoprocessing_flow.py). - Simplified/renamed system prompts and updated structured schemas/state types to match the new workflow.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/geoprocessing.py | Adds cached registry catalog + improved algorithm discovery and updates execution output handling. |
| prompts/system.py | Renames/simplifies routing/selection/parameter/error-analysis prompts for the new workflow. |
| agents/workflow.py | New outer-loop multi-step workflow graph coordinating per-task routing and execution. |
| agents/geoprocessing_flow.py | New single-task geoprocessing sub-graph with retry + error analysis. |
| agents/graph.py | Updates general graph behavior (context trimming + loop back after tools) and switches processing mode to the new workflow. |
| agents/states.py | Replaces the old monolithic processing state with WorkflowState + GeoTaskState. |
| agents/schemas.py | Updates structured-output schemas for per-task routing/decomposition and error analysis. |
| agents/init.py | Re-exports the new graph builders/states/schemas and removes old exports. |
| agents/processing.py | Removed legacy single-step processing graph implementation. |
| agents/multi_step_processing.py | Removed legacy recursive multi-step processing implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| scored = [(_score_algorithm(tokens, e), e) for e in catalog] | ||
| scored = [(s, e) for s, e in scored if s > 0] | ||
| scored.sort(key=lambda item: item[0], reverse=True) | ||
| matches = [e for _, e in scored[: max(1, limit)]] |
Comment on lines
+168
to
+179
| if not selected: | ||
| _logger.info("GEO select: shortlist insufficient; trying full catalog") | ||
| full_lines = "\n".join( | ||
| f"- {e['id']} | {e['name']}" | ||
| for e in get_algorithm_catalog() | ||
| if e["id"] not in excluded | ||
| ) | ||
| answer = _ask_selection( | ||
| operation, "All available algorithms:\n" + full_lines, retry_context | ||
| ) | ||
| if answer and answer in catalog_ids and answer not in excluded: | ||
| selected = answer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.