Architecture Ledger

A production-ready stack chosen for speed, control, and AI.

Every package was picked for a reason. This page breaks down each layer — runtime, data, AI, billing, and observability — along with the tradeoffs you should know before you ship.

LayerChoicesWhy this matters

Runtime & App

Bun + Next.js 16 + TypeScript

High throughput with modern App Router primitives and strict typing across boundaries.

Data & State

PostgreSQL 17 + Drizzle ORM + Redis

Durable relational core with type-safe access and low-latency caching/rate limiting.

AI Fabric

Vercel AI SDK + Groq/OpenAI

Provider flexibility, stream orchestration, and fast fallback options for reliability.

Memory & Retrieval

Qdrant + Neo4j

Vector similarity plus relationship modeling for richer context and long-horizon retrieval.

Ops & Async

BullMQ + Docker + OpenTelemetry

Background execution, reproducible environments, and traceable production behavior.

Monetization

Stripe + Better Auth

Secure subscription lifecycle and identity controls for usage-gated products.

Tradeoff

Vector + graph instead of vector only

Higher setup complexity, but stronger retrieval quality for connected knowledge domains.

Tradeoff

Bun runtime with standard tooling

Faster local loops while preserving compatibility with mature TypeScript workflows.

Tradeoff

Provider-agnostic AI routing

Slight orchestration overhead for better latency/cost control and failover safety.

Practical result

The stack is engineered so teams can keep momentum: reliable persistence, flexible model routing, and production instrumentation are solved together instead of patched in as separate projects.