Hi, I'm Huy
RSS FeedI'm a senior full-stack software engineer building realtime and AI products end to end — from Django/FastAPI backends and React frontends to Kubernetes infrastructure — and the author of open source libraries like chanx, fast-channels, nplus1, and drf-auth-kit. This blog is where I write about what I learn along the way.
Read the blog posts or learn more about me.
Featured
Agent Graph Engineering, Part 1: The Stack, and Why Each Piece Is There
The stack for building a typed, observable, controllable agent graph: Pydantic AI, LangGraph, chanx, OpenTelemetry, pytest and evals. What each piece buys you, what it costs, the architecture we build across the series, and the full series map.
Python API Framework Benchmark: FastAPI vs Litestar vs DRF vs Django Ninja vs Django Bolt - Real Database Queries and JWT Cookie Auth
Ten framework and server configs benchmarked on real PostgreSQL workloads and JWT httpOnly cookie authentication. The 37x JSON gap collapses to 1.8x on authenticated queries, auth itself costs about 10%, and tail latency reorders the leaderboard completely.
Streaming Agents with Pydantic AI over Typed WebSockets: Tools, Approvals, and a Generated Client
Building a production-style AI agent server with Pydantic AI + FastAPI + chanx: streaming structured output and human-in-the-loop tool approvals over a typed WebSocket contract, background runs broadcast to conversation groups (multi-tab, refresh-proof, approve from any device), AsyncAPI-generated TypeScript clients, and offline tests without an LLM.
Schema-First API Development with DRF + React: OpenAPI as the Contract
How my team ships DRF + React features without ever hitting a mistyped param or outdated API call: drf-spectacular as the source of truth, generated zod clients, auto-generated forms, and strict typing on both sides.
Python API Framework Benchmark: FastAPI vs Django vs Litestar on Real Database Workloads
I benchmarked the major Python web frameworks against real PostgreSQL workloads. The 20x performance gap you see in JSON benchmarks collapses to 1.3x once the database gets involved.
ChanX: Structured, Type-Safe WebSockets for Django and FastAPI
A batteries-included WebSocket framework: automatic message routing with Pydantic, mypy/pyright type safety, auto-generated AsyncAPI docs, and testing utilities — one codebase for Django Channels and FastAPI.
Recent Posts
Agent Graph Engineering, Part 5: Tools and Guardrails
What the model may do, and what it may say. Structured tool errors you raise instead of return, at-most-once execution for actions you cannot undo, and why the guardrail that works is demarcation rather than detection.
Agent Graph Engineering, Part 4: The Agent and the Graph
A typed model call and the flow that routes it, taught together because they compose. Why the agent's output type is also your routing table, how a node declares its own legal moves, and what replaces the if/else on an intent classifier.
Agent Graph Engineering, Part 3: Contracts, Not Conventions
Three services in two languages, and nothing hand-written at the seams. How OpenAPI and AsyncAPI become generated clients, why a Python docstring ends up in your TypeScript, and the form nobody wrote that stops a reviewer approving arguments they were never shown.
Agent Graph Engineering, Part 2: Split the Services, and Know Where the Line Goes
Why the agent graph and the business logic belong in dedicated services, how to draw the line at state ownership rather than at layers, and the bug that taught me the thread a person reads and the thread a model remembers are not the same object.