Late last year, we launched AI Agents on the CARTO platform, a key piece of our Agentic GIS vision to put geospatial analysis within reach of every team. These agents provide a conversational interface embedded in your maps, letting users perform spatial analysis through natural language, running queries directly on your data warehouse, powered by your vetted AI providers and LLMs of choice.
Since then, we've built and refined agents internally and with customers across dozens of use cases, from insurance risk assessment and network planning to retail site selection and urban mobility analysis. That hands-on experience taught us what makes a geospatial agent actually work, and what makes it fall short.
Those lessons pointed to a clear conclusion: building a reliable agent requires more than connecting a model to your data. It takes understanding how context, instructions, and tools need to work together for each use case. That's what led us to create the Agent Configuration Assistant, a tool that reduces the effort of setting up agents while raising their quality. You focus on your goal and requirements. The Assistant already has our best practices baked in.
This post walks through six of those lessons and how they shaped the way we build agents today.
1. Start with a well-scoped use case
It's tempting to create an all-purpose agent, one that handles site selection, revenue forecasting, logistics optimization, and customer segmentation all at once. But the broader the scope, the harder it is for the agent to know which datasets matter, which analysis to run, or what a good answer even looks like. It defaults to generic queries, picks the wrong datasets, and produces results that look plausible but are operationally useless.
The most effective agents we've seen are built around a specific, well-scoped use case, designed around the business questions the end user will actually ask. A territory manager agent built around one question, "Which stores are underperforming?" or "How does this region compare?", knows exactly where to look. It reaches for the stores dataset, prioritizes revenue and footfall metrics, and returns results as a map with regional context already in place.
Too broad
"An agent that helps with geospatial analysis. It can handle location data, run queries, and create visualizations for any use case."
Focused
"An agent for retail territory managers that analyzes store performance by region, comparing revenue, footfall, and competitor proximity, and highlights underperforming locations."
If you've ever scoped a map dashboard, you already know this instinct. The same focus and intentionality that makes a good dashboard makes a good agent.
Start narrow. Think about who will use this agent and what they need to accomplish. An agent built for a specific audience earns trust. An agent built for "everyone" earns none.
2. Context is what separates a useful agent from a frustrating one
One of our earliest agents had access to a complex data model but we hadn't explained what the fields meant or how the tables related. The queries it generated were syntactically correct but operationally meaningless.
Most agent failures are not model failures. They are context failures.
For geospatial agents, context means giving the agent real knowledge about your data (what columns mean, how tables relate, what a good query looks like) and about the use case it serves. CARTO provides part of this context automatically, like the map configuration and the definitions of the tools enabled by the creator. The rest comes from you. The Agent Configuration Assistant makes this easier by generating the full agent configuration through conversation, including enabling MCP tools that turn complex geospatial operations into capabilities the agent can call.