~/ nmadiraju.com
menu_book Understand

Primers

In-depth explainers that build the mental model — not Q&A drills. A connected arc of typed teaching blocks (analogy, how-it-works, worked example, misconception, when-to-use) with diagrams and runnable assets.

Primer

SLOs for Infrastructure Teams Whose Users Are Other Teams

The sequel to Article 17: that one taught the mechanics; this one handles the organizational reality that makes infrastructure SLOs genuinely harder than product SLOs. Infrastructure SLOs fail not because the math is hard but because the user is ambiguous — you're not measuring a service, you're measuring an interface between teams. Why product-SLO thinking breaks (fifty consumers, no single golden signal, their SLOs stacked on yours), identifying the actual consumer (define the SLI at your interface, one per capability — not an outcome three layers up), the responsibility boundary as the heart (measure at the Resolver endpoint, not the client; looser than your dependency composite; the SLI that turns 'the network is slow' into data), the infra SLI menu (availability / latency / correctness — plus the provisioning time-to-ready SLO nobody publishes), the negotiation ('what do you assume about us?' → usually 100%; publish it; tier at a chargeback price), error budgets when a consumer causes the burn (per-tenant SLIs, quotas, and why you don't freeze for their fault), and the anti-patterns. One shared capability threaded through all six steps into a published one-page contract.

Principal track · platform, network & shared-services leads 9 parts
SLOSREPlatformReliabilityMulti-tenant
Primer

SLOs from Scratch: Picking Your First SLI for a Network Service

Your first SLO should measure what consumers experience, be based on current performance — not aspiration — and ship with a budget policy, or it's a dashboard, not an SLO. The four terms kept surgically separate (SLI / SLO / error budget / SLA), the hard part for network services (what counts as an 'event' — flows, packets, queries), a worked first SLI for hybrid DNS (Route 53 Resolver + on-prem forwarders: valid = reaches the endpoint, good = non-SERVFAIL within 100 ms), setting the number from measurement and dependency math rather than vibes, error-budget arithmetic and the budget policy everyone skips, and why you alert on burn rate. Every claim sourced.

Deep dive · platform & network engineers 9 parts
SLOSREReliabilityDNSRoute 53 Resolver
Primer

GitHub Actions, One Layer at a Time: From Six Lines to a Hardened Pipeline

Build one pipeline from six lines up, adding each concept only when the previous version hits a wall — steps vs jobs, why jobs are isolated (and how data actually crosses via artifacts / cache / outputs), the action as the reusable unit, the GITHUB_TOKEN and OIDC, Environments and approvals, the fork trust line and the three ways repos get owned, and matrix / concurrency / cost. The concepts arrive already motivated, not dumped. Every claim sourced.

Deep dive · software & platform engineers 12 parts
GitHub ActionsCI/CDDevOpsSecurityOIDC
Primer

Leading Without Authority: The Platform Tech Lead's Playbook

You own the outcome but can't order anyone to do anything — and for a platform team that gap isn't a bug in your title, it's the whole job. Why mandates backfire (resentment, shadow workflows, dead feedback), the operating model that works instead (credibility + Cohen & Bradford's currencies of influence + platform-as-product), and 11 concrete plays a platform tech lead actually runs — each tagged with who advocates it and whether it's evidence-based or named opinion. Attributed to Fournier, Larson, Reilly, Team Topologies, and DORA/DevEx research.

Primer · engineering leadership 8 parts
LeadershipPlatform EngineeringTech LeadInfluenceDesign
Primer

Agent Evaluation: Trajectories, Tool-Calls, Task Completion

