Abstractions and Regrets

Every Abstraction I Regret

The best code I ever deleted was a utility function called format_response. It accepted a response object, a format string, a fallback value, an optional transformer function, and a boolean for whether to strip whitespace. It was used in exactly one place. I wrote it because I thought I’d need it again. I didn’t. It sat in utils.py for eight months, collecting type: ignore comments and confusing every developer who opened the file. ...

February 20, 2026 · 7 min · Muhammad Hassan Raza
Multi-agent middleware illustration

Multi-Agent LLM Middleware: Lessons from Marketing Accelerant

Marketing Accelerant is an AI-powered marketing analytics platform I worked on at Entropy Labs. It runs 15+ specialized LLM agents for Brand Voice, Creative Content, CMO Strategy, SEO, Email Campaigns, Google Ads, Meta Ads, Video Studio, and more, all serving enterprise clients through a single FastAPI backend. The agents themselves aren’t the hard part. The hard part is everything around them: model selection, context management, cost control, error recovery, and human approval. This post covers the middleware architecture that makes it work in production. ...

January 10, 2026 · 7 min · Muhammad Hassan Raza
LangChain production workflow diagram

LangChain in Production: What the Tutorials Don't Tell You

Every LangChain tutorial ends right where the real work begins. You see a neat 50-line script that queries a PDF, and you think, “Cool, I’ll ship this by Friday.” Three weeks later, you’re debugging memory leaks, wondering why your chain silently returns empty strings, and questioning every decision that led you here. I’ve shipped LangChain-based features to production at multiple companies. Here’s what I wish someone had told me before I started. ...

June 20, 2025 · 5 min · Muhammad Hassan Raza