Standard Reader
Alessandro Bahgat
ai

Alessandro Bahgat

Personal website of Alessandro Bahgat — Software Engineering Leader.

@abahgat.com0readers61posts10d ago
LatestRecent writing
The nearest hospital to every place on Earth, in a single S2 range query
May 31, 2026
For every locality on Earth, how far is the nearest hospital? Naively, that's 437 billion great-circle distances. S2 cell indexing reduces it to a single integer range-join: build the index once, and the answer for every place on Earth comes back in seconds. The same primitive also resolves which country, region, and locality each hospital belongs to, in a single pass over one index.
algorithmsspatial
Same Agent, Different Score: The Problem With Testing Non-Deterministic AI
Apr 16, 2026
Before building tools for my Zork-playing agents, I needed a benchmark I could trust. I ran five local models through fifty playthroughs and discovered that the same model can score 40 or 0 on the same game. Getting honest numbers required three harness versions, structured telemetry, and a loop detector that learned the difference between stuck and thorough.
AIAgents
Stuck in the Maze: Why AI Agents Can't Hold the Map
Apr 7, 2026
I had local AI models play Zork, the 1981 text adventure, to study why agents struggle to navigate connected systems. One started responding in Thai. Most scored zero. All got hopelessly stuck in the maze. What broke says a lot about why agents get lost in microservices too.
AIAgents
Permission Structure
Mar 31, 2026
AI tools are trained on extreme goal fulfillment: you ask "build X" and they build X. I've learned that prompting against that grain gets even better results: asking the model to stress-test ideas, not just execute them. It takes a deliberate permission structure to get there.
AIProduct Strategy
Fortresses, Pipes, and Brains
Mar 26, 2026
Workday's CEO called AI agent startups "parasites." Linear shipped a native AI agent that understands software development workflows. These are two ends of a spectrum, with most of the industry stuck in the middle — exposing data through MCP without embedding any intelligence. The companies that win will be the ones that make AI native to their domain workflow.
AIMCP
Visualizing Ukkonen's Suffix Tree Algorithm
Mar 9, 2026
I learned algorithms from textbooks and papers, building mental models from pseudocode and hand-drawn sketches. The hardest part was never reading the algorithm: it was seeing what it was actually doing to the data structure in memory. This post is the tool I wish I had back then.
algorithmsdata structures
The Velocity Paradox
Feb 23, 2026
AI agents can generate code 100x faster, but for companies stuck in the "Unhappy Middle" — with legacy debt, bespoke frameworks, and zero slack — the bottleneck has shifted from writing code to verifying it. Here's how engineering leaders can cross the chasm by becoming gardeners, not janitors.
AITechnical Debt
The Ghost in the Training Set
Feb 14, 2026
LLMs have statistical momentum: even when they know a new standard like Streamable HTTP exists, they often revert to the legacy patterns they saw most in training. Here is how to use "strong anchors" and "zero-prompt pruning" to keep your agentic systems from being haunted by 2024.
MCPAI
Receiving Feedback Is A Skill
Aug 25, 2020
Delivering feedback is a critical part of my day job as a manager at Google. However, it took me a while to realize that receiving feedback is one of the skills that helped me grow the most in my career. Here a few things I learned in the process.
feedback
Programming Machine Learning
May 4, 2020
A book written with developers in mind, covering Machine Learning with a hands-on approach. Each new topic is introduced by laying out a real world problem, guiding readers through implementing a working solution based on ML algorithms and then explaining the theoretical foundations in a very accessible way.
reviewbook
The programming puzzle that landed me my job
Oct 1, 2019
And how solving it required a truly full-stack solution, covering web development, data structures and memory optimization
hiring
What to look for when hiring
Aug 26, 2019
A while ago, I found myself in the enviable position of having to rapidly grow my team. Here a list of the most important characteristics I learned to value in anyone I work with, regardless of job function.
communicationhiring