Engineering deep-dives drawn from real production work — AI agents, backend systems, payments, and the modern web. How things were actually built, trade-offs included.
Model Context Protocol explained for agent builders: what an MCP server is, tools vs resources vs prompts, a minimal TypeScript example, and MCP vs tool-calling.
Metadata-filtered RAG fixes single-shot retrieval that returns junk on multi-topic corpora. How I built a metadata pre-filter, vector search, and LLM rerank pipeline.
Hardening a Razorpay integration in Next.js: checkout vs webhook signature verification, idempotent settlement with a Postgres ledger, and the operational guards.
Next.js 15 caching as one mental model: Request Memoization, Data Cache, Full Route Cache, Router Cache, and tag-based revalidation that actually fires.
Preventing double-bookings in Postgres: how a check-then-insert race oversells slots, and the layered fix — unique constraint, row and advisory locks, transactions, isolation.
pgvector turns Postgres into a vector database: store embeddings, rank by cosine distance with <=>, index with HNSW, and filter by metadata in one SQL query.
LLM structured outputs explained: force reliable JSON from OpenAI with JSON mode, tool calling, and json_schema strict decoding, then validate with Zod or Pydantic.
Search is splitting into two audiences — Google's crawler and AI assistants like ChatGPT, Claude, and Perplexity. Here's exactly how I made this site legible to both, with a single source of truth so nothing drifts.
An editorial team's morning routine — search dozens of sources, judge what matters, confirm it, then draft — turned into a two-phase, human-in-the-loop agent streamed live over SSE. Here's the architecture and the decisions that kept it cheap and trustworthy.