Skip to content

Repository files navigation

FloatChat AI Enterprise

Intelligent Oceanographic Argo Float Analysis and RAG Platform


1. Executive Summary

FloatChat AI is an enterprise-grade, highly scalable analytical platform designed for the querying, visualization, and interaction with global oceanographic Argo float data (BGC and Core). By integrating a multi-engine Large Language Model (LLM) orchestration layer with specialized Retrieval-Augmented Generation (RAG), FloatChat AI allows oceanographers, researchers, and data scientists to execute natural language queries against complex NetCDF datasets and spatial ocean parameters.

The platform bridges the gap between raw, distributed ocean data and interactive, human-readable insights through deterministic data processing modules and AI-driven synthesis.


2. Platform Architecture

FloatChat AI follows a decoupled microservices-oriented architecture, strictly separating the presentation layer from the analytical backend, data pipelines, and AI inference engines.

2.1 High-Level System Topology

graph TD
    subgraph ClientTier [Client Tier]
        UI[Next.js React Frontend]
        Viz[Chart.js / Recharts Engine]
        Map[Spatial Mapping Client]
    end

    subgraph APIGateway [API Gateway and Authentication]
        Auth[JWT Auth Layer]
        Router[FastAPI Routing Controller]
    end

    subgraph AIOrchestration [AI Orchestration Layer]
        RAG[Qdrant Vector DB / RAG]
        Router_LLM[LLM Routing Engine]
        Ollama[Ollama Local Engine]
        Gemini[Google Gemini API]
        OpenAI[OpenAI API]
    end

    subgraph DataPipeline [Data Processing Pipeline]
        Redis[Redis Cache]
        SQL[PostgreSQL Database]
        Xarray[Xarray / NetCDF4 Engine]
        GSW[GSW Oceanographic Tools]
    end

    UI <--> Router
    Viz <--> Router
    Map <--> Router

    Router <--> Auth
    Router <--> RAG
    Router <--> Redis
    Router <--> SQL
    Router <--> Xarray

    RAG <--> Router_LLM
    Router_LLM <--> Ollama
    Router_LLM <--> Gemini
    Router_LLM <--> OpenAI
    
    Xarray <--> GSW

    style ClientTier fill:#f8f9fa,stroke:#ced4da
    style APIGateway fill:#e9ecef,stroke:#ced4da
    style AIOrchestration fill:#e3f2fd,stroke:#90caf9
    style DataPipeline fill:#f1f8e9,stroke:#aed581
Loading

2.2 RAG and LLM Execution Flow

FloatChat implements a dynamic context-injection pattern. When a natural language query involves oceanographic context, the system vectorizes the query using Sentence Transformers, queries the Qdrant Vector Database, and structures an augmented prompt for the active LLM engine.

sequenceDiagram
    participant User
    participant NextJS as Frontend Client
    participant FastAPI as API Controller
    participant Qdrant as Vector Database
    participant LLM as Active AI Engine
    
    User->>NextJS: Submits Natural Language Query
    NextJS->>FastAPI: POST /api/chat/inference
    FastAPI->>Qdrant: Compute Query Embeddings and Retrieve Context
    Qdrant-->>FastAPI: Return Top-K Semantic Documents
    FastAPI->>FastAPI: Assemble Augmented Prompt Pipeline
    FastAPI->>LLM: Stream Execution Request
    LLM-->>FastAPI: Yield Token Streams
    FastAPI-->>NextJS: SSE Server-Sent Events Stream
    NextJS-->>User: Render Interactive Response
Loading

3. Technology Stack

3.1 Frontend (Presentation Layer)

  • Framework: Next.js 16 (React 19)
  • Styling: Tailwind CSS, Radix UI Primitives, Framer Motion
  • Data Visualization: Chart.js, Recharts
  • Content Rendering: React Markdown, Remark GFM

3.2 Backend (Application & AI Layer)

  • Framework: FastAPI, Uvicorn
  • AI / LLMs: OpenAI, Google Generative AI (Gemini), Ollama (Local)
  • RAG / Vectors: Qdrant Client, Sentence Transformers
  • Database ORM: SQLAlchemy, Alembic

3.3 Data Science & Oceanography (Processing Layer)

  • Scientific Computing: Pandas, NumPy, Dask
  • Geospatial & Format: NetCDF4, Xarray
  • Ocean Standards: GSW (Gibbs SeaWater Oceanographic Toolbox)

4. Core Subsystems

4.1 Argo Data Ingestion & Analysis

The backend operates a robust data pipeline utilizing xarray and netCDF4 to ingest distributed Argo float data. Computations such as Absolute Salinity, Conservative Temperature, and potential density are calculated deterministically via the gsw module before being cached in Redis.

4.2 Multi-Engine AI Controller

The platform is not vendor-locked. The Router_LLM subsystem dynamically routes inference requests based on user preference or load balancing requirements between:

  1. OpenAI (High reasoning, external API)
  2. Gemini (High context window, external API)
  3. Ollama (Local deployment, maximum data privacy)

4.3 Vector Retrieval System (RAG)

To ensure the LLM understands specialized oceanographic terminology and specific float configurations, FloatChat AI utilizes a Qdrant Vector Database. Documents (e.g., argo_basics.md, ocean_density.md) are embedded using Sentence Transformers and retrieved during the inference lifecycle.


5. Deployment & Configuration

5.1 Local Development Environment

1. Clone the Repository

git clone https://github.com/abhijeetnardele24-hash/FloatChat-Ai.git
cd FloatChat-Ai

2. Backend Setup (Python 3.10+)

cd backend
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
pip install -r requirements.txt

3. Configure Environment Variables Create a .env file in the backend/ directory:

POSTGRES_URL=postgresql://user:password@localhost:5432/floatchat
REDIS_URL=redis://localhost:6379/0
QDRANT_URL=http://localhost:6333
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIzaSy...

4. Initialize Databases

alembic upgrade head
python -m rag.ingest_corpus  # Seed the Qdrant Vector Database
uvicorn main:app --reload --port 8000

5. Frontend Setup (Node.js 20+)

cd ../  # Return to project root
npm install
npm run dev

The application will be accessible at http://localhost:3000.


6. Security and Compliance

  • Authentication: Stateless JWT verification via python-jose and bcrypt password hashing.
  • Data Privacy: Support for fully air-gapped local execution via Ollama and local Qdrant instances, ensuring no sensitive research data is transmitted to third-party APIs.
  • Input Validation: Strict Pydantic schemas enforce type safety and sanitize all incoming client requests.

7. License

This software is licensed under the MIT License. See the LICENSE file in the root directory for more information.

About

FloatChat AI is a highly scalable platform that allows researchers to use natural language to query and visualize global oceanographic Argo float data. It uses a Next.js frontend and a FastAPI Python backend, combining oceanographic tools (like Xarray and GSW) with a multi-engine AI system (OpenAI, Gemini, Ollama). By utilizing a Qdrant Vector Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages