Ask a question in plain English — "Find 5 candidates in Austin with good demographics and low competition" — and a GPT-4.1 agent drives real spatial tools against ArcGIS Online, ArcGIS Places, and Placer AI to propose, score, and rank new Starbucks locations. The map updates live as the agent reasons.
Two processes: a FastAPI proxy that holds the secret keys (port 8082) and the static frontend (port 8083). Always start the proxy first.
In proxy/: python -m venv .venv →
.venv\Scripts\pip install -r requirements.txt →
copy .env.example to .env and fill in AZURE_API_KEY,
ARCGIS_API_KEY, and (optional) PLACER_API_KEY.
# from starbucks-signals/proxy .venv\Scripts\activate run.bat # uvicorn on http://127.0.0.1:8082
# from starbucks-signals/ serve.bat # python http.server on http://localhost:8083
You're already here — click Launch app above. The two top-right chips should go green (AGOL sign-in, Azure OpenAI proxy).
Paste any of these into the agent chat panel on the right side of the app.
Browser (:8083) ──► FastAPI proxy (:8082) ──► Azure OpenAI (GPT-4.1) index.html · app.html proxy/main.py via APIM app.js · tools.js holds AZURE_API_KEY tool-calling loop holds ARCGIS_API_KEY holds PLACER_API_KEY
Why the proxy? Three secrets — Azure OpenAI, ArcGIS Places, Placer AI — must never touch the browser. The proxy terminates CORS and injects keys server-side. AGOL spatial queries (FeatureLayers, drive-time, GeoEnrichment) still run client-side against a scoped AGOL token, so the map stays live as the agent works.
proxy/.env, which is gitignored.
Never inline it into HTML or JS, never commit it.
http://127.0.0.1:8082/api/health — it should return {"ok":true}.
upstream_error. The APIM key or URL in proxy/.env is wrong.
The proxy echoes Azure's error body into the response — check the chat UI or the proxy terminal.
app.html — assetsPath
must be https://js.arcgis.com/5.0/, not .../@arcgis/core/assets/.
radius_miles or lower n in your prompt.