- AI agents are not chatbots - they generate, execute, and validate geospatial code autonomously in sandboxed environments
- First-attempt success rate: ~60%. The other 40% requires iterative refinement (average 2.3 iterations to pass validation)
- Cost per workflow migration: $0.50-$2.00 in AI tokens. Compare to $5,000-$20,000 for manual consultant migration
- The dual-agent pattern (Builder + Auditor) catches 94% of errors before human review. Single-agent approaches catch only 60%
In Part 1, we argued that AI agents are fundamentally different from chatbots. This post shows the receipts: the actual architecture, the actual failure rate, the actual costs, and - most importantly - when AI agents make your GIS workflows worse, not better.
If you have not read Part 1, start there for context on why generic LLMs fail at GIS. This post assumes you understand the difference between a chatbot that suggests code and an agent that executes it.
What AI Agents Actually Do
The distinction matters because it determines what you can realistically expect. A chatbot is a conversation partner. An agent is a worker.

| Chatbot | AI Agent |
|---|---|
| Answers questions about GIS | Generates GIS code |
| Suggests approaches | Executes code in a sandbox |
| Requires human to implement | Validates output against expected results |
| Stateless (each message independent) | Stateful (remembers workflow context) |
| Generic (no domain knowledge) | Domain-specific (CRS, topology, spatial joins) |
The key difference: An AI agent does not tell you how to do a spatial join. It writes the code, runs it, checks the output geometry count and CRS, catches the error when it uses the wrong projection, rewrites the code, and runs it again. Autonomously.
The Architecture
This is the pipeline we built. Not a whiteboard sketch - this is running in production. Each stage has a specific job and a specific AI model chosen for that job.
PIPELINE ARCHITECTURE
Analyses workflow, builds SmartDAG (dependency graph). Identifies inputs, outputs, transformations, decision points.
Generates open-source equivalent code. Uses GeoPandas, rasterio, Shapely, pyproj.
Runs generated code in isolated environment. Captures output data, execution time, memory usage, errors.
Compares source vs generated output. Checks geometry count, CRS, attribute schema, spatial accuracy.
Three architectural decisions drive the reliability of this pipeline.
Two different AI models
Builder uses GPT-OSS-120B (optimised for code generation). Auditor uses Gemini 3 Pro. A different model catches errors the builder's model systematically makes. Same-model review has blind spots.
Sandbox execution
Code runs in an E2B sandbox, not on the user's machine. Isolated, reproducible, safe. 0.2-second warm start means iteration is fast enough to be practical.
LangGraph orchestration
Stateful orchestration with conditional edges. If the auditor rejects, execution flows back to the builder with specific feedback. This feedback loop is hard to build with simple prompt chaining.

