Find answers from the community

Updated 2 months ago

Is it possible to obtain the complete

Is it possible to obtain the complete set of nodes from a query engine, including those results that were initially retrieved but later excluded by the node processor? My goal is to use the top N documents for LLM with the node postprocessor while also having access to the full list of results initially retrieved by the retriever.
L
J
4 comments
I think if you use a custom callback, you could hook into that

But tbh it's probably easier to use the retriever + node postrprocessors + response synthesizer seperately instead of relying on a query engine
Plain Text
retriever = index.as_retreiver(similarity_top_k=2)

from llama_index import get_response_synthesizer
response_synthesizer = get_response_synthesizer()

nodes = retriver.retrieve(query_str)
nodes = postprocessor.postprocess_nodes(nodes)

response = response_synthesizer.synthesize(query_str, nodes=nodes)
full control πŸ™‚
Ahh this is perfect. Thanks a lot
Add a reply
Sign up and join the conversation on Discord