RAG Retrieval and Generation: Similarity Search, MMR and Stuffing
Retrieval decides what the model sees, and that decides the answer. This post covers similarity search, MMR for diversity, retrievers, and stuffing documents into a prompt.
Latest articles, tutorials, and deep dives from ndlab tech blog.
Retrieval decides what the model sees, and that decides the answer. This post covers similarity search, MMR for diversity, retrievers, and stuffing documents into a prompt.
Embeddings turn text into coordinates and a vector store makes them searchable. This post builds the store, persists it, and shows exactly what Chroma holds inside.
Loading a PDF is easy; splitting it well is where RAG quality is decided. This post covers loaders, chunk size and overlap, and a splitter that silently does nothing.
A model cannot answer from documents it was never trained on. This post explains what RAG is, how its two paths work, and when fine-tuning is the wrong answer to it.
A straight line is the easy case. This post covers piping chains together, fanning out with RunnableParallel, wrapping your own functions, and drawing what you built.
A single pipe operator turns three objects into a pipeline that batches, streams and runs async for free. Here is how, plus the step that silently breaks streaming.
Results