Skip to content

ahermangesh/FloatChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FloatChat - AI-Powered Conversational Interface for ARGO Ocean Data

SIH 25 Problem Statement ID: 25040
Organization: Ministry of Earth Sciences (MoES) - Indian National Centre for Ocean Information Services (INCOIS)

Python FastAPI License Code Style

๐ŸŒŠ Overview

FloatChat is an enterprise-grade AI-powered conversational system that democratizes access to ARGO oceanographic data through natural language processing and voice interaction. Users can explore complex ocean datasets through intuitive conversations in multiple languages (English/Hindi).

Key Features

  • ๐Ÿค– AI-Powered Chat: Natural language queries using Google Gemini Studio API
  • ๐ŸŽค Voice Interface: Multilingual voice input/output with real-time processing
  • ๐Ÿ—บ๏ธ Interactive Visualizations: Geospatial maps and scientific charts
  • ๐Ÿ“Š 6-Year Dataset: 2,056 NetCDF files (9.77GB) from 2020-2025
  • ๐Ÿ” RAG Pipeline: Vector similarity search with FAISS/ChromaDB
  • ๐ŸŒ Multilingual: Support for English, Hindi, and regional languages
  • ๐Ÿ“ˆ Real-time Analytics: Temporal trend analysis and pattern recognition

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.11+
  • PostgreSQL 15+ with PostGIS
  • Redis 6+
  • Docker & Docker Compose

Installation

  1. Clone the repository
git clone https://github.com/your-org/floatchat.git
cd floatchat
  1. Set up virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
# venv\Scripts\activate   # Windows
  1. Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt  # For development
  1. Configure environment
cp env.example .env
# Edit .env with your API keys and database credentials
  1. Start services
docker-compose up -d postgres redis
  1. Initialize database
