sanskar.

Backend, systems & AI engineer.

I build systems that hold up, and write about how.

I’m Sanskar. I work across storage engines, backend infrastructure, LLM systems, and agents, mostly by building them from scratch. This is my notebook: long-form writing, the things I’ve built, and rougher notes in the margins.

Start here
  1. 01 Harness engineering: the layer that turns a model into an agent
  2. 02 Building an MCP server from scratch
  3. 03 Writing an LSM-tree in Go
On GitHub @sanskarpan ↗
  contributions in the last year
Mon Wed Fri
Selected writing all writing →
  • 01 Harness engineering: the layer that turns a model into an agent

    An LLM is a stateless next-token predictor. Everything that makes it feel like an agent, the loop, the tools, the memory, the verification, lives in the harness. Here is what that layer actually does, why it moves benchmarks more than people expect, and where the real engineering is.

  • 02 Writing an LSM-tree in Go

    A from-scratch LSM storage engine: the skip-list memtable, the on-disk SSTable format block by block, Bloom filters, platform-aware mmap, the WAL and crash recovery, three live-switchable compaction strategies, and the Raft layer that wraps the whole thing.

  • 03 Building an MCP server from scratch

    What the Model Context Protocol actually is in 2026, the primitives that matter, and how to expose real tools to an LLM without hand-rolling an orchestration loop.

Selected work all projects →
LSM-Tree Storage Engine Go

A from-scratch LSM-tree in Go: skip-list memtable, Bloom-filtered mmap SSTables, three live-switchable compaction strategies, and Raft quorum replication with multi-shard rebalancing behind one API.

Go · LSM · Bloom filters · mmap · Raft
Raft Consensus Go

A replicated key/value store on a from-scratch Raft: linearizable reads via ReadIndex (no log write), streaming snapshots, joint-consensus membership changes, and correctness checked with Porcupine linearizability testing.

Go · Raft · linearizability · gRPC
TAG · Terminal Agent Gateway Go

A multi-provider agent orchestrator with autonomous loops, cron, parallel swarms, hard token budgets, and a crash-safe SQLite state store. Recently ported from a Python control plane to a native Go runtime. On PyPI + npm.

Go · agents · SQLite · multi-provider
PromptLine Python

An LLM-evaluation and prompt-optimization pipeline: a calibrated LLM-as-judge, a statistical deploy gate (paired-bootstrap CI with Holm correction), and five optimizers including a from-scratch GEPA. On PyPI as promptline-opt.

Python · FastAPI · LLM-as-judge · GEPA
Latexy Full-stack

A full-stack resume optimizer that rewrites LaTeX against a target job description, streams the compile, and scores ATS keyword coverage with pgvector semantic matching, showing exactly what a parser reads back.

Next.js · FastAPI · Celery · pgvector
PayGate Go

A multi-tenant payment platform in Go using double-entry ledgering, a transactional outbox, and saga orchestration with explicit per-entity state machines, three-way reconciliation, and dead-letter handling.

Go · PostgreSQL · Saga · Outbox
What I work on all projects →
Storage engines

LSM-trees and B+Trees from scratch: WAL, MVCC, compaction, and crash recovery.

Distributed systems

Raft, replication strategies, gossip, and tracing, plus the failure modes underneath.

Backend & APIs

Payment infrastructure, gRPC services, queues, reverse proxies, and the reliability plumbing.

LLM & agent infra

Agent runtimes, prompt-optimization pipelines, evals, and MCP tooling.

The stack what I use →
Languages
Go Python TypeScript C++ Rust
Backend & data
PostgreSQL Redis Kafka FastAPI
Infra & observability
Docker Kubernetes Prometheus
Web
React Next.js Astro
Topics
Recently active on GitHub ↗
From the margins all notes →