The fourth primer in the series: how do you know the agent is any good? You stop grading it the way you graded a plain LLM app. A model hands you an output to check against a reference; an agent hands you a trajectory, and the output is only its last step — so you grade the path. Why final-answer eval is a trap for agents; the three layers worth measuring (final response, trajectory, single tool-call) and why most teams measure only the first; the two scorer families (reference-based vs reference-free / LLM-as-judge) and matching the scorer to the question; the two concrete ways to grade a trajectory from the open-source agentevals package (when you know the right path vs when you don't); pass^k — the reliability metric that exposes non-determinism that pass@1 hides; offline (pre-release, gate the PR) vs online (post-release, every production failure becomes a new dataset case) eval on the lifecycle; and a pre-ship checklist. With diagrams and runnable code.

Primer · grade the path, not the answer 8 parts
AgentsEvaluationLLMDesign
Primer

Agent Memory Architectures

The third primer in the series: a stateless model forgets everything between calls, so the entire feeling of an agent that 'knows you' is an illusion you construct by deciding what text to re-send each turn. The two layers you must never conflate — short-term thread state (the checkpointer, keyed by thread_id) vs long-term cross-session knowledge (the store, scoped by user_id); the context window as a budget, not a bucket, and the compaction that keeps it honest; long-term memory's three jobs (semantic, episodic, procedural) and why one bucket for all three breaks retrieval; the recall and save nodes that bracket the loop; resuming a thread by its transcript vs greeting a fresh session with the user's facts; the line between memory and RAG; and a 17-row pre-ship checklist. With flow diagrams and runnable LangGraph code.

Primer · what you re-send is the memory 10 parts
AgentsMemoryLLMDesign
Primer

Tool Use & the Agent-Computer Interface

The sequel to The Agent Loop: how to design the tools an agent calls so it picks the right one, fills the arguments correctly, and recovers when they fail. Why a tool is model-facing documentation, not an API; the brain-in-a-jar mechanism of a single tool call traced on the wire (and why it's two API calls); curating a narrow-but-consolidated tool layer with the ~15-tool cap; schema hygiene (enums over naked strings, flat objects, additionalProperties:false, Pydantic validation at both ends); errors as instructions for self-correction; idempotent writes and stateless tools; routing instead of dumping past ~20 tools (progressive discovery, a single meta-tool, a hierarchical router, semantic retrieval); and evaluating tools against a golden set. With diagrams and runnable Anthropic-SDK and LangGraph code.

Primer · the agent-computer interface 7 parts
AgentsTool UseOrchestrationDesign
Primer

The Agent Loop

An in-depth primer on the one primitive every agent reduces to: a model in a loop with tools — think, act, observe, repeat. Walks ReAct as the base loop, when Plan-and-Execute and Reflection earn their place, how production layers all three into a hierarchical architecture (an outer planner, ReAct sub-agents per step, a reflection gate), and the deterministic guardrails that actually keep it safe — strict termination, context pruning, execution sandboxing, and human-in-the-loop interrupts. With diagrams and runnable Anthropic-SDK and LangGraph code.

Primer · the model-in-a-loop 5 parts
AgentsOrchestrationLLMDesign
Primer

Embeddings & Vector Search — a Primer

An in-depth, engineer-leaning explainer (not Q&A): the one mental model — an embedding turns meaning into coordinates, so search-by-meaning becomes find-nearest-points. Cosine vs dot product vs Euclidean and the magnitude trap, why on normalized vectors all three rank identically, why brute-force k-NN is exact but O(N) and breaks at scale, approximate nearest neighbor and the recall-vs-latency dial (recall@k), and how the HNSW graph index actually works (layered proximity graph, greedy descent, M/ef) alongside IVF and product quantization. With diagrams and a runnable zero-dependency notebook that makes cosine, dot, and L2 disagree then agree.

Primer · meaning as coordinates 6 parts 25 questions
Vector SearchRAGLLMDesign
Primer

Evals for LLM Apps — a Primer

An in-depth, engineer-leaning explainer (not Q&A): the one mental model — an eval is a test suite for a non-deterministic system, so you measure quality with a grader over a dataset, not exact equality. The anatomy (dataset → task → grader → score), the three grading methods (code, human, LLM-as-judge) and their cost-vs-nuance trade, running LLM-as-judge well (rubrics, structured verdicts, reason-then-discard, a different model) and its real biases (position, verbosity, self-enhancement), plus offline vs online, regression testing as CI-for-prompts, and guardrail testing. With diagrams and a runnable eval-harness notebook that exposes the judge flipping under position bias.

Primer · test suites for a probability 6 parts 22 questions
EvaluationLLMDesign
Primer

Model Context Protocol (MCP) — a Primer

An in-depth, engineer-leaning explainer (not Q&A): the one mental model — MCP is a universal port that turns M×N custom integrations into M+N — then the host/client/server architecture (one client per server, 1:1), the JSON-RPC data layer inside the transport layer, the three server primitives (tools the model calls, resources the app loads, prompts the user picks), the lifecycle traced in real messages (initialize → negotiate capabilities → list → call → notify), stdio vs Streamable HTTP, and client primitives (sampling, elicitation). With diagrams and a runnable, zero-dependency protocol-handshake notebook.

Primer · a universal port for AI apps 6 parts 22 questions
MCPAgentsTool UseLLMDesign
Primer

RAG, End to End — a Primer

An in-depth, engineer-leaning explainer (not Q&A): the one mental model — RAG is a funnel that selects the model's input, not its weights — traced stage by stage (chunk → embed → retrieve → rerank → generate). Why 'similar' isn't 'relevant' (with a runnable zero-dependency demo where the answer-bearing chunk loses to a vocabulary match), retrieve-then-rerank (bi-encoder recall vs cross-encoder precision), the four-stage failure cascade where the right chunk gets dropped before the model sees it, and managed RAG on Bedrock Knowledge Bases — plus when RAG beats a bigger context window or fine-tuning. With diagrams, a runnable notebook, and a hands-on exercise.

Primer · the funnel that picks the model's input 6 parts 22 questions
RAGVector SearchLLMDesign
Primer

AWS Direct Connect — a Primer

An in-depth, mixed-audience explainer (not Q&A): the one mental model — a dedicated private wire, not a tunnel — sliced into virtual interfaces where each slice reaches a different world (private→your VPC, public→AWS services not the internet, transit→many VPCs). The physical layer (cross-connect, LOA-CFA, dedicated vs hosted), the VIF reachability matrix (with a Terraform example), the gateways (VGW vs DXGW vs Transit Gateway, and why a DXGW is non-transitive), routing with BGP (advertise/receive prefixes; local-pref steers outbound, AS-path/communities steer inbound; BFD), resilience (the Resiliency Toolkit tiers, 99.9%/99.99%), and security/cost/when-to-use (private ≠ encrypted → MACsec or VPN-over-DX; port-hours + lower egress; the worth-it threshold). With diagrams and a design exercise.

Primer · a dedicated wire, not a tunnel 7 parts 32 questions
NetworkingDirect ConnectRoutingDesign
Primer

Self-Improving AI Agents — a Primer

An in-depth, mixed-audience explainer (not Q&A): the one mental model — edit the producer, not the product — and the four levels improvement lives at (prompt/notes → memory/skills → tools/code → weights). The shallow end (Reflexion: reflect→store→retry with no weight updates, with a runnable zero-dependency notebook), the deep end (the Darwin Gödel Machine rewriting its own code; how Schmidhuber's 'prove it first' Gödel machine became 'test it'), where it breaks (the DGM faking its own test logs — reward hacking), and when self-improvement actually earns its place. With diagrams, a demo notebook, and a hands-on exercise.

Primer · edit the producer, not the product 6 parts 28 questions
AgentsLLMDesign
Primer

AI Agent Factory — a Primer

An in-depth, mixed-audience explainer (not Q&A): the production-line mental model — from artisanal one-off agents to a governed factory — the moving parts (templates, orchestration, tools/connectors, governance, lifecycle), the agent lifecycle with governance gates, the four governance pillars, supervisor orchestration and define-once agent specs, and when a factory earns its weight vs an agent framework. With diagrams, a governance checklist, an agent-spec template, and a blueprint exercise.

Primer · the production line 6 parts 23 questions
AgentsArchitectureOrchestrationDesign