@Logan M Is there a way to check what files are pulled from the filter? or is it only pulling text nodes. I'm implementing this feature in CRAG so the filter is implemented here:
llama-index/packs/corrective_rag/base.py:
def retrieve_nodes(self, query_str: str, **kwargs: Any) -> List[NodeWithScore]:
"""Retrieve the relevant nodes for the query."""
retriever = self.index.as_retriever(filtering_list=self.filtering_list, **kwargs)
return retriever.retrieve(query_str)
and then for the as_retriever() method for leveraging the filters I just added the parameter implemented in VectorIndexRetriever() class to one of the parameters as retriever takes advantage of:
def as_retriever(self,filtering_list: Any, **kwargs: Any) -> BaseRetriever:
# NOTE: lazy import
from llama_index.core.indices.vector_store.retrievers import (
VectorIndexRetriever,
)
return VectorIndexRetriever(
self,
filters=filtering_list,
node_ids=list(self.index_struct.nodes_dict.values()),
callback_manager=self._callback_manager,
object_map=self._object_map,
**kwargs,
)
The system works but I don't know if its because my question contains two different Metadata ID's that are being called into the filter