GeoAgent¶
An AI agent for geospatial data analysis and visualization.
- Documentation: https://geoagent.gishub.org
- Source code: https://github.com/opengeos/GeoAgent
- PyPI: https://pypi.python.org/pypi/geoagent
Features¶
- Natural language interface for geospatial data workflows
- 4-agent LangGraph pipeline: Planner, Data, Analysis, Visualization
- Multi-LLM support (OpenAI, Anthropic, Google Gemini, Ollama)
- Multi-catalog STAC search (Earth Search, Planetary Computer, USGS, NASA CMR)
- Code transparency showing generated Python code at each step
- Jupyter-native with interactive MapLibre maps via leafmap
- DuckDB spatial SQL for GeoParquet and Overture Maps
- Raster analysis with xarray, rioxarray, and rasterio
- Vector operations with geopandas
Installation¶
1 | |
With all optional dependencies:
1 | |
LLM Setup¶
GeoAgent supports multiple LLM providers. You need at least one configured to use the agent.
Supported Providers¶
| Provider | Default Model | API Key Env Variable | Install Extra |
|---|---|---|---|
| OpenAI | gpt-4.1 |
OPENAI_API_KEY |
(included) |
| Anthropic | claude-sonnet-4-5-20250929 |
ANTHROPIC_API_KEY |
pip install "geoagent[llm]" |
| Google Gemini | gemini-2.5-flash |
GOOGLE_API_KEY |
pip install "geoagent[llm]" |
| Ollama (local) | llama3.1 |
(none needed) | pip install "geoagent[ollama]" |
Setting API Keys¶
Set your API key as an environment variable:
1 2 3 4 5 6 7 8 | |
You can also add these to a .env file or your shell profile (~/.bashrc, ~/.zshrc).
Choosing a Provider¶
By default, GeoAgent auto-detects available providers by checking environment variables in order: OpenAI → Anthropic → Google → Ollama. The first available provider is used.
To specify a provider and model explicitly:
1 2 3 4 5 6 7 8 9 10 11 | |
Using Ollama (Local LLMs)¶
To run GeoAgent with a local LLM via Ollama, no API key is needed:
1 2 3 4 5 | |
1 | |
Using a Custom LLM Instance¶
You can pass any LangChain-compatible chat model directly:
1 2 3 4 | |
Quick Start¶
1 2 3 4 5 6 | |
Web UI¶
GeoAgent includes a Solara-based chat interface with a persistent, interactive map.
1 2 | |
The UI opens on a home page — click Chat to start querying. See Web UI for full details.
Architecture¶
GeoAgent uses a 4-agent pipeline orchestrated by LangGraph:
- Planner parses natural language into structured parameters
- Data Agent searches STAC catalogs and retrieves geospatial data
- Analysis Agent computes indices and statistics with transparent code generation
- Visualization Agent renders results on interactive leafmap MapLibre maps
License¶
MIT