Inspiration

I was reading about the Ever Given blocking the Suez Canal and how it took days for logistics teams to even understand the ripple effects across their shipments. Weather delays, port strikes, tariff changes, all these disruptions hit at once, and operators are stuck toggling between 10 different tabs trying to piece together what's happening. I thought: what if an AI agent could watch all of this in real time and just tell you what's going wrong and what to do about it?

What it does

NexusTower is an autonomous logistics control tower. You add your shipments, and it starts pulling live AIS vessel positions, weather forecasts from Open-Meteo, geopolitical disruption signals from GDELT, and tariff rates from World Bank WITS. An AI agent (Claude 3.5 Sonnet) continuously monitors everything and when it detects a risk, a storm on a shipping lane, a vessel slowing down suspiciously, a port strike, it alerts you and proposes concrete actions like rerouting. But it never acts alone. Every mutation goes through a human-in-the-loop approval flow with a full audit trail.

The same tool registry is exposed via MCP (Model Context Protocol), so external agents like Claude Desktop can plug into NexusTower and use its tools directly.

How we built it

The stack is Next.js 16 with React 19 on the frontend, Turso (libSQL) with Drizzle ORM for the database, and AWS Bedrock running Claude 3.5 Sonnet through the Vercel AI SDK v6. The map uses MapLibre GL with dark-themed tiles and SSE streaming for real-time vessel position updates. Authentication is handled by Clerk.

The core architecture is a single tool registry shared between the chat API and the MCP server. The agent has 12 tools, querying shipments, fetching AIS positions, checking weather, scanning GDELT for disruptions, computing GWP emissions, looking up tariffs, and proposing reroutes. Every tool call is logged to an immutable audit table.

I built the sustainability module to compute per-shipment CO2e using GLEC Framework v3 emission factors, which aligns with the Jan 2026 EU Digital Product Passport mandate. Each shipment gets a verifiable JSON-LD DPP endpoint.

Challenges we ran into

AI SDK v6 was genuinely painful. The API changed significantly from v5, maxSteps became stopWhen: stepCountIs(N), messages switched to a parts array instead of content, and the streaming response method changed completely. The docs were sparse and I spent hours debugging why tool calls weren't rendering correctly.

Getting real AIS data to work reliably was another challenge. Vessel positions come through a WebSocket from aisstream.io, and I had to build an SSE bridge to push updates to the browser without overwhelming the client. The map needed to handle markers appearing, moving, and disappearing smoothly.

The human-in-the-loop flow was tricky to get right. The agent proposes an action, but the execution has to be deferred until the operator explicitly approves it. This means the tool result is a "pending approval" state, not an actual execution, and a separate endpoint handles the actual mutation.

Accomplishments that we're proud of

The fact that you can sign up and immediately see a fully working logistics control tower with live vessel tracking, real weather data, actual geopolitical event scanning, and a functioning AI agent, all connected, all with real data, no mocks. Click a delayed shipment, see the exception, hit "Ask Agent", and it pulls live weather for that route and tells you what's happening.

The MCP integration is also something I'm proud of. The same 12 tools the chat agent uses are available to any external AI agent via a standard protocol. That's not a toy feature, it means NexusTower can be a node in a larger multi-agent system.

What we learned

Building with bleeding-edge frameworks (Next.js 16, AI SDK v6, React 19) means you're often the first person hitting certain bugs. I learned to read source code instead of waiting for docs. I also learned that the difference between a demo and a product is in the details, human-readable names instead of codes, auto-seeding data for new users, making every page actionable instead of just informational.

What's next for NexusTower

Real-time anomaly detection that automatically triggers when a vessel's speed drops below threshold, right now the agent analyzes on demand, but the infrastructure for continuous monitoring is already in the SSE pipeline. Multi-tenant support so logistics companies can onboard their actual fleet. And a mobile companion app for operators who need alerts on the go.

Built With

  • aws-bedrock
  • claude-3.5-sonnet
  • clerk
  • drizzle-orm
  • gdelt
  • maplibre-gl
  • mcp
  • next.js
  • open-meteo
  • react
  • sse
  • tailwind-css
  • turso
  • typescript
  • vercel-ai-sdk
  • world-bank-wits
Share this project:

Updates