// infrastructure stack

A layered reference for building production AI infrastructure. Each tier adds complexity, operational overhead, and architectural surface area. Start at the top and expand downward as your system grows. Every layer includes technology options with production-readiness signals — not popularity contests.

L1

Static Site / Frontend

details

Problem it solves: getting content to users — rendering, performance, SEO. Need it when: every web presence needs a frontend; static-first covers blogs, docs, and marketing sites with no servers to maintain. Skip it and: there is no site; over-build it (SPA/SSR for read-only content) and you pay complexity with no user-visible gain.

Astro

Content-first static site generator. Islands architecture, zero JS by default. Best for blogs, docs, marketing sites.

UsedFree⭐61kTypeScriptContent

Cloudflare Pages

Global edge deployment, free tier, automatic HTTPS, instant rollback. Pairs with Astro natively.

UsedFree tierManagedEdgeCDN

Next.js / Remix

Full-stack React frameworks. SSR, API routes, middleware. More complexity, more capability.

Free⭐141kReactSSRNode

SvelteKit

Lightweight framework, less boilerplate. Growing ecosystem. Good for interactive apps with less JS overhead.

Free⭐21kSvelteLightweight

VitePress

Vue-powered SSG built on Vite. Markdown-first, fast HMR, built-in search. Spiritual successor to VuePress. From the official Vue.js org.

Free⭐18kVueDocsMarkdown

Eleventy (11ty)

Simpler SSG with zero framework lock-in. Supports 10+ template languages, data cascade, zero client JS by default. 19.9M+ npm downloads, 88K+ GitHub repos. v3.1.5 (March 2026).

Free⭐20kNodeContentZero-JS
L2

Data / Storage

details

Problem it solves: persisting anything that must survive a restart or deploy — content, users, files, analytics. Need it when: state outlives a single request. Skip it and: data lives in memory or scattered files — lost on restart, unqueryable, unbackupable.

SQLite

Embedded, zero-config, single-file. Ideal for single-server apps, local dev, Ghost CMS. Scales to medium traffic.

UsedFree⭐10kSelf-HostEmbeddedSQL

PostgreSQL

Production relational database. Extensions, JSONB, full-text search. Standard choice when you outgrow SQLite.

Free⭐22kSelf-HostRelationalACIDExtensions

R2 Object Storage

S3-compatible, no egress fees. Images, assets, backups. Integrated with Cloudflare ecosystem.

UsedFree tierManagedS3Edge

Redis / KV

In-memory cache, session store, rate limiting, pub/sub. Cloudflare KV for edge-cached key-value.

Free⭐76kSelf-HostCacheIn-Memory

Turso / libSQL

Edge-distributed SQLite. Embedded Replicas for local reads, global writes. Database-per-user architecture with vector search. Rust-based, SQLite-compatible.

Free tier⭐17kBothEdgeRustSQL

DuckDB

In-process analytical SQL database. Reads Parquet, CSV, JSON natively. Vectorized execution, columnar storage. 37.5K+ stars, replacing Pandas for large-scale analysis. DuckLake extension for SQL-as-lakehouse.

Free⭐38kSelf-HostC++AnalyticsParquet

SurrealDB

Multi-model database in Rust — documents, graphs, relational, time-series, and vectors in one engine with SurrealQL. Combines database, query, API, and auth layers with granular row-level permissions. $23M raised (Feb 2026) for AI-native workloads; positioned as an agent memory layer.

Free⭐33kBothRustMulti-ModelVector
L3

Authentication / Identity

details

Problem it solves: establishing who your users are and what they may access. Need it when: gated content, paid subscriptions, user-specific data, or admin surfaces. Skip it and: you can launch — but retrofitting identity onto a live system with existing user data is one of the most painful migrations in software.

Clerk

Managed auth, MFA, social providers, organization management. Generous free tier, embeddable components.

Free tierManaged⭐1.7kMFAReact

Auth.js / NextAuth

Open-source auth for any framework. 70+ providers, database adapters, JWT/session. Self-hostable.

Free⭐28kSelf-HostOpen Source

Supabase Auth

Built on PostgreSQL Row-Level Security. Free tier, integrates with Supabase DB, realtime, storage.

Free tierManaged⭐107kPostgresRLS

Zitadel

Self-hosted identity platform. OIDC, SAML, LDAP, custom domains, audit logs. Enterprise-grade, open-source.

Free⭐14kBothOIDCEnterprise

Hanko

Passkey-first auth platform. FIDO2-certified, Go backend, embeddable web components for login/signup/user profiles. Self-hostable or managed cloud. Open-source alternative to Auth0/Clerk.

Free⭐9kBothGoPasskeysFIDO2

Ory Kratos

Headless cloud-native identity server in Go. Passkeys, OIDC, SAML, MFA, social sign-in, magic links via clean API. Runs self-hosted or on Ory Network. 10K+ customers incl. Salesforce, SAP, Adobe; $22.5M raised.

