AWS Public Sector Blog
How Strands Agents brings geospatial generative AI to the public sector
Government agencies manage vast amounts of location-based information daily, tracking where incidents occur, coordinating nearby crews, and optimizing resource routing. Yet despite this spatial data representing roughly 80% of all government information, accessing these insights often requires specialized geographic information system (GIS) expertise and complex software that creates barriers for staff members.
This post explores how AI agents powered by Strands Agents on Amazon Web Services (AWS) can transform geospatial workflows, making spatial data accessible to any government worker through natural language interactions. We’ll examine the technical architecture, implementation details, and demonstrate the approach using Brussels’ FixMyStreet open data API, an open data API available for the city of Brussels, which provides real-time nonemergency incident reports including graffiti, road maintenance, and public infrastructure repairs across the city.
The challenge: Inaccessible location data
Although approximately 80% of government data contains spatial components that could drive better decision-making across numerous areas, including infrastructure maintenance, emergency response, urban planning, and resource allocation, two critical barriers prevent broader access to this information.
The first is bottlenecks due to GIS expertise. Traditional tools require training in spatial concepts, coordinate systems, and complex interfaces. Second, some interfaces are inaccessible. Without intuitive tools, valuable spatial insights remain locked away from the staff who could benefit most from location-based decision-making in their daily operations. The solution lies in intelligent agents that can bridge this gap, handling the technical complexity and allowing staff to interact with spatial data through simple, conversational requests.
Solution overview
This agent-based approach processes natural language queries and presents geospatial insights through an interactive map visualization.
The AI agents are built with Strands Agents, a lightweight framework designed for creating task-oriented AI agents that can integrate multiple tools and data sources. Strands provides the structure needed to integrate natural language understanding—using models such as Anthropic’s Claude Haiku 3.5 in Amazon Bedrock—with specialized geospatial tools while maintaining control over how these components work together.
By combining these capabilities, the solution eliminates the technical barriers that prevent most government staff from accessing location-based insights while maintaining the accuracy and reliability required for public sector operations.
The following real-world example demonstrates how this works in practice, using publicly available Brussels nonemergency incident data.
Here’s how a government employee might interact with the system using publicly available Brussels nonemergency data.
User query: “Show me all graffiti reports in Grand Place that are ready to get processed”
Figure 1: User asking the agent “Show me all graffiti reports in Grand Place that are ready to get processed”
Agent response: “I’ve found 10 graffiti incidents in the Grand Place area that are currently in the PROCESSING status. Notably, 9 out of the 10 incidents have been open for more than 14 days, which might indicate a backlog in graffiti removal. Would you like me to help you create a route to address these incidents or provide more details about any specific incident?”
The results appear immediately on an interactive map, while the agent seamlessly handles the technical complexity behind the scenes, as shown in the following screenshot.
Figure 2: The result of the query, showing the points from the search results for incident reports in “Grand Place” that are in “PROCESSING” status, as well as a short summary
Behind the scenes, the agent processes this request by:
- Geocoding “Grand Place” to coordinates (4.35178, 50.84623; 4.35329, 50.84721)
- Filtering for “graffiti” category and “PROCESSING” status
- Executing a spatial query within the Grand Place bounding box
- Returning formatted results with summary statistics
The user can then ask a follow-up query for route optimization and assignment. For follow-up queries, the user can interact with the visualized results. When they select the bounding box from the previous response, it becomes highlighted and provides context for the next request, as shown in the following screenshot.
User Query: “Create a route starting and ending at Avenue Des Arts 27 and assign it to the relevant team”
Figure 3: User asking the agent the follow-up query, “Create a route starting and ending at Avenue Des Arts 27 and assign it to the relevant team”
Agent Response: “I’ve created an optimized route starting and ending at Avenue Des Arts 27, which covers 10 graffiti incidents in the Grand Place area. The route has been assigned to the graffiti team with high priority, with special notes about the long-standing incidents. The team will receive full details about the route and incidents to address. Is there anything else you would like me to do?”
The optimized route is displayed on the map with turn-by-turn directions, and team members receive instant notifications containing complete route details, the priority level and special notes, a direct link to the navigation interface, and a list of incidents to address, as shown in the following screenshot.
Figure 4: The result of the query, showing the route through the incident reports from the previous search result and assigning it to the relevant team for collection
This complete workflow, from natural language query to actionable route assignment, demonstrates how the solution transforms geospatial operations into straightforward, conversational interactions that still offer the precision and reliability that government operations require.
Architecture overview
The following architecture demonstrates how these concepts work together in practice, integrating AI processing, geospatial tools, and data management to deliver the solution’s conversational geospatial capabilities. The solution architecture integrates several components to deliver seamless geospatial analysis:
- User interface layer – A web-based interface that accepts natural language queries and displays interactive maps with search results.
- Tool layer – AWS Lambda functions handle geocoding, route creation, and route assignment. These are decoupled from the agent for modularity, whereas tools that generate SQL remain within the agent Lambda in the isolated subnet in the virtual private cloud (VPC) for secure PostGIS access.
- AI processing layer – Amazon Bedrock with Claude Haiku 3.5 interprets user intent and orchestrates the appropriate geospatial operations.
- Data layer – Amazon Relational Database Service (Amazon RDS) for PostgreSQL with PostGIS extensions provides spatial data storage and querying capabilities.
- Ingestion layer – A Lambda function updates nonemergency incidents from the Brussels FixMyStreet API every minute using Amazon EventBridge Scheduler.
This architecture is illustrated in the following diagram.
Although the architecture provides the foundation for the solution, the real intelligence comes from how the agent processes and responds to user queries. Let’s examine the systematic workflow, or Agent Loop, that enables natural language interactions with this infrastructure.
Agent Loop
The agent uses Strands Agents to process user queries through an iterative workflow that seamlessly orchestrates specialized geospatial tools. This Agent Loop operates through a systematic sequence:
- Query analysis – The agent interprets natural language input to understand spatial intent and requirements.
- Tool selection – Based on current context and conversation history, the agent chooses the most appropriate geospatial tool (this decision can be revisited after each tool execution).
- Parameter extraction – The agent pulls the inputs it needs immediately—such as addresses, coordinates, and filters—and uses any new data gathered so far from previous tool execution and conversation history.
- Tool execution – The agent invokes the chosen tool, analyzes the output, and determines whether to continue the loop with additional tools or proceed to finalization.
- Result processing – After the iterative loop concludes, the agent formats spatial outputs for clear visualization.
- Response generation – The agent delivers natural language explanations alongside interactive map displays.
To be able to achieve its goals, the agent has some tools available:
- Geocode Address – Converts addresses and place names to single coordinates or bounding-boxes
- Get Incidents In Area – Generates and executes PostGIS point-in-polygon queries using ST_Within() for spatial containment analysis
- Get Incidents Near Location – Generates and executes PostGIS proximity searches with ST_DWithin() to find incidents within specified radii
- Get Optimized Route – Calculates efficient routes for field teams and service vehicles
- Assign Route To Team – Assigns the optimized routes to relevant field teams with priority levels and contextual notes
- Get Current Time – Retrieves current date and time for temporal context
The following diagram illustrates the Agent Loop for the geospatial application, highlighting the available tools.
This iterative approach brakes down complex geospatial queries into manageable steps, with each tool building upon previous results to deliver comprehensive, actionable insights.
Tool-based query building
Rather than allowing AI agents to generate arbitrary SQL queries (text-to-SQL), we’ve implemented a controlled, tool-based approach that balances flexibility with security and reliability. Direct text-to-SQL approaches let an LLM write raw SQL for every prompt. That works for quick prototypes, but in public sector environments, it introduces unpredictable queries, hard-to-trace errors, and wide security exposure. Our tool-based architecture addresses these concerns:
- Controlled execution – The AI selects from preapproved tools rather than generating arbitrary SQL queries
- Parameterized queries – All database interactions use tested and secure code with user inputs is safely handled as parameters
- Consistent performance – Query patterns are optimized and predictable, enabling reliable system behavior
- Full auditability – The observability capabilities of Strands Agents provide complete logging of which tools were executed and with what parameters
Our approach begins by encoding existing field team workflows into dedicated tools, then expanding the catalog as new use cases emerge. Each new tool inherits the same security guardrails and operational standards. Because every query executes through owned, versioned tools, we can thoroughly test changes before deployment and reuse audited logic across teams—so that operations staff receive consistently trustworthy results.
Radius search example
The Strands framework enables reliable spatial analysis through validated tools. Here’s an example of a proximity search tool that generates PostGIS queries for area-based incident searches:
This tool definition uses the Strands Agents @tool decorator, which automatically generates a schema from the function signature and type constraints. This means that the agent’s parameter choices are restricted to valid, domain-specific values.
The status parameter demonstrates this constraint-based approach:
IncidentStatus = Literal["CREATED", "PROCESSING", "CLOSED"]
By restricting the agent to the three specific status values, "CREATED", "PROCESSING", and "CLOSED", the system prevents errors from invalid status strings but provides consistent data handling across all queries.
This structured approach transforms potentially risky, open-ended SQL generation into a more secure and predictable system that maintains the flexibility government operations require while delivering the reliability they demand.
Conclusion
This solution shows how government agencies can democratize access to geospatial data by pairing the natural-language tooling of Strands Agents with purpose-built geospatial capabilities. The approach maintains the accuracy and reliability essential for public sector operations while dramatically expanding who can access spatial insights.
The versatility of this agent-coordinated, tool-based approach extends well beyond incident response across numerous public sector applications such as urban planning, transportation, and environmental monitoring. Urban planning teams can surface permit backlogs, identify zoning conflicts, visualize hotspots, and drill into specific parcels through natural language queries displayed on interactive maps. Transportation departments can analyze traffic congestion patterns, optimize route planning, and seamlessly share navigation paths with field crews. Units can query air quality readings, overlay trend analysis, and proactively identify compliance risks across geographic regions.
By using trusted AI models, validated tools, and shared map visualization to standardize queries, this architecture provides agencies with a practical, cost-effective alternative to traditional GIS software. The result is a scalable solution that puts sophisticated geospatial insights into the hands of far more government workers, enabling data-driven decision-making across departments without requiring specialized technical expertise.


