AI-Powered Conversational Interface for ARGO Oceanographic Data
Float Chat is an intelligent chatbot that lets you explore ocean data from ARGO floats using natural language. Ask questions in plain English and get instant visualizations, charts, and insights about ocean temperature, salinity, and float trajectories.
- π€ Natural Language Queries - Ask questions like "Show floats in Indian Ocean" or "Compare temperature of floats 1902669 and 1902670"
- πΊοΈ Interactive Maps - Visualize float trajectories and locations with Folium
- π Dynamic Charts - Compare temperature, salinity, pressure, and depth profiles with Plotly
- πΎ Automated Data Pipeline - Download and ingest ARGO NetCDF files automatically
- π§ 3-Layer AI System - Intelligent query routing with Google Gemini 2.5 Flash
- π― Smart Query Understanding - Handles complex multi-step queries with AI orchestration
- π Real-time Analytics - SQL-based aggregations for statistical queries
- Python 3.11+
- PostgreSQL database
- Google Gemini API key
- Supabase account (optional, for vector search)
-
Clone the repository
git clone https://github.com/Achalnawal2745/floatchat.git cd floatchat -
Install dependencies
pip install -r requirements.txt
-
Configure environment
Create a
.envfile in the project root:DATABASE_URL=postgresql://user:password@localhost:5432/argo_db GEMINI_API_KEY=your_gemini_api_key_here SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key
-
Start the application
Windows:
start.bat
Linux/Mac:
# Terminal 1 - Backend python backend16.py # Terminal 2 - Frontend streamlit run app.py
-
Open your browser
Navigate to
http://localhost:8501
Try these natural language queries:
- "Show all floats in the Indian Ocean"
- "What's the temperature profile for float 2900565?"
- "Compare salinity between floats 1902669 and 1902670"
- "Show me the path of float 2900565"
- "How many floats are in the Arabian Sea?"
- "Average temperature at 100m depth for float 2900565"
Via Web Interface:
- Open the sidebar in the Streamlit app
- Navigate to "Admin Panel"
- Enter the float ID (e.g.,
2900565) - Click "Download & Ingest"
Via API:
# Download float data
curl -X POST http://127.0.0.1:8000/admin/download-float \
-H "Content-Type: application/json" \
-d '{"float_id": "2900565"}'
# Ingest into database
curl -X POST http://127.0.0.1:8000/admin/ingest-float \
-H "Content-Type: application/json" \
-d '{"float_id": "2900565"}'Float Chat uses a sophisticated 3-layer AI system:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Streamlit UI β
β (Chat Interface + Visualizations) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββ β
β β Layer 1 ββ β Layer 2 ββ β Layer 3 β β
β βDirect β βComplex β βSQL Generation β β
β βTool Call β βOrchestr. β β& Fallback β β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββ β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β β
ββββββββββββββββ ββββββββββββββββ
β PostgreSQL β β Gemini AI β
β Database β β (2.5 Flash) β
ββββββββββββββββ ββββββββββββββββ
- Layer 1: Direct tool execution for simple queries (e.g., "show float 2900565")
- Layer 2: AI orchestration for complex multi-step queries (e.g., "temperature of all floats in Indian Ocean")
- Layer 3: SQL generation for analytical queries (e.g., "average temperature at 100m depth")
float-chat/
βββ app.py # Streamlit frontend
βββ backend16.py # FastAPI backend with 3-layer AI system
βββ argo_ingestion.py # Data ingestion module
βββ download_floats.py # Float download utility
βββ ingest_floats.py # Batch ingestion script
βββ requirements.txt # Python dependencies
βββ start.bat # Windows startup script
βββ .env # Environment configuration
βββ README.md # This file
βββ QUICKSTART.md # Quick start guide
POST /query
Content-Type: application/json
{
"query": "show floats in indian ocean",
"session_id": "optional-session-id"
}POST /admin/download-float
POST /admin/ingest-float
GET /health
GET /floatsSee API Documentation for full details.
| Category | Technologies |
|---|---|
| Backend | FastAPI, Python 3.11+, asyncpg |
| Frontend | Streamlit, Folium, Plotly |
| Database | PostgreSQL, ChromaDB |
| AI | Google Gemini 2.5 Flash |
| Data Format | NetCDF4, ARGO float data |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- ARGO float data provided by the ARGO Program
- AI powered by Google Gemini
- Built with FastAPI and Streamlit
For questions, issues, or feature requests, please open an issue on GitHub.
Made with β€οΈ for ocean data exploration