Free⭐14kBothGoOIDCHeadless

WorkOS

Enterprise auth platform. SAML/OIDC SSO, SCIM directory sync, audit logs, plus AuthKit managed login UI — free up to 1M MAU. $100M Series C at $2B valuation; used by Webflow, Vercel, Brex, Loom.

Free tierManaged⭐3.3kTypeScriptSSOSCIM
L4

Backend / API Services

details

Problem it solves: running server-side logic that can't live in the browser — business rules, integrations, secrets, scheduled work. Need it when: features require interactivity, third-party calls, or protected credentials. Skip it and: secrets leak into client bundles and reliable background work simply doesn't exist.

Hono

Lightweight, ultrafast web framework. Works on Cloudflare Workers, Deno, Bun. TypeScript-first, middleware-rich.

UsedFree⭐31kEdgeTypeScript

FastAPI

Python async API framework. Auto-generated OpenAPI docs, Pydantic validation. Preferred for AI/ML service backends.

Free⭐101kSelf-HostPythonAsyncOpenAPI

tRPC

End-to-end typesafe APIs. No schema generation — your function types ARE the API contract. Full-stack TypeScript.

Free⭐40kTypeScriptType-Safe

Pulumi / Terraform

Infrastructure as Code. Pulumi uses real programming languages (Python, TS, Go). Terraform is HCL-based.

Free tier⭐25kBothIaCProvisioning

PocketBase

Open-source backend in a single Go binary. SQLite, realtime subscriptions, auth, file storage, admin dashboard. No server config — just run the binary.

Free⭐56kSelf-HostGoBaaSSQLite

Appwrite

Open-source Firebase alternative. Auth, databases, storage, functions, messaging, and realtime in one self-hostable platform. 56.7K stars, $37M raised from Tiger Global and Bessemer. Web, mobile, and AI app backends.

Free⭐57kBothTypeScriptBaaSAuth

Encore

Infrastructure SDK for TypeScript and Go. Declare databases, Pub/Sub, caches, cron, and secrets in code; Encore provisions and deploys them on AWS/GCP. 12.2K stars, production backends without manual cloud config.

Free⭐12kManagedGoTypeScriptDeclarativeProvisioning
L5

Search / Content Management

details

Problem it solves: making content findable and editable without a developer in the loop. Need it when: content volume grows past a few hand-edited pages or users must be able to search. Skip it and: content buries itself — unsearchable archives, and hand-edited HTML as your publishing workflow.

Ghost CMS

Headless CMS for content. SQLite-backed, webhook-friendly, member management. Used for ToolBrain.

UsedFree⭐54kSelf-HostCMSNode

Pagefind

Static search index. Zero server, runs at build time. Integrated with Astro, no external service needed.

UsedFree⭐5.4kStaticNo-Server

SearXNG

Self-hosted metasearch engine. No tracking, no ads. Useful for agent tool-calling and research pipelines.

UsedFree⭐34kSelf-HostPrivacy

Meilisearch

Rust-based search engine. Typo-tolerant, instant, filtering/faceting. Self-host or managed cloud.

Free⭐59kBothSearchRust

Typesense

Open-source alternative to Algolia. In-memory, typo-tolerant, C++ built. 2.5B+ monthly searches on cloud. 26K+ stars, 7M+ Docker pulls.

Free⭐26kBothSearchC++Algolia-Alt

Strapi

Leading open-source headless CMS in TypeScript. Customizable content API with admin panel, REST/GraphQL out of the box, self-host or managed cloud. 72.8K stars, $47M funding (CRV, Index Ventures), top open-source headless CMS by GitHub adoption.

Free⭐73kBothTypeScriptCMSAPI-First

Sanity

Composable content cloud with open-source Studio. Structured content API, GROQ queries, real-time collaboration, visual editing. Powers 10,000+ live websites; $85M Series C led by GP Bullhound, backed by ICONIQ Growth and founders from Vercel, Shopify, Twitter.

Free tier⭐6.3kManagedTypeScriptCMSGROQ
L6

Observability / Analytics

details

Problem it solves: showing you what production is actually doing — errors, traffic, performance. Need it when: before real users arrive, and definitely after the first unexplained failure. Skip it and: you debug blind: user reports instead of traces, regressions shipping unnoticed.

GoatCounter

Privacy-first web analytics. No cookies, no tracking. Simple dashboard, self-hostable. Lightweight JS snippet.

UsedFree⭐5.8kBothPrivacyLightweight

OpenTelemetry

Observability standard. Traces, metrics, logs. Vendor-neutral — export to any backend (Grafana, Datadog, SigNoz).

Free⭐4.3kSelf-HostTracingStandardVendor-Neutral

Grafana + Loki

Metrics + logs stack. Grafana for dashboards, Loki for log aggregation. Self-hosted or Grafana Cloud.

Free tier⭐76kBothDashboardLogs

