How opendatalab/earth-agent works
Earth-Agent is an Earth-observation question-answering and evaluation framework. In the principal workflow, a user’s question and data are handled by a LangChain ReAct agent, which can call MCP tools for index, inversion, perception, and statistical analysis before returning an answer. The repository also evaluates final answers and tool-use trajectories, and provides a training-free GRPO workflow that rolls out agents, verifies answers, and distills experiences into an enhanced prompt. The graph reflects documented capabilities and shown calls; unsampled integrations are not inferred.
Main entry points: langchain_gpt_enhanced.py ReAct agent · rollout_manager.py Agent rollouts · training_free_grpo.py GRPO orchestrator · utils.py Raster helpers
Components 21
Agent runtime
- ReAct agent
langchain_gpt_enhanced.py - Agent configuration
config_utils.py - Agent answer
langchain_gpt_enhanced.py
EO toolkits
- Index analysis
agent/tools/Index.py - Spectral inversion
agent/tools/Inversion.py - EO perception
agent/tools/Perception.py - Spatial analysis
agent/tools/Analysis.py - Raster statistics
agent/tools/Statistics.py - Raster helpers
agent/tools/utils.py
Evaluation workflow
- Tool extraction
process/extract_tool_Model.py - Answer polishing
process/polish_answer.py - End-to-end metrics
evaluate/end_to_end.py - Trajectory metrics
evaluate/step_by_step.py
Training-free GRPO
- GRPO orchestrator
training_free_grpo/training_free_grpo.py - GRPO configuration
training_free_grpo/config.py - Dataset manager
training_free_grpo/data_manager.py - Agent rollouts
training_free_grpo/rollout_manager.py - Answer verifier
training_free_grpo/verify/earth_science_enhanced.py - Experience updater
training_free_grpo/experience_updater.py - Enhanced prompt
training_free_grpo/training_free_grpo.py
Other components
- Questioner
Connections 30
- Questioner → ReAct agent: asks
- ReAct agent → Agent configuration: loads config
langchain_gpt_enhanced.py - ReAct agent → Index analysis: calls tools
- ReAct agent → Spectral inversion: calls tools
- ReAct agent → EO perception: calls tools
- ReAct agent → Spatial analysis: calls tools
- ReAct agent → Raster statistics: calls tools
- Index analysis → Raster helpers: reads rasters
agent/tools/Index.py - Spectral inversion → Raster helpers: reads rasters
agent/tools/Inversion.py - EO perception → Raster helpers: reads rasters
agent/tools/Perception.py - Spatial analysis → Raster helpers: uses helpers
agent/tools/Analysis.py - Raster statistics → Raster helpers: reads rasters
agent/tools/Statistics.py - ReAct agent → Agent answer: returns answer
langchain_gpt_enhanced.py - Agent answer → Tool extraction: extracts tool calls
- Agent answer → Answer polishing: polishes result
- Tool extraction → Trajectory metrics: supplies tool data
- Agent answer → End-to-end metrics: scores final answer
- Questioner → GRPO orchestrator: starts evolution
- GRPO orchestrator → GRPO configuration: uses settings
training_free_grpo/training_free_grpo.py - GRPO orchestrator → Dataset manager: loads samples
training_free_grpo/training_free_grpo.py - GRPO orchestrator → Agent rollouts: runs batches
training_free_grpo/training_free_grpo.py - Agent rollouts → Dataset manager: gets and updates samples
training_free_grpo/rollout_manager.py - GRPO orchestrator → Answer verifier: verifies responses
training_free_grpo/training_free_grpo.py - GRPO orchestrator → Experience updater: updates experiences
training_free_grpo/training_free_grpo.py - Experience updater → Enhanced prompt: distills prompt
training_free_grpo/training_free_grpo.py - Agent rollouts → Index analysis: loads MCP tools
- Agent rollouts → Spectral inversion: loads MCP tools
- Agent rollouts → EO perception: loads MCP tools
- Agent rollouts → Spatial analysis: loads MCP tools
- Agent rollouts → Raster statistics: loads MCP tools