Find answers from the community

Updated 2 years ago

Ensure nodes appear

At a glance

The community members are discussing how to ensure certain nodes always appear in a vector-search query, particularly in the context of call transcripts where the first and last chunks may need to be included. One community member suggests subclassing a new retriever or query engine as a "sneaky" way to achieve this. Another community member provides an example of a custom retriever that can be used to return the desired nodes. The community members seem interested in exploring this approach further and are open to any additional suggestions or code samples.

Useful resources
Is there any way to ensure certain nodes always appear in a vector-search query? For example, in call transcripts, sometimes you want the first and last chunks to be included.
L
a
5 comments
Hmm you could maybe do something sneaky if you subclass a new retriever or query engine πŸ€”
Sneaky is good! @Logan M
Yeah I'll check those out, and if you have any suggestions / code samples, these would be helpful as well
Here's an example of a custom retriever

You can do anything you want here, as long as you return nodes πŸ’ͺ

https://github.com/jerryjliu/llama_index/blob/main/examples/query/CustomRetrievers.ipynb
@Logan M sweet thank you πŸ™
Add a reply
Sign up and join the conversation on Discord