SigNoz

Open-source APM. Distributed tracing, metrics, logs in one place. OpenTelemetry-native. Self-hostable.

Free⭐31kSelf-HostAPMOpen Source

Sentry

Error tracking and performance monitoring. Session replay, breadcrumbs, release tracking. SDKs for 10+ languages. Self-hostable, or managed cloud with generous free tier.

Free tier⭐44kBothError TrackingPythonSession Replay

HyperDX

Open-source observability platform unifying session replays, logs, metrics, traces and errors in one place. ClickHouse-powered with OpenTelemetry-native ingestion, LLM/trace support, and self-hostable. Datadog alternative without the price tag.

Free⭐9.8kBothTypeScriptClickHouseOTel
L7

AI / Agent Frameworks

details

Problem it solves: orchestrating LLM calls into reliable multi-step workflows — branching, tool use, state, retries. Need it when: a single prompt no longer gets the job done. Skip it and: hand-rolling agent loops means reimplementing state management, retries, and observability yourself.

LangGraph

Graph-based stateful agent orchestration. 36K+ stars, 34.5M monthly downloads. Best for complex multi-step workflows with branching state.

Free⭐38kPython/TSStatefulGraph

CrewAI

Multi-agent role-based coordination. 53K stars, 27M+ PyPI downloads, 2B+ agent executions. DocuSign, IBM, PwC in production.

Free⭐56kPythonMulti-AgentRoles

Microsoft Agent Framework

Unified Semantic Kernel + AutoGen. GA April 2026. Production SDK with Azure integration, enterprise governance, and .NET/Python/Java support.

Free⭐28kPython/.NETEnterpriseAzure

Dify

Visual AI platform. 144K stars, $30M Series Pre-A, 280+ enterprises. Drag-and-drop workflow builder, RAG pipelines, model management.

Free⭐149kBothVisualRAG

Haystack

Enterprise NLP pipelines. Strong observability, pipeline tracing, component library. Mature for document processing and search systems.

Free⭐26kPythonNLPPipeline

Pydantic AI

Type-safe production agents. Pydantic-validated structured outputs, dependency injection, logfire observability. Fast-growing ecosystem.

Free⭐19kPythonType-SafeStructured
L8

Agent Infrastructure / Orchestration

details

Problem it solves: running agent workflows as durable, scheduled, observable production systems. Need it when: agents become part of your product or operations and plain cron isn't enough. Skip it and: you get fragile ad-hoc scripts that fail silently with no recovery or visibility.

Hermes Agent

AI agent framework powering this blog empire. Cron-driven content pipelines, multi-model arena, MCP tools, gateway bots, 17K+ test suite.

UsedFree⭐218kPythonPipeline

MCP Protocol

Model Context Protocol — standardized tool-calling interface. Growing ecosystem: databases, APIs, file systems as MCP servers.

FreeStandardTool-Calling

OpenAI Agents SDK

Lightweight agent framework. Handoffs, guardrails, tracing. Simpler than LangGraph, good for single-agent tasks.

Free⭐28kPythonLightweight

Temporal / Inngest

Durable execution for agent workflows. Retries, state recovery, long-running processes. When cron isn't enough.

Free tier⭐22kBothDurableWorkflow

Agno

High-performance agent framework (formerly Phidata). 41K+ stars, v2.7.3. Multi-modal, AgentOS runtime, multi-agent teams. Claims 5,000× faster instantiation than LangGraph.

Free⭐41kPythonMulti-AgentHigh-Perf

Mastra

TypeScript-first AI agent framework. YC-backed ($13M), 26.7K+ stars. Agents, workflows, memory, evals, and observability in one SDK. Integrates with Next.js, React, and Node. Deploy standalone or as a serverless function.

Free⭐27kTypeScriptWorkflowsMCP

n8n

Fair-code workflow automation platform with native AI capabilities. Visual drag-and-drop builder, 400+ integrations, AI agent nodes with MCP support. Self-hostable — 199K+ GitHub stars, 200K+ users.

Free⭐199kSelf-HostTypeScriptWorkflowMCP

// infrastructure decisions for this blog empire

This stack reference is also a live decision record. Each green-taggedtechnology is currently in use. As the empire grows, expansion generally movesdownward — adding data, auth, backend, then AI orchestration as needed.

Current expansion candidates (based on gap analysis):

  • L3 — Authentication: Required before adding gated content, paid subscriptions, or user-specific agent sessions. Clerk has the lowest integration overhead.
  • L4 — Backend: Needed when cron-driven pipelines need interactive user input or real-time response. Hono on Workers keeps the footprint small.
  • L7–L8 — AI orchestration: The Hermes Cron + arena-direct-runner pattern is already proven. Formalizing with LangGraph or Temporal becomes relevant when multi-agent workflows exceed single-script complexity.

→ Agent harness architecture ·→ Durable execution patterns ·→ MCP vs A2A vs function calling