ArcGIS AI Components (`<arcgis-ai-chat>` / `<arcgis-ai-assistant>`) - Unable to query related tables
Hi everyone,
I'm evaluating the ArcGIS AI Components (`<arcgis-ai-chat>` / `<arcgis-ai-assistant>`) with a web map hosted in ArcGIS Online and would like to understand whether the behavior I'm seeing is expected or if I'm missing any configuration.
Environment
* ArcGIS Online
* Parcel feature layer
* Related tables:
* `owner_table`
* `documents`
* `tax_assessment`
* `agreement_status`
* Relationship classes created in the file geodatabase
* Data published to ArcGIS Online
* Relationships are visible in the ArcGIS REST Services Directory
What I have verified
* Relationship classes exist in the geodatabase.
* Relationships are published correctly.
* Related tables are available in the hosted feature layer.
* The AI assistant can successfully query parcel layer attributes.
Tests performed
Layer detection
* Prompt: `What are the layers available in the map?`
* Result: Only detects the vector layer.
Layer visibility
* Prompt: `Turn off the parcels layer.`
* Result: Not working.
Zoom to layer
* Prompt: `Zoom to parcel layer.`
* Result: Working.
Feature count
* Prompt: `Feature count of the parcel layer.`
* Result: Working.
Query feature
* Prompt: `Show parcels where tenureType = 'Freehold'.`
* Result: Working.
Highlight feature
* Prompt: `Highlight the parcel feature where parcel id is 1.`
* Result: Working.
Change symbology
* Prompt: `Can you change the color of the parcel layer?`
* Result: Not working.
Query related table
* Prompt: `Get the doctype of the feature where parcel id is 2.`
* Result: Not working.
Parcel layer attributes
* Prompt: `List the attributes of the parcels layer.`
* Result: Working.
Parcel attribute values
* Prompt: `List all owner names from the parcel layer.`
* Result: Working.
Buffer creation
* Prompt: `Create a buffer from the parcel where id is 3.`
* Result: Not working.
Last clicked location
* Prompt: `Can you give me the latitude and longitude of the last clicked point on the map?`
* Result: Not working.
Main issue
The AI assistant correctly answers questions based on the parcel layer attributes, but it cannot retrieve values from related tables such as `documents`, `owner_table`, `tax_assessment`, and `agreement_status`.
For example:
* `Get the doctype of the feature where parcel id is 2`
* `Show the agreement status for parcel id 1`
* `Show the tax assessment for parcel id 3`
These queries do not return the expected results, even though:
* The relationship classes exist.
* The relationships are published successfully.
* The relationships are visible in the ArcGIS REST Services Directory.
Is querying related tables through relationship classes currently supported by `<arcgis-ai-chat>` / `<arcgis-ai-assistant>`?
If not, is there a recommended approach or sample implementation for enabling this functionality? Additionally, are operations such as changing layer visibility, changing symbology, creating buffers, and retrieving the last clicked map coordinates currently supported, or do they require custom tool integration?
Any clarification or guidance would be appreciated.
Based on the current ArcGIS AI Components documentation, this behavior appears to be expected.
<arcgis-assistant> provides a chat-based natural language interface and uses an orchestrator to route user intent to agents. However, the built-in agents are not equivalent to full Map Viewer automation. The built-in Data Exploration Agent is mainly intended for querying and exploring feature layer data in a 2D web map, and Esri notes that it can filter/query data but cannot change symbology, create new layers, or export query results.
For related tables, even though the relationship classes are correctly published and visible in the REST Services Directory, I do not see related-table traversal through relationship classes listed as an out-of-the-box capability of the built-in AI agents. ArcGIS itself supports related-record queries through FeatureLayer.queryRelatedFeatures(), RelationshipQuery, and the REST queryRelatedRecords operation, but these would need to be called explicitly from application code or a custom tool.
So for prompts such as:
Get the doctype of the feature where parcel id is 2
Show the agreement status for parcel id 1
Show the tax assessment for parcel id 3
the recommended approach would be to implement a custom agent or custom FunctionTool. The tool can:
1. Query the parcel layer using the parcel id.
2. Get the parcel OBJECTID.
3. Identify the correct relationshipId.
4. Call queryRelatedRecords or FeatureLayer.queryRelatedFeatures().
5. Return the related table values back to the assistant response.Similarly, actions such as changing layer visibility, changing symbology, creating buffer graphics/layers, and retrieving the last clicked map coordinate should be exposed as custom tools or application-level functions. The assistant can then route the user’s natural language request to those tools.
In short, the ArcGIS AI Assistant can provide the chat UI and agent orchestration, but related table queries and advanced map actions currently require custom agent/tool integration.
Thanks,
Aduri Sreenivas