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
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
| Source | Type | Details |
|---|---|---|
| UN/LOCODE | CSV download | 16,559 ports |
| Maritime RSS feeds | Web scraping | 92+ articles from 8 sources |
| Open-Meteo Marine API | REST API | 20 waypoints |
| UK Trade Tariff API | REST API | 40 HS codes |
| OFAC SDN List | Bulk download | 10,000+ entities |
| Frankfurter API (ECB) | REST API | 17 currencies |
| Neo4j seed data | Manual curation | 30 countries, 47 ports, 25 routes |
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health | Service health check |
| GET | /api/ports | List/search ports (16,559 worldwide) |
| GET | /api/ports/{unlocode} | Get port details by UNLOCODE |
| GET | /api/routes | Calculate maritime route (searoute/Dijkstra) |
| GET | /api/risk/zones | List active risk zones |
| GET | /api/risk/score | Composite risk score for a route |
| GET | /api/risk/chokepoints | Chokepoint status (10 major straits/canals) |
| GET | /api/tariffs | HS code tariff lookup |
| GET | /api/disruptions | Active maritime disruptions |
| GET | /api/viz/* | Pre-formatted visualization data |
| POST | /api/agent/query | AI agent query (JSON response) |
| POST | /api/agent/stream | AI agent query (SSE streaming) |