Tutorials
Hands-on, step-by-step builds: you finish each one with working code and know why every step is there
All Tutorials
Building ChatGPT-Style Streaming in React: FastAPI + Next.js Production Guide
Cancel-on-disconnect misses the drops that cost money, and resumable streams bill every closed tab. Bind the generation to a presence lease instead.
Contract Tests for a LangGraph Agent: Test the Property, Not the Setting
Build a pytest suite that checks fan-out width, merge order, spend across resumes, and spend after a crash - and watch a setting-shaped fix fail each one.
How to Build a Claude Code Agent Loop That Cannot Run Away
Build a loop that reruns every failing test before it touches code, fixes only the failures that reproduce, and is stopped by a hook its own instructions cannot override.
MCP with LangGraph: A Practical 2026 Walkthrough
Your checkpoint is durable. The handle inside it is not. Nothing in either system compares the two.
Build a Kill Switch for a LangGraph Agent
Four independent mechanisms - a tool-call interceptor, a watchdog, an anomaly detector, and a manual override - that stop it even when it will not stop itself.
How SynthID Works: Build a Watermark in Python
Build the green-list watermark on GPT-2 and detect it from text alone at p = 3.07e-56. Then find out how few tokens it needs and how much editing it survives.
Superpowers Plugin for Claude Code: Install and Verify
Install it, prove which skills actually fire, and measure what it costs you - then switch it off where it does not belong.
BM25 vs Dense Retrieval: Measure It on Your Own Corpus
Build a bake-off harness that runs BM25, dense, hybrid, and reranked retrieval over a labelled query set - and tells you with Recall@k, nDCG, and cost per query which one your RAG system actually needs.
How to Rerank Retrieval Results with a Cross-Encoder
Build a two-stage search pipeline and measure the reranking gain yourself, in NDCG@10, on your own machine.
Building a Production MCP Server: Architecture, Pitfalls, and Best Practices
The four-layer architecture that survives an adversarial LLM client, rewritten for the stateless spec.
Claude Code Guide: Build Agentic Workflows with Commands, MCP, and Subagents
*A practical guide to using Claude Code as a programmable agent with commands, skills, memory, hooks, and MCP.* Most developers try Claude Code once, get med...
Building an MCP Server for Non-LLM Clients (CLIs, IDEs, Pipelines)
## The Problem: Context Access Is Locked Behind LLM Abstractions You've built an MCP server that provides rich context from your organization's systems—code ...
How to Build a Hybrid Search Service with BM25 and Docker
Fuse BM25 with dense retrieval, tune the fusion weight on real relevance judgments, and ship the whole thing as a container that shows you every stage's score.
Building Privacy-Preserving Machine Learning Applications in Python with Homomorphic Encryption
Data privacy is one of the biggest challenges in deploying AI systems. From healthcare to finance, sensitive datasets are often required to train or run machine...
Provenance in AI: Building a Provenance Graph with Neo4j – Part 3
In [Part 2](https://ranjankumar.in/provenance-in-ai-tracking-ai-lineage-with-signed-provenance-logs-in-python-part-2/), we built a `ProvenanceTracker` that gene...
Prompt Engineering Deep Dive: Parameters, Chains, Reasoning, and Guardrails
## 1\. Introduction Prompt engineering is the practice of designing and refining the text (prompt) that we pass to a Generative AI (GenAI) model. The prompt ...
LLM Text Clustering and Topic Modeling: HDBSCAN and BERTopic Tutorial
**Master semantic document clustering using embeddings, UMAP, HDBSCAN, and BERTopic** ## Quick Start: 5-Minute Text Clustering Want to see text clustering...
Hands-on Tutorial on Making an Audio Bot using LLM, and RAG
## 1\. Learning Outcome 1. Learn about Large Language Models (LLMs), their installation, access through HTTP API, the Ollama framework, etc. 3. Introducti...
Fine-Tuning Cross-Encoders: When Accuracy Matters More Than Speed (A Practical Guide)
Most tutorials will tell you to use bi-encoders for semantic search. They're fast, they scale, they work. And for 80% of use cases, that's the right answer. ...
Install, run, and access Llama using Ollama
@[youtube](https://youtu.be/luW9-XkP5Fs) ## Learning Outcome In this post, we will learn about: 1. What is Ollama? 3. How do you install the Llama m...
How to Record, Save and Play Audio in Python
Build a working voice recorder in about twenty minutes, on a stack that still installs on current Python.