AI / LlamaIndex Interview Questions
How do node postprocessors work in LlamaIndex?
Node postprocessors run after retrieval but before synthesis, taking the list of retrieved Nodes and filtering, reordering, or re-scoring them before they reach the LLM.
Common examples include SimilarityPostprocessor, which drops Nodes below a similarity score cutoff; KeywordNodePostprocessor, which requires or excludes certain keywords; LongContextReorder, which repositions the most relevant Nodes toward the start and end of the context to counter the "lost in the middle" effect; and reranking postprocessors like CohereRerank or LLMRerank, which re-score an over-fetched candidate set with a more accurate model and keep only the top few.
They're attached via the node_postprocessors argument when creating a query engine, and multiple can be chained, running in the order they're listed.
More Related questions...