Skip to main content

GeoAgent

image image

An AI agent for geospatial data analysis and visualization.

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

Web UI

GeoAgent includes a Solara-based chat interface with a persistent, interactive map.

pip install "geoagent[ui]"
geoagent ui

Or run directly:

solara run geoagent/ui/pages

Features:

  • Persistent map — layers accumulate across queries on the same interactive MapLibre map
  • Native widget rendering — full bidirectional map interaction (zoom, pan, click)
  • Chat interface — natural language queries with real-time status updates
  • Provider selection — switch between OpenAI, Anthropic, Google Gemini, or Ollama
  • Code transparency — toggle generated code display for reproducibility

You can also launch it programmatically:

from geoagent.ui import launch_ui

launch_ui()

Architecture

GeoAgent uses a 4-agent pipeline orchestrated by LangGraph:

  1. Planner parses natural language into structured parameters
  2. Data Agent searches STAC catalogs and retrieves geospatial data
  3. Analysis Agent computes indices and statistics with transparent code generation
  4. Visualization Agent renders results on interactive leafmap MapLibre maps

License

MIT

Metadata

Release files for GeoAgent 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GeoAgent 0.2.0
File Size Uploaded Provenance Actions
geoagent-0.2.0.tar.gz 81.0 kB Without provenance Details for geoagent-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for GeoAgent 0.2.0
File Interpreter ABI Platform Actions
geoagent-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for geoagent-0.2.0-py2.py3-none-any.whl

Total release size: 154.7 kB

Release files / geoagent-0.2.0.tar.gz

Download URL geoagent-0.2.0.tar.gz
Size 81.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aa17c704c842b7cd719f86a4fea289e0b4e8dfa66b2445612af9a991fca1f22d
BLAKE2b-256 checksum
How to use checksums
bf0ff5794269e80c2656cebd85a6db2d0d31565d5fdbdb96b2cde19692df7a3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / geoagent-0.2.0-py2.py3-none-any.whl

Download URL geoagent-0.2.0-py2.py3-none-any.whl
Size 73.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ee1c2a1ef36cf6fa0581e2d8ba888d586fcd3bd70a7bd903b89c113a69e673d0
BLAKE2b-256 checksum
How to use checksums
4f8cece8e9905ea250e08903c27d632fd5c7671f6a13e528e95a78e467f4abf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for GeoAgent 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page