Google has announced the launch of Ask, a new AI assistant built directly into the Google Earth Engine (GEE) Code Editor. The feature is part of Google Earth AI, the company’s collection of geospatial models and datasets, and aims to cut down the time researchers, developers, and geospatial professionals spend memorizing API functions, digging through documentation, or debugging syntax and memory errors.
You can now write, debug, understand, and optimize geospatial queries without ever leaving the Code Editor, using Gemini capabilities through your own API key. The Ask panel sits on the right side of the editor, next to the Inspector, Console, and Tasks tabs, and its main advantage is that it doesn’t need extra explanations from you: it automatically pulls in the full text of your active script, your imported assets and geometries, and your current chat session history as context. That means more accurate, relevant answers, since the assistant already “knows” what data and code you’re working with, no copy-pasting required. Suggested changes can also be reviewed through a diff view before they’re inserted into your script.
Four ways to use Ask in your workflow
- Generate code from natural language: just describe what you need — say, loading Sentinel-2 imagery, applying a cloud mask, and calculating NDVI — and Ask will generate the matching JavaScript code, ready to insert or copy.
- Explain existing code: handy for understanding scripts inherited from colleagues or adapted from community examples, with a simple prompt like “explain what this script does.”
- One-click debugging: when a script throws an error, the Console now includes a “Troubleshoot” button that auto-fills the Ask panel with the error message and a request for a diagnosis.
- Query optimization: if you’re hitting timeout errors or “too many concurrent aggregations,” Ask can suggest best practices like early filtering, cutting down computation steps, or converting client-side loops into server-side operations.
At launch, you can choose between different Gemini models — Gemini 3 Flash Preview, Gemini 3.1 Pro Preview, and Gemini 3.5 Flash — depending on the task at hand, and enable extra tools like searching GEE’s official documentation, searching the dataset catalog, or Google Search (this last one is mutually exclusive with the other two).
The cost is on you
To use Ask, you need your own Gemini API key, obtained through Google AI Studio. There’s a free tier with usage limits, but if you use a paid-tier key, you’ll be billed for it separately from whatever Earth Engine plan you’re on. In other words, the AI processing cost isn’t bundled into GEE — it’s billed based on usage tracked against your own API key. Google lets you monitor usage and set monthly spending caps directly in the AI Studio interface, which is worth setting up to avoid billing surprises.
Worth noting: Google explicitly states the assistant is still learning and can occasionally give incorrect or unexpected answers. The official recommendation is to always review and test any code or suggestions before using them in real workflows.
Getting started takes just two steps: grab a Gemini API key from Google AI Studio, then add it to the Ask panel in the Code Editor by clicking the key icon in the chat input box.
Source: Google Earth and Earth Engine blog, official Google Earth Engine documentation.
