topic: RAG Retrieval, Step by Step
Hybrid Search
Combine BM25 and semantic search with Reciprocal Rank Fusion, tune retriever weights, and implement hybrid retrieval with LangChain, FAISS, and Google embeddings.
Blog
Filter by tag or collection, then open each note for Markdown-based writeups from daily learning, courses, books, and technical topics.
topic: RAG Retrieval, Step by Step
Combine BM25 and semantic search with Reciprocal Rank Fusion, tune retriever weights, and implement hybrid retrieval with LangChain, FAISS, and Google embeddings.
topic: RAG Retrieval, Step by Step
Retrieve precise child chunks and return larger parent context to the LLM, with evaluation guidance, trade-offs, and a LangChain example.
topic: RAG Retrieval, Step by Step
Rerank retrieved candidates before generation, understand recall and latency trade-offs, and use Google's Ranking API in a RAG pipeline.
topic: RAG Retrieval, Step by Step
How BM25 uses term frequency, inverse document frequency, and document length for keyword retrieval, its strengths with exact identifiers, and a practical LangChain example.
topic: RAG Chunking, Step by Step
How contextual retrieval restores document context before embedding, with prompt caching, retrieval failure-rate results, and a practical Gemini example.
topic: RAG Chunking, Step by Step
How fixed chunking uses chunk size and overlap to prepare documents for retrieval, with practical trade-offs and a LangChain example.
topic: RAG Chunking, Step by Step
How recursive chunking preserves document structure through progressively smaller separators, with size constraints, overlap, and a Gemini token-counting example.
topic: RAG Chunking, Step by Step
How semantic chunking uses embedding distances to detect topic changes, with variable-sized chunks, ingestion trade-offs, and a LangChain example.
topic: RAG Retrieval, Step by Step
How semantic search uses embeddings and vector similarity to retrieve relevant chunks, its limitations with exact identifiers, and a practical LangChain, Google embeddings, and FAISS example.
topic: RAG Chunking, Step by Step
In a RAG system, a language model does not depend only on what it learned during training. Before generating an answer, the system searches external documents and sends the relevant information to the model.
topic: RAG Chunking, Step by Step
Fixed-size chunking is the simplest way to divide a document.
topic: RAG Chunking, Step by Step
Fixed-size chunking uses one main rule:
topic: RAG Chunking, Step by Step
Recursive chunking uses document structure to create better boundaries.
topic: RAG Chunking, Step by Step
Fixed-size, recursive, and semantic chunking mainly differ in how they select boundaries.
topic: RAG Chunking, Step by Step
A production chunking strategy should begin with the document, not with the most advanced algorithm.
topic: LeetCode Problems
Learn how to count good nodes in a binary tree by carrying the maximum value seen along each root-to-node path with recursive DFS.
topic: LeetCode Problems
Learn how inorder traversal turns a binary search tree into sorted order and lets us stop early at the kth smallest value.
topic: LeetCode Problems
Learn how to validate a binary search tree by carrying strict lower and upper bounds through a depth-first traversal.
topic: LeetCode Problems
Learn how to compare two binary trees node by node using synchronized recursive depth-first search in C++.
topic: LeetCode Problems
Learn how to find the lowest common ancestor of two nodes by using the ordering property of a binary search tree.
topic: LeetCode Problems
Learn how to detect an exact binary-tree subtree by combining depth-first search with a recursive same-tree comparison.
topic: LeetCode Problems
Learn how recursive depth-first search computes the maximum depth of a binary tree, with intuition, correctness proof, complexity analysis, and C++ code.
topic: LeetCode Problems
Learn how to solve LeetCode Contains Duplicate efficiently in C++ using an unordered_set, with intuition, correctness analysis, and a step-by-step walkthrough.
topic: LeetCode Problems
Learn how to invert a binary tree by swapping every node's left and right children with a simple recursive depth-first search.
course: Introduction to Machine Learning
Build a rigorous foundation for machine learning through supervised and unsupervised learning, generalization, inductive bias, evaluation, and the statistical view before studying individual algorithms.
topic: Machine Learning Algorithms
Build Linear Regression from simple and multiple prediction through residual loss, model limitations, Lasso and Ridge regularization, and leakage-safe cross-validation.
topic: LeetCode Problems
Learn how to count car fleets by sorting cars by position, calculating arrival times, and maintaining a monotonic stack.
topic: LeetCode Problems
Learn how to find the next warmer day efficiently using a monotonic stack, with a correctness proof and detailed complexity analysis.
topic: Machine Learning Algorithms
Derive hard-margin Support Vector Machines from geometric distance and maximum-margin boundary selection through support vectors, duality, limitations, and a leakage-safe scikit-learn workflow.
topic: LeetCode Problems
Learn how to evaluate a Reverse Polish Notation expression efficiently in C++ by using a stack to store operands and intermediate results.
topic: Machine Learning Algorithms
Build Logistic Regression from the linear score to sigmoid probabilities, log-odds, cross-entropy, gradient updates, softmax, and a leakage-safe scikit-learn pipeline.
topic: LeetCode Problems
Learn how to design a stack that supports push, pop, top, and minimum retrieval in constant time by storing the minimum at every stack state.
topic: LeetCode Problems
Learn how to validate nested brackets using a stack, understand the LIFO pattern, prove correctness, and analyze the time and space complexity.
topic: Machine Learning Algorithms
Build an intuitive and mathematical understanding of the Perceptron through a machine-monitoring classification example, from decision boundaries and weight updates to limitations and scikit-learn.