Skip to content
ESM
import "@arcgis/ai-components/components/arcgis-assistant-data-exploration-agent";
Inheritance:
ArcgisAssistantDataExplorationAgentPublicLitElement
Since
ArcGIS Maps SDK for JavaScript 5.0
beta

The Data Exploration Agent enables the end user to query features, statistics, and spatial proximity to features in a layer within a web map. Currently, this is only scoped to querying feature layers within a 2D web map. See the list of capabilities below for more details.

The data exploration agent is designed to answer questions about the data in the map, and does not have access to external data sources or the user's location. It also cannot create visualizations in the form of charts, layer renderers, new maps, or other visual outputs. It can currently only provide answers in text form based on the data in the map.

This agent can change the state of the map by filtering features in a layer, but it cannot change the symbology of features or create new layers or export results of a query to a file or external source.

This is an unrendered component that must be added as a child of the arcgis-assistant component in either HTML or JavaScript.

<arcgis-map id="my-map"></arcgis-map>
<arcgis-assistant reference-element="my-map">
<arcgis-assistant-data-exploration-agent></arcgis-assistant-data-exploration-agent>
</arcgis-assistant>
const assistant = document.querySelector("arcgis-assistant");
const dataExplorationAgent = document.createElement("arcgis-assistant-data-exploration-agent");
assistant.appendChild(dataExplorationAgent);

Once added to the assistant, the agent is loaded and ready to receive user messages related to data exploration.

Capabilities

The data exploration agent provides the following capabilities related to exploring data in the map:

  • Query features - Ask about the attributes of features in a layer, including a single feature or a set of features.
  • Query statistics - Ask about statistics related to features in a layer. Statistics that can be queried include count, average, minimum, maximum, and sum. This includes asking about the top number of features based on a particular attribute.
  • Query spatial proximity - Ask about the spatial proximity of features in a layer, such as the number of features that intersect a polygon, or information about features within a distance of a specified location or feature. This currently does not include questions about the closest feature, but this is planned to be included in a future release.
  • Filter features - Users can ask the agent to show a subset of features that filter by attributes, or spatial proximity to other features. This includes asking the agent to show features that intersect a particular area, or are within a certain distance of a location or feature.

Example questions

The following are example questions a user can ask within the bounds of the data exploration agent. These questions assume a map with layers that include cities, states, and rivers.

  • "What is the city with the largest population?"
  • "How does that population compare to the average population of the cities in this map?"
  • "How many cities are within 30 miles of the Colorado River?"
  • "Show all cities in the state of California."
  • "List the top 5 rivers by length."
  • "Emphasize the largest river on the map."

The following are examples of the types of questions that fall outside the bounds of the data exploration agent and should therefore be avoided:

  • "What is the closest restaurant to me?" (the data exploration agent does not have access to the user's location, nor can it find the nearest feature from a location)
  • "What is the projected growth of Phoenix in the next 10 years?" (the data exploration agent can only answer questions about the data in the map, not external data or projections)
  • "Show me the population of cities in this map on a graph." (the data exploration agent can only provide answers in text form, not visualizations)

Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the out-of-the-box agents.

See also

Properties

PropertyAttributeType
reference-element
ArcgisMap | string | undefined

referenceElement

Property
Type
ArcgisMap | string | undefined

The reference element to the map that provides context for the data exploration agent. Currently, this is only scoped to arcgis-map elements. This provides the data exploration agent with the layers needed for answering user questions about the data in the map.

Setting this property is not necessary if you set the reference element on the parent arcgis-assistant component.

See also
Attribute
reference-element
Example
<arcgis-map id="my-map"></arcgis-map>
<arcgis-assistant>
<arcgis-assistant-data-exploration-agent reference-element="my-map"></arcgis-assistant-data-exploration-agent>
</arcgis-assistant>

Methods

MethodSignature
componentOnReady
inherited
componentOnReady(): Promise<this>

componentOnReady

inherited Method
Signature
componentOnReady (): Promise<this>
Inherited from: PublicLitElement

Creates a promise that resolves once the component is fully loaded.

Returns
Promise<this>
Example
const arcgisAssistantDataExplorationAgent = document.querySelector("arcgis-assistant-data-exploration-agent");
document.body.append(arcgisAssistantDataExplorationAgent);
await arcgisAssistantDataExplorationAgent.componentOnReady();
console.log("arcgis-assistant-data-exploration-agent is ready to go!");