Find answers from the community

Updated 9 months ago

how can I leverage on the metadata extracted (Keyword, QuestionAnswered, etc...) during th

@kapa.ai how can I leverage on the metadata extracted (Keyword, QuestionAnswered, etc...) during the retriveal phase?
k
3 comments
Please stand by @Leonardo Oliva as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
You can leverage the extracted metadata during the retrieval phase by using it to improve the accuracy and recall of your search queries. This can be done by incorporating the metadata into your query string or using it as filters when performing a semantic search in your vector database.

In LlamaIndex, you can perform auto-retrieval which allows for more dynamic, expressive forms of retrieval beyond top-k semantic search. Given a natural language query, you can use the LLM to infer a set of metadata filters as well as the right query string to pass to the vector db. This overall query bundle is then executed against the vector db. This allows for more dynamic, expressive forms of retrieval beyond top-k semantic search. The relevant context for a given query may only require filtering on a metadata tag, or require a joint combination of filtering + semantic search within the filtered set, or just raw semantic search. source ()

Another way to leverage the extracted metadata is through dynamic metadata retrieval. This involves retrieving relevant few-shot examples of metadata to help the LLM better infer the correct metadata filters. This can prevent the LLM from making mistakes when inferring “where” clauses, especially around aspects like spelling / correct formatting of the value. source ()
Remember, the effectiveness of these methods can be improved further with more rigorous evaluation of both the metadata extraction accuracy, and the accuracy and recall of the QnA pipeline. source ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord