Earth Agent is a Chrome extension that provides an AI-powered assistant for the Google Earth Engine Code Editor. It helps users interact with Google Earth Engine by generating code, selecting appropriate datasets, and analyzing map data.
- AI-powered chatbot interface to help with Earth Engine tasks
- Database selection from the Google Earth Engine catalog
- Code generation for maps and visualizations
- Code execution directly in the Earth Engine editor
- Error debugging to fix issues with generated code
- Data inspection to analyze points on the map
This project is currently in Phase 2 of development, which includes:
- ✅ Basic chat interface implementation
- ✅ Core agent framework with Planner
- ✅ Database Search tool to access GEE catalog
- ✅ Code Generation agent with basic functionality
- ✅ Content script integration with GEE code editor
Next steps (Phase 3):
- Full agent implementation (Code Debugger and Summarizer)
- Enhanced code execution and inspection
- RAG system for GEE API documentation
- Improved error handling
Earth Agent uses a multi-agent architecture powered by LangChain.js and LangGraph:
- Planner Agent: Analyzes user requests and determines if they can be accomplished with Google Earth Engine
- Database Selector Agent: Identifies relevant datasets from the Earth Engine catalog
- Code Generator Agent: Produces JavaScript code for the Earth Engine editor
- Content Script: Communicates with the Earth Engine page to run code and inspect results
earth-agent/
├── public/ # Static assets and manifest
├── src/
│ ├── background/ # Extension background script
│ ├── components/ # React components
│ ├── contentScript/ # Script injected into Earth Engine page
│ ├── lib/ # Core libraries
│ │ ├── agents/ # Agent system implementation
│ │ └── tools/ # Tools for agents
│ ├── popup/ # Extension popup
│ ├── sidepanel/ # Sidepanel interface
│ └── styles/ # CSS styles
├── package.json # Dependencies and scripts
└── vite.config.ts # Build configuration
- Clone the repository
- Install dependencies:
npm install - Start development server:
npm run dev - Build the extension:
npm run build
- Build the extension:
npm run build - Copy the manifest file to the dist directory:
copy public\manifest.json dist\ - Create placeholder icons in dist/icons/
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode"
- Click "Load unpacked" and select the
distdirectory
- Navigate to the Google Earth Engine Code Editor: https://code.earthengine.google.com/
- Click the Earth Agent icon in the toolbar
- Use the chat interface to ask Earth Agent to create maps or analyze data
- Click "Run Code" to execute generated code in the Earth Engine editor
- Vite.js for fast builds and development
- React for UI components
- TypeScript for type safety
- TailwindCSS for styling
- LangChain.js and LangGraph.js for agent development
MIT
- Your Name