// 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.
Static Site / Frontend
detailsProblem 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.
Cloudflare Pages
Global edge deployment, free tier, automatic HTTPS, instant rollback. Pairs with Astro natively.
Next.js / Remix
Full-stack React frameworks. SSR, API routes, middleware. More complexity, more capability.
SvelteKit
Lightweight framework, less boilerplate. Growing ecosystem. Good for interactive apps with less JS overhead.
VitePress
Vue-powered SSG built on Vite. Markdown-first, fast HMR, built-in search. Spiritual successor to VuePress. From the official Vue.js org.
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).
Data / Storage
detailsProblem 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.
PostgreSQL
Production relational database. Extensions, JSONB, full-text search. Standard choice when you outgrow SQLite.
R2 Object Storage
S3-compatible, no egress fees. Images, assets, backups. Integrated with Cloudflare ecosystem.
Redis / KV
In-memory cache, session store, rate limiting, pub/sub. Cloudflare KV for edge-cached key-value.
Turso / libSQL
Edge-distributed SQLite. Embedded Replicas for local reads, global writes. Database-per-user architecture with vector search. Rust-based, SQLite-compatible.
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.
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.
Authentication / Identity
detailsProblem 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.
Auth.js / NextAuth
Open-source auth for any framework. 70+ providers, database adapters, JWT/session. Self-hostable.
Supabase Auth
Built on PostgreSQL Row-Level Security. Free tier, integrates with Supabase DB, realtime, storage.
Zitadel
Self-hosted identity platform. OIDC, SAML, LDAP, custom domains, audit logs. Enterprise-grade, open-source.
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.
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.
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.
Backend / API Services
detailsProblem 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.
FastAPI
Python async API framework. Auto-generated OpenAPI docs, Pydantic validation. Preferred for AI/ML service backends.
tRPC
End-to-end typesafe APIs. No schema generation — your function types ARE the API contract. Full-stack TypeScript.
Pulumi / Terraform
Infrastructure as Code. Pulumi uses real programming languages (Python, TS, Go). Terraform is HCL-based.
PocketBase
Open-source backend in a single Go binary. SQLite, realtime subscriptions, auth, file storage, admin dashboard. No server config — just run the binary.
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.
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.
Search / Content Management
detailsProblem 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.
Pagefind
Static search index. Zero server, runs at build time. Integrated with Astro, no external service needed.
SearXNG
Self-hosted metasearch engine. No tracking, no ads. Useful for agent tool-calling and research pipelines.
Meilisearch
Rust-based search engine. Typo-tolerant, instant, filtering/faceting. Self-host or managed cloud.
Typesense
Open-source alternative to Algolia. In-memory, typo-tolerant, C++ built. 2.5B+ monthly searches on cloud. 26K+ stars, 7M+ Docker pulls.
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.
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.
Observability / Analytics
detailsProblem 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.
OpenTelemetry
Observability standard. Traces, metrics, logs. Vendor-neutral — export to any backend (Grafana, Datadog, SigNoz).
Grafana + Loki
Metrics + logs stack. Grafana for dashboards, Loki for log aggregation. Self-hosted or Grafana Cloud.
SigNoz
Open-source APM. Distributed tracing, metrics, logs in one place. OpenTelemetry-native. Self-hostable.
Sentry
Error tracking and performance monitoring. Session replay, breadcrumbs, release tracking. SDKs for 10+ languages. Self-hostable, or managed cloud with generous free tier.
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.
AI / Agent Frameworks
detailsProblem 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.
CrewAI
Multi-agent role-based coordination. 53K stars, 27M+ PyPI downloads, 2B+ agent executions. DocuSign, IBM, PwC in production.
Microsoft Agent Framework
Unified Semantic Kernel + AutoGen. GA April 2026. Production SDK with Azure integration, enterprise governance, and .NET/Python/Java support.
Dify
Visual AI platform. 144K stars, $30M Series Pre-A, 280+ enterprises. Drag-and-drop workflow builder, RAG pipelines, model management.
Haystack
Enterprise NLP pipelines. Strong observability, pipeline tracing, component library. Mature for document processing and search systems.
Pydantic AI
Type-safe production agents. Pydantic-validated structured outputs, dependency injection, logfire observability. Fast-growing ecosystem.
Agent Infrastructure / Orchestration
detailsProblem 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.
MCP Protocol
Model Context Protocol — standardized tool-calling interface. Growing ecosystem: databases, APIs, file systems as MCP servers.
OpenAI Agents SDK
Lightweight agent framework. Handoffs, guardrails, tracing. Simpler than LangGraph, good for single-agent tasks.
Temporal / Inngest
Durable execution for agent workflows. Retries, state recovery, long-running processes. When cron isn't enough.
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.
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.
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.
// 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