Skip to content

This sample demonstrates how to use the Assistant component to build an agentic web mapping application. This component gives users the ability to interact with a map using natural language.

To work, the component requires at least one agent to be registered to it and a reference to a web map. This is done by adding one or more agent components as children of the Assistant component. Agent components are unrendered but provide specific capabilities to the assistant. In this sample, the Navigation Agent, Data Exploration Agent, and Help Agent are used to provide navigation, data exploration, and help capabilities to the user.

<arcgis-assistant
reference-element="#wheat-map"
heading="Change in wheat production 2017-2022"
description="Explore wheat production in the U.S. from 2017 to 2022."
entry-message="Hello! I'm here to help you explore changes in wheat production over the years.">
<arcgis-assistant-navigation-agent></arcgis-assistant-navigation-agent>
<arcgis-assistant-data-exploration-agent></arcgis-assistant-data-exploration-agent>
<arcgis-assistant-help-agent></arcgis-assistant-help-agent>
</arcgis-assistant>
<arcgis-map id="wheat-map" item-id="dd6e8957e7a94765bf32bc07097cbf46"></arcgis-map>

The agents provided in the SDK are pre-configured to work with web maps and layers. For a web map to be consumed by agents, its layers must first have good metadata and the map should have embeddings stored as an item resource. For more information on preparing your web maps and layers for use with the assistant, see the Web map setup guide for use in AI agents.

You can also create custom agents to provide additional or specialized capabilities to the assistant. For more information, see the Custom agents guide.