← Max Khor
Technical writing

Notes

Notes on agent harnesses, inference serving, concurrency, queues, dependency ordering, and small stateful systems. The collection includes reading paths, worked implementations, and compact references.

Reading Paths

Curated source material, arranged in the order that makes the system easiest to understand.

Agent harnesses

Pi Agent Harness: A Reading Path

Ten readings on Pi's tool protocol, loop, sessions, compaction, extensions, and product choices, with a source-grounded study sequence.

10 readings · Checked July 2026

Source Studies

Implementation traces, design boundaries, and exercises grounded in a pinned source snapshot.

Agent harnesses

Pi Agent Harness: Source Study Notes

Pi's event stream, loop, tools, session tree, compaction, extensions, tmux workflow, and security boundary, with five integrated exercises.

Source snapshot 063fb963c · Reviewed July 2026

Guides

Inference serving, concurrency, queues, shutdown, worker pools, and asyncio.

Inference systems

LLM Inference Serving: Essential Notes

Prefill, decode, KV-cache memory, prefix-aware routing, eviction, memory tiers, continuous batching, PagedAttention, and the scheduling tradeoffs connecting them.

Serving literacy · Reviewed July 2026
First principles

Python Concurrency From First Principles

Threads, shared state, conditions, semaphores, blocking queues, shutdown, worker pools, testing, and asyncio, built from concrete questions about who can proceed and why.

Python 3.12 · Reviewed July 2026

Worked Labs

One worker pool, built and traced from submission through shutdown.

References

Python APIs, invariants, operation costs, and implementation patterns.

Pocket reference

Python Systems Coding Reference

A compact map of core data structures, sorted lookup, dependency ordering, concurrency primitives, blocking queues, thread pools, asyncio, and common failure checks.

Python 3.12 · Reviewed July 2026