An intelligent oceanographic data exploration platform combining natural language AI with interactive geospatial visualization of ARGO float profiles from the Indian Ocean.
FloatChat is a Dash-based web application that provides:
- 🤖 AI Chat Interface: Ask natural language questions about ARGO float data and get intelligent responses
- 🗺️ Interactive Map: Visualize float trajectories and profile locations with temperature color-coding
- 📊 Profile Inspector: View detailed T/S (temperature-salinity) diagrams, BGC parameters, and depth profiles
- 🌊 Oceanographic Data: Access ARGO float profiles including temperature, salinity, dissolved oxygen, chlorophyll-a, and other biogeochemical parameters
Left Sidebar Center Panel Right Panel
(Chat + Floats) (Interactive Map) (Profile Charts)
↓ ↓ ↓
User Query → AI Agent (LLM + MCP Tools) → PostgreSQL Database
↑ ↓
└──────────────────────┴──────────────────────┘
Response & Visualizations
- Frontend: Dash/Plotly for responsive UI with dark ocean theme
- Backend: Python async application with LangChain 1.x and LangGraph
- Database: PostgreSQL with ARGO float profiles, observations, and computed aggregates
- AI/LLM: OpenAI GPT-4o with Model Context Protocol (MCP) for database access
- Visualization: Plotly for maps, charts, and interactive exploration
cd FloatChat
python -m venv .venv
.venv\Scripts\activate # Windows
# or
source .venv/bin/activate # Linux/Macpip install -r requirements.txtCopy env.example to .env and fill in your values:
cp env.example .envEdit .env with:
# Database
DB_NAME=floatchat
DB_USER=postgres
DB_PASS=your_postgres_password
DB_HOST=localhost
DB_PORT=5432
# OpenAI API
OPENAI_API_KEY=sk-...your-key-here...
# Python path (optional, defaults to 'python')
PYTHON_PATH=pythonEnsure PostgreSQL is running and load the schema:
psql -U postgres -d floatchat -f schema.sqlLoad ARGO data:
python argo_etl.py --dir data/argo/incois/FLOAT_ID/profiles/python app.pyThe dashboard will be available at: http://localhost:8050
Ask natural language questions about ARGO data:
- "Show salinity profiles near 12°N 72°E"
- "List all floats from INCOIS with over 50 profiles"
- "What's the maximum temperature in the Arabian Sea?"
- "Compare BGC parameters between different floats"
The AI agent uses database tools to execute queries and return real data.
- Click profiles on the map to select and inspect them
- Filter by date using the dropdown (Last 30/90/180 days, or all time)
- Hover over markers to see float ID, date, and max temperature
- View float trajectories when a float is selected (highlighted in cyan)
When a profile is selected:
- T/S Chart: Temperature vs Salinity depth profile with dual axes
- BGC Chart: Dissolved oxygen, chlorophyll-a, and nitrate concentrations
- T–S Diagram: Temperature-salinity scatter plot for water mass identification
- Stats: Maximum temperature, average salinity, and maximum depth
FloatChat/
├── app.py # Main Dash application
├── postgres_mcp.py # MCP server for database access
├── argo_etl.py # ETL script for loading ARGO data
├── download_argo.py # Script to download ARGO data
├── schema.sql # PostgreSQL schema
├── requirements.txt # Python dependencies
├── env.example # Environment template
├── README.md # This file
├── data/
│ └── argo/
│ └── incois/ # ARGO profiles (NetCDF format)
│ └── 2902115/
│ └── profiles/
│ ├── BD2902115_001.nc
│ ├── BD2902115_002.nc
│ └── ...
└── __pycache__/
wmo_id: World Meteorological Organization ID (primary key)platform_type: Type of float platformdac: Data Assembly Centerproject_name: Associated projectpi_name: Principal investigator
profile_id: Unique profile identifierwmo_id: Float WMO ID (foreign key)cycle_number: Cycle number for this floatdirection: Ascending or descending profilelatitude,longitude: Locationdate_utc: Profile timestampdata_mode: Real-time or delayed-mode
obs_id: Observation IDprofile_id: Profile ID (foreign key)pres: Pressure (dbar)temp: Temperature (°C)psal: Practical salinity (PSU)doxy: Dissolved oxygen (μmol/kg)chla: Chlorophyll-a (mg/m³)nitrate: Nitrate (μmol/kg)bbp700: Backscatter at 700nm
Materialized view with aggregated statistics per profile:
- Count of observations
- Temperature/salinity extremes
- Presence of BGC parameters
Edit color palette in app.py:
OCEAN_DARK = "#040d1a"
OCEAN_MID = "#071a2e"
OCEAN_CARD = "#0a2240"
ACCENT_CYAN = "#00d4ff"
ACCENT_WARM = "#f0a500"Modify SYSTEM_PROMPT in app.py to change agent behavior and capabilities.
Change mapbox=dict(style="carto-darkmatter", ...) to other Mapbox styles (e.g., "streets-v11", "satellite-v9").
This usually indicates an issue with MCP tool loading or database connection:
- Check
.envfile is properly configured - Verify PostgreSQL is running:
psql -U postgres -c "SELECT 1" - Check database exists:
psql -l | grep floatchat - Review terminal output for detailed error messages
- Verify data is loaded:
psql -U postgres -d floatchat -c "SELECT COUNT(*) FROM profiles" - Check profiles have valid coordinates:
SELECT COUNT(*) FROM profiles WHERE latitude IS NOT NULL - Ensure profile_summary view exists:
psql -U postgres -d floatchat -c "SELECT * FROM profile_summary LIMIT 1"
- Check database indexes: PostgreSQL should auto-index foreign keys
- Limit data range using date filter
- Monitor PostgreSQL performance:
SELECT * FROM pg_stat_statements
- Framework: Dash (Python web framework)
- Visualization: Plotly
- Database: PostgreSQL with psycopg2
- LLM: OpenAI GPT-4o
- Agent Framework: LangChain + LangGraph
- Async Support: nest_asyncio
- DB Access: Model Context Protocol (MCP) via langchain-mcp-adapters
| Variable | Description | Default | Required |
|---|---|---|---|
DB_NAME |
PostgreSQL database name | floatchat |
✓ |
DB_USER |
PostgreSQL user | postgres |
✓ |
DB_PASS |
PostgreSQL password | `` | ✓ |
DB_HOST |
PostgreSQL host | localhost |
✓ |
DB_PORT |
PostgreSQL port | 5432 |
|
OPENAI_API_KEY |
OpenAI API key | ✓ | |
PYTHON_PATH |
Python executable path | python |
- Data Loading: Use date filter to reduce initial map load
- Queries: Ask specific questions (e.g., "floats in Bay of Bengal" vs "all floats")
- Database: Add indexes on commonly filtered columns (date_utc, latitude, longitude)
- Caching: Consider Redis for frequently accessed queries
To extend FloatChat:
- Add new chat capabilities in
SYSTEM_PROMPT - Create new PostgreSQL tools in
postgres_mcp.py - Add new chart types in
build_*_chart()functions - Modify styling via
STYLESdictionary and color palette
General Public License
For questions about the ARGO program, visit: https://www.goaargo.ucsd.edu/
- ARGO float data from international oceanographic centers
- INCOIS (Indian National Centre for Ocean Information Services) for regional deployment
- OpenAI for GPT-4o language model