spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/index.html
Apache License 2.0
3.32k stars 850 forks source link

Support for FILTER_EXPRESSION with RetrievalAugmentationAdvisor #1776

Open habuma opened 2 days ago

habuma commented 2 days ago

As RetrievalAugmentationAdvisor is expected to replace QuestionAnswerAdvisor, it should also support FILTER_EXPRESSION the way that QuestionAnswerAdvisor does.

This makes it possible to configure the advisor as a default advisor when creating a ChatClient and then plug in a filter expression for searching the vector store when submitting a prompt.

I suspect, based on how this works with RetrievalAugmentationAdvisor that the change required would be made to VectorStoreDocumentRetriever, as that's the place and implementation of DocumentRetriever that would be able to make use of the expression.