The Dual-Agent Pattern
This is the insight that changed everything for us. Two agents - one that builds, one that audits - dramatically outperform a single agent doing both.
| Metric | Single Agent | Dual Agent |
|---|---|---|
| First-attempt accuracy | 55-60% | 60-65% |
| Accuracy after refinement | 70-75% | 94%+ |
| CRS errors caught | 40% | 95% |
| Missing edge cases caught | 30% | 85% |
| Average iterations to pass | 3.8 | 2.3 |
The improvement after refinement is where the dual-agent pattern really separates itself. A single agent reviewing its own code has the same blind spots that created the errors. The Auditor - running a different model with different training data - catches what the Builder cannot see.
Why it works: The Auditor does not just flag errors. It provides specific, actionable feedback: "Output has 15,247 geometries but source has 15,312. 65 geometries lost in the dissolve step. Check how NULL group values are handled." This targeted feedback means the Builder fixes the right thing on the next iteration, not a guess.
Sandbox Execution
Generating code is the easy part. The hard part is knowing whether it produces correct output. That requires actually running it.
E2B sandbox - 0.2-second warm start. Full Python environment with GeoPandas, rasterio, GDAL pre-installed.
Complete isolation - No access to client data, network, or filesystem outside the sandbox. Each iteration gets a fresh environment.
Real validation - Not "does the code look right" but "does it produce correct output." Geometry counts, CRS, schema, spatial accuracy - all verified against the source.
Here is what the Auditor actually validates after every sandbox run:
def validate_output(source_output, generated_output):
checks = {
"geometry_count": len(source_output) == len(generated_output),
"crs_match": source_output.crs == generated_output.crs,
"schema_match": set(source_output.columns) == set(
generated_output.columns
),
"spatial_accuracy": source_output.geometry.equals(
generated_output.geometry
),
"attribute_accuracy": source_output.drop(
columns="geometry"
).equals(
generated_output.drop(columns="geometry")
),
}
return checksEvery check is binary. Either the output matches the source or it does not. There is no "close enough" in geospatial processing - a wrong CRS can shift features by thousands of kilometres.
Failure Modes - Honest
About 40% of workflows do not pass on the first attempt. Here is where they fail and why. These numbers come from production runs, not benchmarks.
CRS CONFUSION
The agent generates code assuming EPSG:4326 when the source data is in a projected CRS. The Auditor catches this by comparing output extents, but it adds an iteration.
TOPOLOGY COLLAPSE
Dissolve operations that produce invalid geometries - self-intersections, holes. The fix is always buffer(0) or make_valid(), but the agent does not always add this preventatively.
ATTRIBUTE LOSS IN JOINS
Spatial joins that drop attributes because of column name collisions. The agent does not always handle lsuffix/rsuffix correctly.
MEMORY OVERFLOW ON LARGE DATASETS
Generated code that loads entire datasets into memory. The fix is chunked processing, but this requires understanding the data size - which the agent does not always have upfront.
DATE/TIME HANDLING EDGE CASES
Time-zone aware vs naive datetimes, date format mismatches between source systems. A persistent headache in any data pipeline.
GENUINE FAILURES
Some workflows are too complex, too poorly documented, or too dependent on proprietary ESRI logic for AI agents to migrate. These require human expertise. We are honest about this.
THE HONEST PICTURE
6% of workflows genuinely cannot be automated with current AI capabilities. That number will shrink as models improve, but it will never reach zero. Proprietary spatial algorithms, undocumented business logic, and edge cases in legacy data formats will always need human expertise.
Real Costs
Everyone claims AI saves money. Here are the actual numbers - including the costs that most vendors conveniently omit.
COST PER WORKFLOW MIGRATION
THE COST NOBODY MENTIONS
The $0.55-$2.10 is the AI cost. It does not include the human time to prepare inputs (uploading workflows, providing context) or the human review of outputs. Budget 15-30 minutes of human time per workflow. At $150/hr consultant rate, that is $37.50-$75 per workflow. Still 99%+ cheaper than fully manual migration - but pretending the human cost is zero would be dishonest.
When AI Agents Make Things Worse
This is the section most AI vendors skip entirely. There are real scenarios where AI agents are the wrong tool. Using them anyway wastes time and money.
Simple, one-off tasks
If you need to run a buffer operation once, opening QGIS takes 30 seconds. Setting up an AI agent pipeline takes 5 minutes. Do not use a cannon to kill a mosquito.
Highly regulated workflows with audit trails
In some industries - nuclear, defence - every line of code needs human sign-off. AI-generated code adds a review burden that may exceed the time saved. The audit trail complexity alone can negate the efficiency gains.
Workflows with undocumented tribal knowledge
If the analyst's workflow depends on "I just know this step needs to happen before that step because of how the data comes in on Tuesdays," the AI agent will miss this. Tacit knowledge needs human capture first.
When the goal is understanding, not output
Junior analysts learning GIS should write their own code. Using AI agents to skip learning creates dangerous knowledge gaps. The person who does not understand the analysis cannot validate it.
Safety-critical real-time operations
Emergency response, real-time asset tracking, safety-critical infrastructure monitoring. AI agents should augment, never replace, human decision-making when lives or critical assets are at stake.
When your data quality is poor
AI agents amplify data quality issues. Garbage in, confidently generated garbage out. If your source data has inconsistent schemas, missing CRS definitions, or corrupt geometries, fix the data first. Automating a broken input just produces broken output faster.
What This Means for GIS Teams
AI agents do not replace GIS analysts. They replace the repetitive parts of their work. The distinction is critical because it determines how you plan adoption.
THE ANALYST ROLE SHIFTS
From "do the analysis" to "design the analysis and validate the output." The skill set evolves from tool operation to workflow architecture. Analysts become reviewers and designers, not button-clickers.
THE CAPACITY MULTIPLIER
Teams that adopt AI agents can handle 10-50x more workflows without proportional hiring. But this requires investment in understanding what AI can and cannot do - which is why posts like this one exist.
The transition is not instant. Expect 2-4 weeks to identify which workflows are automation candidates, another 2-4 weeks to validate the first batch, and ongoing refinement after that. Teams that skip the assessment phase and try to automate everything at once invariably waste time on workflows that should have stayed manual.
For the business case behind automating GIS workflows, including the cost models and ROI timelines, read our workflow automation guide. For the open-source libraries our agents use for code generation, see the ArcPy to GeoPandas migration guide.
AI agents for GIS are real, useful, and imperfect. The 94% accuracy after refinement is excellent - but the 6% that genuinely fail matters too.
The architecture works because it treats AI-generated code with healthy scepticism. Every output is executed in a sandbox, validated against the source, and refined until it passes or is flagged for human review. No blind trust. No hand-waving about accuracy.
The honest answer is that AI agents handle the 80% of GIS work that is repetitive, well-defined, and automatable. The other 20% still needs experienced analysts. The question is whether your team is spending its time on the right 20%.
Frequently Asked Questions
How accurate are AI agents at automating GIS workflows?
First-attempt success rate is approximately 60%. With a dual-agent pattern (Builder + Auditor) and iterative refinement, accuracy reaches 94%+ by the third iteration. The key is sandbox execution with real validation - actually running the code and comparing output, not just reviewing the syntax.
How much does AI-powered GIS workflow migration cost?
AI token costs run $0.50-$2.00 per workflow migration, with sandbox execution adding roughly $0.01. Including human review time (15-30 minutes at consultant rates), total cost is $40-$77 per workflow. Compare to $5,000-$20,000 for fully manual consultant migration. The 99%+ cost reduction is real, but only if you account for all costs honestly.
When should you NOT use AI agents for GIS automation?
AI agents are a poor fit for simple one-off tasks (QGIS is faster), highly regulated workflows requiring line-by-line audit trails, workflows dependent on undocumented tribal knowledge, learning scenarios where junior analysts need to build skills, safety-critical real-time operations, and situations where underlying data quality is poor. Fix data quality issues before attempting automation.
Get Workflow Automation Insights
Monthly tips on automating GIS workflows, open-source tools, and lessons from enterprise deployments. No spam.
