ideas / experiments / reflections

archive

6 posts

I write about things I've had to figure out while building software. Most of these essays start with a question rather than an answer. Why does this work? Why did it fail? What assumption did I miss? They're an attempt to build better mental models, mostly about AI, distributed systems, and infrastructure. If you're looking for a place to start, I'd recommend When Latency Becomes Audible, The Art of Retrieval, or How Real-Time Voice Agents Work.

When Latency Becomes Audible

25 min read

The audio engineering behind low-latency voice systems. After working through LiveKit and Pipecat internals, I wanted to understand what really happens once TTS audio reaches the transport layer. This post is about how audio gets framed and paced, how VAD knows when you start and stop talking, how bursty TTS output becomes steady, click-free speech in real time, and how jitter buffers and backpressure keep the pipeline under control.

Real-Time AudioMedia PipelineWebRTCJitter Buffer

Sample Rates are engineering tradeoffs

4 min read

Sample rates are not quality settings. They are engineering decisions shaped by whether a system is reproducing music, understanding speech, or carrying a phone call as cheaply as possible.

Sample RateAudio EngineeringVoice AINyquist Theorem

The Consensus Algorithm

10 min read

A breakdown of Raft: how distributed servers elect a leader, replicate logs, and stay consistent even when nodes fail.

Distributed SystemsRaftConsensusLeader Election

The Art of Retrieval

35 min read

Every retrieval algorithm exists because the previous one had a flaw. This is a deep dive into how search evolved, and why it had to.

Information RetrievalRAGBM25Semantic Search

Building a Simple Real-Time Voice Agent with LiveKit

4 min read

A hands-on walkthrough of building a real-time voice agent with LiveKit, wiring up the full STT to LLM to TTS loop so you can have back-and-forth voice conversations.

LiveKitVoice AgentsSTT → LLM → TTSReal-Time AI

How Real-Time Voice Agents Work: Architecture and Latency

14 min read

A breakdown of how real-time voice agents work under the hood: the two-layer architecture, VAD, STT, LLM, TTS pipeline, and where latency comes from at each stage.

Voice AgentsWebRTCReal-Time SystemsLatency