Jatin Bansal
Long-form notes by Jatin Bansal. Loosely organized. Updated as I learn.
Chunking Strategies for Retrieval
Why chunk size is the most undertuned variable in RAG, how recursive, semantic, and structural chunking differ, and when parent-document retrieval beats them all.
Vector Databases & ANN Indexes
How HNSW, IVF, and ScaNN trade recall for speed, why exact KNN doesn't scale, and how to choose between pgvector, Qdrant, and Pinecone for production use.
Text Embeddings: Turning Meaning into Geometry
How embedding models encode text as dense vectors, why cosine similarity measures semantic distance, and how to build semantic search in Python and TypeScript.
LLM Inference: Tokens, Context, and Sampling
How LLMs actually process text: tokenization with BPE, the context window as working memory, KV caching, and sampling parameters that control 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.