{
  "$schema": "https://gismap.online/schemas/agent-recipe-v1.schema.json",
  "schemaVersion": 1,
  "id": "interactive-briefing",
  "title": "Interactive geographic briefing",
  "status": "available",
  "question": "Can an AI agent build a slide briefing with one map slide per area and context from another layer?",
  "answer": "Yes. A chatbot can write the whole briefing into one link: a map-v1 JSON with a briefing-v1 document in its briefing property, after #map=json:. The link opens presenting, as a desktop deck or a mobile swipe feed. In an open GISMap Online page, agents can also build, generate and export briefings through the in-page API, including relations to a context layer.",
  "triggers": [
    "Create slides about these districts",
    "Build an interactive crime briefing for Philadelphia",
    "Make a presentation with one slide per county"
  ],
  "inputTypes": [
    "ArcGIS FeatureServer polygon layer",
    "Supporting point or polygon layer"
  ],
  "inputs": {
    "required": [
      {
        "name": "primaryLayer",
        "description": "The layer whose features become slides."
      },
      {
        "name": "selection",
        "description": "Feature IDs, a filter, or 'all', plus the slide order."
      }
    ],
    "optional": [
      {
        "name": "contextLayer",
        "description": "A second layer shown and related per slide (spatialRel, distance)."
      },
      {
        "name": "narrative",
        "description": "Titles and text grounded in inspected data."
      },
      {
        "name": "skin",
        "description": "Presentation look."
      },
      {
        "name": "template",
        "description": "filter-series, timeline, grid-atlas or spatial-3d-chart for data-driven slides."
      }
    ]
  },
  "capabilities": [
    "briefing",
    "layers-arcgis",
    "query",
    "highlight"
  ],
  "engines": [
    "maplibre",
    "arcgis"
  ],
  "steps": [
    {
      "stage": "discover",
      "action": "Read llms.txt, this recipe and api/capabilities.json; note the engine and execution environment you actually have.",
      "interfaces": [
        "declarative-url"
      ],
      "references": [
        "https://gismap.online/llms.txt",
        "https://gismap.online/api/capabilities.json",
        "https://gismap.online/api/manifest.json"
      ]
    },
    {
      "stage": "inspect",
      "action": "Read the source metadata: geometry type, field names and types, spatial reference, extent, sentinels and query support. Query real values before filtering; never invent fields.",
      "interfaces": [
        "declarative-url",
        "standalone-js",
        "in-browser-api"
      ],
      "references": [
        "<layer URL>?f=pjson",
        "sources.inspect",
        "sources.detectSentinels",
        "layers.metadata"
      ]
    },
    {
      "stage": "plan",
      "action": "Pick stable feature IDs and the slide order. For context layers, decide the spatial relationship; an overlay alone is not evidence that points fall inside a polygon.",
      "interfaces": [
        "in-browser-api"
      ],
      "references": [
        "https://gismap.online/schemas/briefing-v1.schema.json",
        "briefing.create",
        "briefing.createSlide"
      ]
    },
    {
      "stage": "validate",
      "action": "Validate the document statically before loading it.",
      "interfaces": [
        "standalone-js",
        "in-browser-api"
      ],
      "references": [
        "briefing.validate",
        "briefing.migrate"
      ]
    },
    {
      "stage": "execute",
      "action": "Without code: put the briefing in map-v1 (\"briefing\": { layerId, selection, slides }) and write a #map=json: link; feature slides use the layer's OBJECTID as featureId. In an open page: load or generate the briefing. Slide layers with a relation query the context layer's service per slide, so counts come from the service, not from the drawing.",
      "interfaces": [
        "declarative-url",
        "in-browser-api"
      ],
      "references": [
        "briefing.load",
        "briefing.generate",
        "briefing.generateTemplate",
        "briefing.addSlide",
        "briefing.updateSlide"
      ]
    },
    {
      "stage": "verify",
      "action": "Step through every slide on desktop and in a narrow (mobile) viewport: selected feature, highlight, camera, context layer, narrative numbers. State whether counts are complete, filtered or sampled.",
      "interfaces": [
        "in-browser-api"
      ],
      "references": [
        "briefing.get",
        "describe"
      ]
    },
    {
      "stage": "share",
      "action": "Create the link, then reopen it. Optional PDF handout and QR card.",
      "interfaces": [
        "in-browser-api"
      ],
      "references": [
        "briefing.createLink",
        "briefing.exportPdf",
        "briefing.exportQrCard",
        "briefing.exportProject"
      ]
    }
  ],
  "artifact": {
    "type": "briefing",
    "schema": "https://gismap.online/schemas/briefing-v1.schema.json",
    "structure": "A briefing-v1 document: layerId, selection, ordered slides (template, camera, blocks, layers with relations, optional dataView/timeline/spatialChart), shared with the map's layers, styles and skin."
  },
  "outputs": [
    {
      "format": "Interactive briefing link (#briefing=)",
      "interface": "in-browser-api",
      "interactive": true,
      "reference": "briefing.createLink"
    },
    {
      "format": "Desktop deck and mobile swipe feed",
      "interface": "declarative-url",
      "interactive": true,
      "notes": "The same document; the layout follows the screen."
    },
    {
      "format": "PDF handout",
      "interface": "in-browser-api",
      "interactive": false,
      "reference": "briefing.exportPdf"
    },
    {
      "format": "QR card (PNG)",
      "interface": "in-browser-api",
      "interactive": false,
      "reference": "briefing.exportQrCard"
    },
    {
      "format": "Project file (.gis)",
      "interface": "in-browser-api",
      "interactive": true,
      "reference": "briefing.exportProject"
    }
  ],
  "verification": [
    "Slide count matches the request",
    "Each slide frames and highlights the intended feature",
    "Context layer loaded and related by a real spatial query",
    "Narrative numbers match queried values",
    "Desktop and mobile navigation work",
    "The shared link reopens to the same slides"
  ],
  "limitations": [
    "Readable #map=json: links hold 8,192 characters, enough for roughly ten short slides; longer briefings need the in-page API (briefing.createLink) or a hosted ?briefing= file.",
    "Links hold at most 60 slides and must fit the URL budget; large documents use ?briefing=<hosted JSON>.",
    "Data-driven templates sample at most 500 features (generateTemplate coverage is 'unknown')."
  ],
  "recovery": [
    "If a relation query fails, the slide notes it; show both layers and say the analysis is incomplete.",
    "If the link is too long, host the JSON and use ?briefing=<URL>, or export a .gis project."
  ],
  "examples": [
    {
      "checkedOn": "2026-10-21",
      "checkedVersion": "0.53.0",
      "title": "California grape counties, written by a chatbot",
      "prompt": "Make a four-slide briefing about California grape counties: a title, the totals, then Fresno and Napa.",
      "dataset": [
        {
          "label": "USDA Census of Agriculture 2022 grape production (Esri)",
          "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USDA_Census_of_Agriculture_2022_Grape_Production/FeatureServer/0"
        }
      ],
      "url": "https://gismap.online/#map=json:%7B%22version%22%3A1%2C%22title%22%3A%22California%20grape%20counties%22%2C%22basemap%22%3A%22gray-vector%22%2C%22legend%22%3Atrue%2C%22layers%22%3A%5B%7B%22url%22%3A%22https%3A%2F%2Fservices.arcgis.com%2FP3ePLMYs2RVChkJx%2Farcgis%2Frest%2Fservices%2FUSDA_Census_of_Agriculture_2022_Grape_Production%2FFeatureServer%2F0%22%2C%22type%22%3A%22feature%22%2C%22title%22%3A%22California%20grape%20acreage%20(USDA%202022)%22%2C%22where%22%3A%22STATE_ABBR%20%3D%20'CA'%20AND%20GRAPES_ACRES_BEAR_NON_BEAR_TOT%20%3E%201000%22%2C%22opacity%22%3A0.85%2C%22renderer%22%3A%7B%22type%22%3A%22choropleth%22%2C%22field%22%3A%22GRAPES_ACRES_BEAR_NON_BEAR_TOT%22%2C%22classes%22%3A5%2C%22method%22%3A%22quantile%22%2C%22ramp%22%3A%22purples%22%7D%7D%5D%2C%22briefing%22%3A%7B%22layerId%22%3A%22https%3A%2F%2Fservices.arcgis.com%2FP3ePLMYs2RVChkJx%2Farcgis%2Frest%2Fservices%2FUSDA_Census_of_Agriculture_2022_Grape_Production%2FFeatureServer%2F0%22%2C%22selection%22%3A%7B%22useAll%22%3Atrue%7D%2C%22slides%22%3A%5B%7B%22template%22%3A%22title%22%2C%22title%22%3A%22California%20grape%20country%22%2C%22subtitle%22%3A%22USDA%20Census%20of%20Agriculture%202022%22%7D%2C%7B%22template%22%3A%22key-numbers%22%2C%22title%22%3A%22At%20a%20glance%22%2C%22blocks%22%3A%5B%7B%22type%22%3A%22stat%22%2C%22stat%22%3A%22count%22%2C%22label%22%3A%22Counties%20over%201%2C000%20acres%22%7D%2C%7B%22type%22%3A%22stat%22%2C%22stat%22%3A%22sum%22%2C%22field%22%3A%22GRAPES_ACRES_BEAR_NON_BEAR_TOT%22%2C%22label%22%3A%22Grape%20acres%22%7D%5D%7D%2C%7B%22template%22%3A%22feature%22%2C%22title%22%3A%22Fresno%20County%22%2C%22featureId%22%3A%22212%22%2C%22fit%22%3A%22feature%22%2C%22blocks%22%3A%5B%7B%22type%22%3A%22facts%22%2C%22fields%22%3A%5B%22NAME%22%2C%22GRAPES_ACRES_BEAR_NON_BEAR_TOT%22%5D%7D%2C%7B%22type%22%3A%22text%22%2C%22markdown%22%3A%22The%20largest%20grape%20acreage%20in%20the%20state%3A%20160%2C324%20acres.%22%7D%5D%7D%2C%7B%22template%22%3A%22feature%22%2C%22title%22%3A%22Napa%20County%22%2C%22featureId%22%3A%22230%22%2C%22fit%22%3A%22feature%22%2C%22blocks%22%3A%5B%7B%22type%22%3A%22facts%22%2C%22fields%22%3A%5B%22NAME%22%2C%22GRAPES_ACRES_BEAR_NON_BEAR_TOT%22%5D%7D%2C%7B%22type%22%3A%22text%22%2C%22markdown%22%3A%2257%2C780%20acres%2C%20mostly%20wine%20grapes.%22%7D%5D%7D%5D%7D%7D",
      "spec": {
        "version": 1,
        "title": "California grape counties",
        "basemap": "gray-vector",
        "legend": true,
        "layers": [
          {
            "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USDA_Census_of_Agriculture_2022_Grape_Production/FeatureServer/0",
            "type": "feature",
            "title": "California grape acreage (USDA 2022)",
            "where": "STATE_ABBR = 'CA' AND GRAPES_ACRES_BEAR_NON_BEAR_TOT > 1000",
            "opacity": 0.85,
            "renderer": {
              "type": "choropleth",
              "field": "GRAPES_ACRES_BEAR_NON_BEAR_TOT",
              "classes": 5,
              "method": "quantile",
              "ramp": "purples"
            }
          }
        ],
        "briefing": {
          "layerId": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USDA_Census_of_Agriculture_2022_Grape_Production/FeatureServer/0",
          "selection": {
            "useAll": true
          },
          "slides": [
            {
              "template": "title",
              "title": "California grape country",
              "subtitle": "USDA Census of Agriculture 2022"
            },
            {
              "template": "key-numbers",
              "title": "At a glance",
              "blocks": [
                {
                  "type": "stat",
                  "stat": "count",
                  "label": "Counties over 1,000 acres"
                },
                {
                  "type": "stat",
                  "stat": "sum",
                  "field": "GRAPES_ACRES_BEAR_NON_BEAR_TOT",
                  "label": "Grape acres"
                }
              ]
            },
            {
              "template": "feature",
              "title": "Fresno County",
              "featureId": "212",
              "fit": "feature",
              "blocks": [
                {
                  "type": "facts",
                  "fields": [
                    "NAME",
                    "GRAPES_ACRES_BEAR_NON_BEAR_TOT"
                  ]
                },
                {
                  "type": "text",
                  "markdown": "The largest grape acreage in the state: 160,324 acres."
                }
              ]
            },
            {
              "template": "feature",
              "title": "Napa County",
              "featureId": "230",
              "fit": "feature",
              "blocks": [
                {
                  "type": "facts",
                  "fields": [
                    "NAME",
                    "GRAPES_ACRES_BEAR_NON_BEAR_TOT"
                  ]
                },
                {
                  "type": "text",
                  "markdown": "57,780 acres, mostly wine grapes."
                }
              ]
            }
          ]
        }
      },
      "status": "rendered",
      "checks": [
        "Written by hand as #map=json: with an inline briefing (no code).",
        "Opened headless: briefing mode, four slides in order, presenting from slide 1; no issues reported."
      ]
    },
    {
      "checkedOn": "2026-10-21",
      "checkedVersion": "0.53.0",
      "title": "Philadelphia police divisions and districts",
      "prompt": "Build a briefing with one slide per Philadelphia police division showing the districts inside it.",
      "dataset": [
        {
          "label": "Philadelphia Police Divisions and Districts (City of Philadelphia)",
          "url": "https://gismap.online/examples/ai/philadelphia-police-divisions/"
        }
      ],
      "url": "https://gismap.online/#briefing=zzVbbbts4EP0VgY-BLIuUqNubkThtFk7WiIsWi6IwKImyCOtikHRSN_B39b1ftkPZbm0r2Cx2gcIQbGo4M5w5hzOkXtATSrCNlihBqRS8EM0C2UiDOG0rkXHrRjwJJdpGwbSC6VIsyme2AakGqWFPYsE06Ac5k8uBl4MiQ8mL-fs8CKmDvTiMbS92Yuri4IuNvkFA4oQ2KlHiBW4XjPiOv7XRBHxe0NpE0XqlkuFQcfkEWSiHyWwhlJO19XDq8enk_i9FHj9el8s_vg5HMnt3NxtKrvRPh-G0FBXLebUqBZtfS1Hz-T1bzT_dTvDwljO9lnwGtlwOMaS8gZjFbhak5nX40uDSmxUHtRL1qjK2alOnbXWk4UqK2e3M8NBWLfh89ogdYhvjyPZ9IKBd60o0_NxlcuyCaWQffoRS8HoWuQbGsIMJhah6Ux15ziDZHG3P5m8P89tu6_DW_v3kkn8mV2kpMv1_yHXt7vm3vAbAaUhtHMVnvP4HTluUuE5It7DKCl5tlJrYCtRcdZUMdgBmkBNOSUYj01gckDFtltNCdxh34-v9tk4P2sA611s_vlt_ZrpNubQwtS3iksAgZTWXrOtA3mguj9vQpy6lIabevh89H0c-wXFAQtOYbVt3vemHrhe5BMOCJA486FTOcnMwJB4Fvzgi2AtCGoZRZNKvdg3shbBySKkXuq4fAz1p1WbLHRH7_dD8qzYHB5wUeftsCuFDya2arSxVts_Kuro6B3l15aDtF1O4ey6jLHAJz-JTLpd8M2jWNVChjhgdaYtZi4o1meG5n47SzKTTDQmUyLoxYsVSXr22Hyd5BF4RpZji0zx-Vfkhh-vpDUj7-Tvja1wKoU-s-7kVbNcWheBVbjRoOn68ux9_GD_C7M3dx_nD6H4Mr7P3o-l4PuHduT0r2YrP5yPJ2S_J6KDEu-yPN-IED8dZ5BZR-BaecQ8PuUg8RQyV6_n8LTwPfUDeRQLyA5_HLntzgx4-9QD5FwmooFlAo_Ssk_uAZj089CLxxHGYBRnN38TT36DgIgHBOQt3QHDWQpDE_nb6WXHgaSnNV8piTW6pdi3hG-FVCBVc-OgoKNzXS2O5G43h4fS9YZolvTsPTNfSqH_nJww2tJjHRsx8Rf0N",
      "page": "https://gismap.online/examples/ai/philadelphia-police-divisions/",
      "status": "loaded",
      "checks": [
        "Opened headless: both layers loaded and the deck started at slide 1 of 9.",
        "Per-slide highlight, mobile swipe and PDF were not rechecked in this pass.",
        "The spec's crime-incident example (crime points per district) is not yet published."
      ]
    }
  ],
  "lastTestedVersion": "0.53.0",
  "resultStatuses": [
    "prepared",
    "validated",
    "loaded",
    "rendered",
    "verified",
    "partial",
    "failed"
  ]
}