python scripts/init_database.py
python scripts/load_sample_data.py
  1. Run the application
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
  1. Access the application

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         FloatChat System                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Frontend Layer (Streamlit/Dash)                               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   Voice UI      โ”‚  โ”‚   Chat Widget   โ”‚  โ”‚  Visualization  โ”‚ โ”‚
โ”‚  โ”‚  - Microphone   โ”‚  โ”‚  - Text Input   โ”‚  โ”‚  - Maps         โ”‚ โ”‚
โ”‚  โ”‚  - Speaker      โ”‚  โ”‚  - History      โ”‚  โ”‚  - Charts       โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  API Gateway Layer (FastAPI)                                   โ”‚
โ”‚  /api/chat | /api/voice/* | /api/floats | /api/visualize       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  AI Processing Layer                                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Speech Engine  โ”‚  โ”‚   Gemini LLM    โ”‚  โ”‚   RAG Pipeline  โ”‚ โ”‚
โ”‚  โ”‚  - STT/TTS      โ”‚  โ”‚  - Query Parse  โ”‚  โ”‚  - Vector DB    โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Data Layer                                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   PostgreSQL    โ”‚  โ”‚   Vector DB     โ”‚  โ”‚   ARGO Data     โ”‚ โ”‚
โ”‚  โ”‚  + PostGIS      โ”‚  โ”‚  FAISS/Chroma   โ”‚  โ”‚   2,056 Files   โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Dataset

ARGO Float Data (2020-2025)

  • Files: 2,056 NetCDF files
  • Size: 9.77 GB
  • Coverage: Daily ocean profiles
  • Parameters: Temperature, Salinity, Pressure, BGC data
  • Regions: Focus on Indian Ocean with global coverage

Example Queries

  • "Show me temperature trends in Arabian Sea over the last 3 years"
  • "Compare salinity patterns between 2020 and 2024 monsoon seasons"
  • "เคฎเฅเคเฅ‡ เคฌเค‚เค—เคพเคฒ เค•เฅ€ เค–เคพเคกเคผเฅ€ เคฎเฅ‡เค‚ เคคเคพเคชเคฎเคพเคจ เคชเฅเคฐเฅ‹เคซเคพเค‡เคฒ เคฆเคฟเค–เคพเค“" (Hindi)
  • "What were ocean conditions during Cyclone Amphan in 2020?"

๐Ÿ› ๏ธ Development

Project Structure

floatchat/
โ”œโ”€โ”€ app/                          # Main application code
โ”‚   โ”œโ”€โ”€ main.py                   # FastAPI app entry point
โ”‚   โ”œโ”€โ”€ core/                     # Core configuration
โ”‚   โ”œโ”€โ”€ api/                      # API routes
โ”‚   โ”œโ”€โ”€ services/                 # Business logic
โ”‚   โ”œโ”€โ”€ models/                   # Data models
โ”‚   โ””โ”€โ”€ utils/                    # Utilities
โ”œโ”€โ”€ frontend/                     # Frontend application
โ”œโ”€โ”€ data/                         # Data storage
โ”œโ”€โ”€ scripts/                      # Utility scripts
โ”œโ”€โ”€ tests/                        # Test suite
โ”œโ”€โ”€ docs/                         # Documentation
โ”œโ”€โ”€ docker/                       # Docker configurations
โ””โ”€โ”€ .github/                      # CI/CD workflows

Development Commands

# Run tests
pytest tests/ -v --cov=app

# Code formatting
black app/ tests/
isort app/ tests/

# Linting
flake8 app/ tests/
mypy app/

# Security scan
bandit -r app/
safety check

# Start development server
uvicorn app.main:app --reload

# Database migrations
alembic upgrade head

# Load test data
python scripts/load_sample_data.py

API Endpoints

Chat & Conversation

  • POST /api/v1/chat/query - Process natural language queries
  • GET /api/v1/chat/history - Retrieve conversation history
  • POST /api/v1/chat/feedback - Submit user feedback

Voice Processing

  • POST /api/v1/voice/transcribe - Speech-to-text conversion
  • POST /api/v1/voice/synthesize - Text-to-speech generation
  • GET /api/v1/voice/languages - Supported languages

ARGO Float Data

  • GET /api/v1/floats/search - Search floats by criteria
  • GET /api/v1/floats/{float_id} - Get specific float data
  • GET /api/v1/floats/{float_id}/profiles - Get float profiles

Data Visualization

  • POST /api/v1/visualize/map - Generate map visualizations
  • POST /api/v1/visualize/profile - Create profile plots
  • POST /api/v1/visualize/timeseries - Time-series charts

๐Ÿงช Testing

Test Categories

  • Unit Tests: Fast, isolated component tests
  • Integration Tests: Component interaction tests
  • E2E Tests: End-to-end workflow validation
  • Performance Tests: Load and stress testing

Running Tests

# All tests
pytest

# Specific test category
pytest tests/unit/
pytest tests/integration/
pytest tests/e2e/

# With coverage
pytest --cov=app --cov-report=html

# Performance tests
pytest tests/performance/ -v

๐Ÿš€ Deployment

Docker Deployment

# Build and run
docker-compose up -d

# Scale services
docker-compose up -d --scale app=3

# View logs
docker-compose logs -f app

Production Deployment

# Build production image
docker build -t floatchat:latest .

# Deploy to Railway/Render
# See deployment documentation in docs/deployment/

๐Ÿ“š Documentation

๐Ÿ”’ Security

  • JWT-based authentication
  • API rate limiting
  • Input validation and sanitization
  • HTTPS enforcement
  • Security headers (CSP, HSTS, etc.)
  • SQL injection prevention

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • INCOIS for oceanographic data and domain expertise
  • ARGO Program for global ocean observation data
  • Google Gemini for AI/LLM capabilities
  • Open Source Community for excellent tools and libraries

๐Ÿ“ž Support


Built with โค๏ธ for the oceanographic community and Smart India Hackathon 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors