Framework Fluency: LlamaIndex: overview
- Source
- From the RAG & Agents Engineering course
- By
- Sourav Banerjee
- Last updated
- 8 Nov 2026
T6.6 rebuilds pipelines you already know from the LangChain modules in LlamaIndex: a plain vector RAG, hybrid fusion, reranking and an enrichment window. The ideas are the same; the class names and several defaults change. The T6.6 notebooks build on four ideas: the Node as the unit LlamaIndex indexes, the QueryEngine that wraps retrieval and answering, the postprocessors that edit the retrieved list in between, and the sentence window that retrieves one sentence and sends its neighbours.
The notebooks run on a 33-page climate-change PDF and a 100-row customer CSV. These pages and the lab use the Larkspur Cloud handbook from T5.1 to T5.3, loaded as two Documents: the refunds section from T5.3 and a short exports section. Three golden questions carry the module: Can I get a refund on an annual plan after 45 days?, How long does a refund take to appear? and Can I export my data after I cancel my plan? The first one is the hard case. Its best-matching sentence is the 30-day full-refund rule, and the answer sits in the sentence after it.
In short
- A LlamaIndex Node is a chunk with an id, metadata and links to its source Document and its neighbours.
chunk_sizecounts tokens, and the metadata string counts against it: on the notebook's PDF the page label and file path take 38 of the 200 tokens. index.as_query_engine()builds a retriever, a list of node postprocessors and a response synthesizer, and returns the answer with itssource_nodes. Check the defaults:similarity_top_kis 2, andQueryFusionRetrievermakes 4 queries (3 of them written by the LLM) unless you setnum_queries=1.- Postprocessors run in list order on the retrieved nodes. On the handbook, retrieving 10 sentences and letting the
ms-marco-MiniLM-L-6-v2cross-encoder keep 2 brings in the prorated-refund rule that plain top-2 retrieval misses. - A sentence window embeds one sentence and sends up to
window_sizesentences on each side. In the lab the retrieval scores are identical for every window size; only the text the LLM reads changes, from 142 characters for the bare sentence to 621 at the notebook'swindow_size=3. - The notebooks pass a FAISS store to
IngestionPipelinewithout an embedding step, so FAISS stays empty andVectorStoreIndex(nodes)builds a second, in-memory index. Read what each object actually holds before trusting a port.
Mental model
- A reader loads the handbook’s two sections as 2 Documents.
- The transformations run in order and turn the Documents into 17 nodes.
- Each node is embedded and stored in the VectorStoreIndex.
- A customer asks “Can I get a refund on an annual plan after 45 days?”
- The retriever returns the similarity_top_k nearest nodes with their scores.
- Each node postprocessor edits the list in turn: rerank, filter or swap in a window.
- The synthesizer writes the answer and returns it with the source nodes it used.
Interactive lab
Sentence window lab: open the file in a browser. Pick Can I get a refund on an annual plan after 45 days? with window_size at 0: the model gets the 30-day rule and no answer. Move it to 1 and the prorated rule arrives in 284 characters. Then pick the export question, where the window stops growing at 2 because the exports Document has only four sentences, and set similarity_top_k to 2 on the refund-timing question to see neighbouring windows send the same sentences twice.
How it connects
- Before: T5.1 is the lifecycle this module renames. T5.3 wrote the refunds section and the small-chunk trade-off the sentence window answers. T6.1 covers score fusion and rank fusion in LangChain, and T6.3 covers cross-encoder and LLM reranking and character-based enrichment windows.
- Next: T7.1 starts T9, where the retriever becomes one tool an agent can call; T9.4 wraps a RAG pipeline as that tool.
Key Takeaways
- Map the concepts first: Document and Node, retriever, postprocessor, QueryEngine. Then read the defaults, because they differ from LangChain's.
- Check what each component holds after the pipeline runs: vectors in the store, metadata in the embedding text, and the score direction of every retriever.
- Put reranking, filtering and window replacement in
node_postprocessors, in the order you want them applied. - Retrieve small, send big: a sentence window keeps the retrieval scores of a sentence and gives the model the paragraph around it. Size the window per question type and watch overlap when
kis above 1.