An AI agent for geospatial data analysis and visualization
Project description
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
pip install geoagent
With all optional dependencies:
pip install "geoagent[all]"
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:
# OpenAI (included by default)
export OPENAI_API_KEY="your-openai-key"
# Anthropic
export ANTHROPIC_API_KEY="your-anthropic-key"
# Google Gemini
export GOOGLE_API_KEY="your-google-key"
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:
from geoagent import GeoAgent
# Use the default provider (auto-detected)
agent = GeoAgent()
# Use a specific provider
agent = GeoAgent(provider="anthropic")
# Use a specific provider and model
agent = GeoAgent(provider="openai", model="gpt-4o-mini")
agent = GeoAgent(provider="google", model="gemini-2.5-flash")
Using Ollama (Local LLMs)
To run GeoAgent with a local LLM via Ollama, no API key is needed:
# Install Ollama and pull a model
ollama pull llama3.1
# Install the Ollama extra
pip install "geoagent[ollama]"
agent = GeoAgent(provider="ollama", model="llama3.1")
Using a Custom LLM Instance
You can pass any LangChain-compatible chat model directly:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o", temperature=0.0)
agent = GeoAgent(llm=llm)
Quick Start
from geoagent import GeoAgent
agent = GeoAgent()
result = agent.chat("Show NDVI for San Francisco in July 2024")
result.map # displays interactive map in Jupyter
print(result.code) # shows the generated Python code
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geoagent-0.1.0.tar.gz.
File metadata
- Download URL: geoagent-0.1.0.tar.gz
- Upload date:
- Size: 71.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e7416bf3353917293c2342494001e91c78dc22e266862a0e695685c68fb8839
|
|
| MD5 |
d0d3c93266b1cfc2525e8a6062cd031a
|
|
| BLAKE2b-256 |
06fa9a56ab6821a5dc8ea7f85f511f29bbe04afda8d370156508eb3b26029007
|
File details
Details for the file geoagent-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: geoagent-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bfc9bc50f0e6cac09041df4ba3196d5a8f123ffac7e008e04bc5ec149f2cb65
|
|
| MD5 |
bcffc3196bf0dd9b79739dccd6ebb8e6
|
|
| BLAKE2b-256 |
0384601d22b35bd8b698fd6a3ad3e23e98e194684b10f07267154becba58d8b5
|