kapyn
All postsA glowing network of connections wrapping a dark globe
Architecture

The AI tech stack for any product in 2026

A pragmatic blueprint — from frontend to LLM layer to observability — for building AI-powered products that ship, scale, and don't embarrass you.

Every builder eventually asks the same question: what do I actually wire together? The answer in 2026 is simpler than it looks. The ecosystem has converged on a short list of composable primitives — pick one from each layer and you're most of the way there.

This isn't a beginner tutorial. It's the blueprint experienced builders actually use, with honest notes on where each choice gets you and where it costs you. Here is the whole shape of it before we go layer by layer.

The five layers — frontend, data, LLM, deployment, and observability — and how a request flows through them.

Frontend

Next.js App Router is the de facto standard, and for an AI product the reasons compound. Vercel deploys it in seconds, edge caching absorbs most of your traffic, server components keep secrets on the server, and the AI SDK gives you token streaming with almost no plumbing. For UI, reach for Radix primitives under a custom theme rather than a heavy component library — you inherit correct, accessible behavior and keep full control of the look.

Stream early

An AI feature that streams tokens feels twice as fast as one that waits for the full response, even at identical total latency. Wire streaming in on day one — retrofitting it later touches every layer.

Backend & database

Supabase gives you Postgres, auth, storage, and pgvector in a single hosted product. That last piece is the one that matters for AI: your embeddings live in the same database as your rows, so retrieval is a SQL query, not a second system to operate. No separate vector database to provision, sync, and pay for.

sql
-- Retrieval is just SQL when embeddings live next to your data
select id, title, summary
from documents
order by embedding <=> $1   -- cosine distance to the query vector
limit 8;

For heavier ingestion — queues, rate limiting, background jobs — add Upstash (serverless Redis and Kafka). If you outgrow Supabase's Postgres or want a database-per-PR-branch workflow, Neon is the serverless Postgres to graduate to, with branching and zero cold start.

The AI & LLM layer

Route through OpenRouter unless you have a strong reason not to. One API gives you fallback across providers, unified billing, and access to every frontier model — which means a model outage or a price change is a config tweak, not an incident. For structured outputs and tool use, Claude consistently produces the most reliable JSON. For embeddings, text-embedding-3-small is fast and cheap enough for almost every use case.

Treat the model as a swappable dependency, not a foundation. The teams that move fastest are the ones who can change models without changing code.

Deployment & observability

Vercel handles deployment, so observability is the part most teams under-invest in — and then regret. Three tools answer the three questions you'll ask every week: did it ship, are people using it, and what broke?

  • PostHog — product analytics, funnels, feature flags, and session replay. Answers "are people using it?"
  • Sentry — error tracking with full stack traces. Answers "what broke?" before users tell you.
  • Axiom — serverless log ingestion at any scale, with structured queries and no ops overhead.

This stack isn't magic — it's the combination that eliminates the most decisions. You're not choosing between 30 databases; you're choosing between Supabase and Neon. Start with the defaults here. The moment you outgrow one, you'll know exactly why and exactly what to replace it with — and that clarity is worth more than any single tool on the list.

Find these on the Radar

Every tool here lives on Kapyn Radar. Save the ones that fit into a Loadout and find them again.

Open the Radar

Keep reading