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.
FloatChat AI follows a decoupled microservices-oriented architecture, strictly separating the presentation layer from the analytical backend, data pipelines, and AI inference engines.
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
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
- 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
- Framework: FastAPI, Uvicorn
- AI / LLMs: OpenAI, Google Generative AI (Gemini), Ollama (Local)
- RAG / Vectors: Qdrant Client, Sentence Transformers
- Database ORM: SQLAlchemy, Alembic
- Scientific Computing: Pandas, NumPy, Dask
- Geospatial & Format: NetCDF4, Xarray
- Ocean Standards: GSW (Gibbs SeaWater Oceanographic Toolbox)
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.
The platform is not vendor-locked. The Router_LLM subsystem dynamically routes inference requests based on user preference or load balancing requirements between:
- OpenAI (High reasoning, external API)
- Gemini (High context window, external API)
- Ollama (Local deployment, maximum data privacy)
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.
1. Clone the Repository
git clone https://github.com/abhijeetnardele24-hash/FloatChat-Ai.git
cd FloatChat-Ai2. 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.txt3. 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 80005. Frontend Setup (Node.js 20+)
cd ../ # Return to project root
npm install
npm run devThe application will be accessible at http://localhost:3000.
- Authentication: Stateless JWT verification via
python-joseand 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.
This software is licensed under the MIT License. See the LICENSE file in the root directory for more information.