AEGIS
ai

AEGIS

Maritime Shipping Risk Intelligence Platform

AEGIS (Automated Environmental & Geopolitical Intelligence for Shipping) is a production-grade data engineering platform that aggregates maritime intelligence from multiple sources, stores it across four database technologies, and exposes it to LLM-powered agents for intelligent decision making. The system monitors shipping risks, calculates optimal routes, checks trade compliance, and provides real-time analysis through a React dashboard with 3D globe visualization.

Architecture

                    +------------------+
                    |  React Frontend  |
                    |  (Vite + deck.gl)|
                    +--------+---------+
                             |
                             | REST / SSE
                             v
                    +------------------+
                    |   FastAPI (8080) |
                    |   7 API routes   |
                    +--------+---------+
                             |
          +------------------+------------------+
          |                  |                  |
 +--------v-------+ +-------v-------+ +--------v--------+
 | CrewAI Agents  | | MCP Server    | | RAG Pipeline    |
 | 3 agents       | | 9 tools       | | sentence-       |
 | 9 tools        | | 2 resources   | | transformers    |
 +--------+-------+ +-------+-------+ +--------+--------+
          |                  |                  |
 +--------v------------------v------------------v--------+
 |                    Data Layer                          |
 |  PostgreSQL/PostGIS | MongoDB | Neo4j | ChromaDB      |
 +-------------------------------------------------------+

Key Features

Polyglot persistence across 4 database technologies, each optimized for its domain
3 specialized CrewAI agents with 9 tool functions for maritime intelligence
SSE streaming for real-time tool call progress and agent reasoning visibility
Dynamic confidence scoring (0.05–0.99) based on tool success, data freshness, and coverage
Hallucination checking — numeric claims verified against tool outputs with 5% tolerance
W3C PROV-inspired data lineage tracking across all ingestion steps
16,559 ports indexed from UN/LOCODE with full geospatial metadata
RAG pipeline with sentence-transformers + ChromaDB for semantic news search

Agent System

Three specialized CrewAI agents orchestrate tool-based reasoning with full execution tracing persisted to MongoDB. The system uses intent detection for automatic tool selection and supports both JSON and SSE streaming responses.

  • Maritime Disruption Analyst — monitors news, weather, chokepoints, and risk zones
  • Maritime Route Planner — calculates routes, assesses risks, compares alternatives
  • Trade Compliance Officer — checks tariffs, sanctions screening (local-only), currency conversion

Data Ingestion Pipeline

A 7-step automated pipeline ingests data from diverse sources into the polyglot database layer. Each step is tracked with W3C PROV-inspired lineage recording, stored in both an append-only JSONL audit trail and a PostgreSQL data_lineage table.

  • UN/LOCODE port data → PostgreSQL (16,559 ports)
  • Maritime RSS feeds (8 sources) → MongoDB (92+ articles)
  • Open-Meteo Marine API → MongoDB (20 waypoints)
  • OFAC SDN sanctions list → PostgreSQL (10,000+ entities)
  • UK Trade Tariff API → PostgreSQL (40 HS codes)
  • Frankfurter API (ECB) → MongoDB (17 currencies)
  • Neo4j seed data → knowledge graph (30 countries, 47 ports, 25 routes)

Security & Privacy

The system is designed with data privacy as a first-class concern. Sanctions screening uses a local database only — no sensitive data is sent to external LLMs. The platform supports running with a local LLM via Ollama for zero data exfiltration scenarios.

Data Sources

SourceTypeDetails
UN/LOCODECSV download16,559 ports
Maritime RSS feedsWeb scraping92+ articles from 8 sources
Open-Meteo Marine APIREST API20 waypoints
UK Trade Tariff APIREST API40 HS codes
OFAC SDN ListBulk download10,000+ entities
Frankfurter API (ECB)REST API17 currencies
Neo4j seed dataManual curation30 countries, 47 ports, 25 routes

API Endpoints

MethodEndpointDescription
GET/api/healthService health check
GET/api/portsList/search ports (16,559 worldwide)
GET/api/ports/{unlocode}Get port details by UNLOCODE
GET/api/routesCalculate maritime route (searoute/Dijkstra)
GET/api/risk/zonesList active risk zones
GET/api/risk/scoreComposite risk score for a route
GET/api/risk/chokepointsChokepoint status (10 major straits/canals)
GET/api/tariffsHS code tariff lookup
GET/api/disruptionsActive maritime disruptions
GET/api/viz/*Pre-formatted visualization data
POST/api/agent/queryAI agent query (JSON response)
POST/api/agent/streamAI agent query (SSE streaming)

Tech Stack

FastAPI
React 19
CrewAI
PostgreSQL/PostGIS
MongoDB
Neo4j
ChromaDB
Docker
Groq/LiteLLM
sentence-transformers
deck.gl
react-globe.gl