FloatChat
Natural-Language Querying of Ocean Data
Ask the ocean a question in plain language and get a correct, auditable answer — backed by real ARGO float data. Built the AI backend: a RAG-over-schema pipeline that generates SQL via an LLM with a safety layer that validates every query before it runs.
System Architecture
RAG-over-schema NL→SQL architecture for the FloatChat ocean data system.
ARGO data schema
12,442 ocean-float profiles and 7.9 M measurements are indexed in PostgreSQL + PostGIS.
Schema-context retrieval
A RAG pipeline retrieves relevant table and column context for the user's natural-language question.
NL→SQL generation
An LLM generates SQL from the question and schema context, with an offline rule-engine fallback.
Query validation layer
sqlglot parsing, single-SELECT enforcement, table allow-list, read-only role, and statement timeouts.
Grounded response
The answer is grounded against returned rows, showing exact SQL and source float IDs for auditability.
Auditable natural-language answers over 12,442 ARGO float profiles.
Project Overview
FloatChat lets anyone query 12,442 real ARGO ocean-float profiles (7.9 M measurements) in plain language. The system translates natural-language questions into verified SQL against a PostgreSQL + PostGIS database of oceanographic observations.
I built the AI backend: a RAG-over-schema pipeline that retrieves table context and generates SQL via an LLM, with an offline rule-engine fallback for common query patterns. Every generated query passes through a safety layer — sqlglot parsing, single-SELECT enforcement, a table allow-list, a read-only database role, and statement timeouts — before execution.
Every answer is grounded against the returned rows and shows the exact SQL and source float IDs, making it fully auditable. The system supports five question types across five languages.
All 36 safety and accuracy tests pass, covering SQL injection attempts, schema boundary violations, multilingual queries, and edge-case float lookups.
Problem
Oceanographic data is locked behind domain-specific query languages and database schemas, making it inaccessible to non-technical researchers and decision-makers.
Solution
Built a RAG-over-schema NL→SQL pipeline with an LLM backend and a multi-layered query safety system, grounding every answer against the source data for full auditability.