// blog
Patterns, not opinions.
Notes on the architecture decisions inside this boilerplate — billing AI by usage, keeping codebases agent-readable, and the plumbing in between.
July 22, 2026 · 4 min read
Make your SaaS agent-accessible: an MCP server in one route
Agent-friendly applies to the running product too: a Streamable HTTP MCP server in one Next.js route, with typed tools backed by your existing modules.
Read →July 13, 2026 · 5 min read
Guardrails for AI free tiers: shipping free credits without getting burned
Every free credit is real gateway spend. The checklist that keeps a public AI demo affordable: verified emails, IP limits, input caps, race-safe charging.
Read →July 6, 2026 · 5 min read
RAG on plain Postgres: pgvector + chat-with-your-PDF, no blob storage
Production RAG without a vector DB: pgvector + HNSW retrieval, paragraph-aware chunking, in-request PDF parsing, and metered ingestion.
Read →June 24, 2026 · 5 min read
Selling your AI as an API: metered keys in one module
Hashed sk_ keys, one-time reveal, soft revoke, and a Bearer-auth swap that turns any AI feature into a metered public API.
Read →June 16, 2026 · 5 min read
Billing AI products by usage: the credit-ledger pattern
Why subscriptions fail for AI SaaS, and how a two-table credit ledger meters real token usage safely.
Read →June 5, 2026 · 4 min read
CLAUDE.md: teaching your codebase to explain itself
Agents fail by guessing. A single source-of-truth file with rules, maps, and recipes turns guesses into pattern-matching.
Read →