Labs
A vector database from scratch, GPT-2 from first principles, a tokenizer in pure Python. None of these are products. They are how I learn what the libraries hide.
A vector database written from scratch: 9 ANN algorithms (HNSW, IVF, PQ, Int8, LSH, KD-Tree, VP-Tree, BM25, Hybrid RRF), a cost-based query planner, WAL with fsync durability, background compaction, distributed scatter-gather, and row-level RBAC. Multimodal ingestion, cross-encoder RAG, OpenAI-compatible endpoints, and GPU-accelerated indexing via CuPy and Numba.
Reimplementing GPT-2 from first principles following the nanoGPT curriculum, character-level tokenization, causal self-attention, multi-head attention, the full transformer block, then byte-pair encoding and training on Tiny Shakespeare.
Memory for long-running agents. Recent events sit in a buffer that fades over time, older state is compressed into summaries, and checkpoints let a crashed run pick up where it stopped.
Pure Python byte-pair encoding replicating tiktoken's core, with GPT-2/4 regex pre-tokenization, byte fallbacks, and a custom vocabulary trained on technical corpora.
A shared protocol for agents to work together. Each agent says what it can do, tasks are split into explicit contracts, results are merged, and failures are passed up the chain so they don't get lost.
Keeps long agent sessions under the context limit. Text is chunked by meaning and scored on how recent and relevant it is; the lowest-scoring parts are dropped or summarised first.
Writing a vector index or a transformer block myself is how I learn what a library assumes. It's also why I can tell you where your retrieval or serving setup will break.