Jatin Bansal
Long-form notes by Jatin Bansal. Loosely organized. Updated as I learn.
Chunking Strategies for Retrieval
Why chunk size is RAG's most undertuned variable, how recursive, semantic, and structural chunking differ, and when parent-document retrieval wins.
Vector Databases & ANN Indexes
How HNSW, IVF, and ScaNN trade recall for speed, why exact KNN doesn't scale, and how to pick between pgvector, Qdrant, and Pinecone in production.
Text Embeddings: Turning Meaning into Geometry
How embedding models encode text as dense vectors, why cosine similarity captures meaning, and how to build semantic search in Python and TypeScript.
LLM Inference: Tokens, Context, and Sampling
How LLMs process text: BPE tokenization, the context window as working memory, KV caching, and sampling parameters that shape output variance.
Writing Event Loops with Java Virtual Threads
A practical guide to writing small event loops in Java 21 and Java 25 using virtual threads, blocking queues, direct control flow, and graceful shutdown.
Context vs Prompt Engineering: The Evolution from Instructions to Intelligence
Exploring the shift from prompt engineering to context engineering in AI systems, understanding context rot, and why managing context is becoming more critical than crafting prompts.
StampedLock: How to Use Locks with Near Lock-Free Reads in Java
Learn how Java’s StampedLock enables near lock-free reads with optimistic locking, why it’s useful for virtual threads and read-heavy workloads, and how to use it safely.