Find answers from the community

s
F
Y
a
P
Updated last year

Add data to nodes

I have a keyword graph built on top of vector indexes. Is there a way to add some data (meta data) to the response of each index before they are being forwarded to the graph which produces the final answer?
L
y
10 comments
Hmm not too easy. You'd have to probably create a custom retriever for the sub indexes in the graph and add it to their query engines.

In the custom retriever, you can do whatever you want as long as you return a list of nodes
Thanks, will look into it
Another question that may help me achieving this from another direction: I added each paragraph the ID, so basically I tried running the query with response_mode='no_text'.
The problem is that those nodes are not being put in the response
So the root index gets None as context while I would want it to get those paragraphs
That response mode means that the nodes are retrieved, but not sent to the LLM. You can access them from the response.source_nodes attribute, but I'm not totally sure if that's what you intended? πŸ€”
No, because the root node only gets the responses of the sub indexes
But they are all none
I would want the response to actually include the top 1 chunk without running any LLMs (only 1 llm for the top node to produce the aggregated answer)
Uhhh not totally sure how possible that is. I think you'd have to write a custom retriever for the top level index
Add a reply
Sign up and join the conversation on Discord