Find answers from the community

Updated 2 months ago

Retrieve

Hi all.
I am currently using QueryFusionRetriever for querying, but I am facing an issue where it cannot fetch additional related nodes to answer a question; it only relies on the information from one node that it finds. For example, if I have a question whose answer lies across three consecutive nodes with relationships, the results only provide data from the first node. How can I retrieve the information from all three nodes? Here is my code:

retriever = QueryFusionRetriever(
indexes,
similarity_top_k=6,
num_queries=3,
mode="simple", #reciprocal_rerank
use_async=True,
verbose=True,
)

Thank you!
L
B
5 comments
I don't think the query fusion retriever has anything to do with this πŸ‘€

I'd run my retriever, and then make a custom node postrpocessor to read the relationships and grab then extra info?
I think that's necessary because sometimes the data is quite long and one node is not enough to store all the content. Therefore, fetching additional related nodes to provide the most complete answer is essential.
Yea sure. So you can run a any retriever and then use a node postrprocessor to read the relations and add the extra nodes
Can you give me an example of how to handle this part?
Define a custom node post processor
https://docs.llamaindex.ai/en/stable/module_guides/querying/node_postprocessors/#custom-node-postprocessor

Throw that into your query engine,
RetrieverQueryEngine.from_args(retrievers, ..., node_postprocessors=[CustomNodePostProcessor()])

or manually run it after calling your retriever
Add a reply
Sign up and join the conversation on Discord