// 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

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
L2

Data / Storage

details

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
L3

Authentication / Identity

details

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
L4

Backend / API Services

details

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
L5

Search / Content Management

details

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
L6

Observability / Analytics

details

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
L7

AI / Agent Frameworks

details

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

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

// 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