Documentation

Event-driven AI with serverless databases

Build reactive AI data pipelines: ModelRiver generates structured data, your webhook writes directly to serverless databases, and the result is delivered in real time.

Overview

Serverless databases pair naturally with event-driven AI. ModelRiver generates structured data, delivers it via webhook, and your handler writes it directly to the database: no dedicated server infrastructure required.

The pattern:

  1. Your app sends an async AI request via /v1/ai/async
  2. ModelRiver generates structured output and delivers it to your webhook
  3. Your webhook handler writes the data to your serverless database
  4. Your handler calls back to ModelRiver with the enriched result (including database IDs, timestamps, etc.)
  5. ModelRiver pushes the final result to the connected frontend

Supported platforms

PlatformTypeHighlightsGuide
SupabasePostgres + BaaSRow-level security, real-time subscriptions, edge functionsView guide →
PlanetScaleMySQL-compatibleBranching, zero-downtime schema changes, Vitess engineView guide →
NeonServerless PostgresBranching, autoscaling, connection pooling, serverless driverView guide →
ConvexReactive databaseReal-time queries, server functions, automatic cachingView guide →

Common architecture

Frontend POST /v1/ai/async ModelRiver (AI)
Webhook delivery
Your webhook handler
Supabase PlanetScale Neon
(insert) (insert) (insert)
POST callback_url
(with database IDs)
ModelRiver WebSocket Frontend

Next steps