Class EmbeddingStoreContentRetriever

  • All Implemented Interfaces:
    dev.langchain4j.rag.content.retriever.ContentRetriever

    
    public class EmbeddingStoreContentRetriever
     implements ContentRetriever
                        

    A ContentRetriever that retrieves from an EmbeddingStore. By default, it retrieves the 3 most similar Contents to the provided Query, without any Filtering. Configurable parameters (optional): - displayName: Display name for logging purposes, e.g. when multiple instances are used. - maxResults: The maximum number of Contents to retrieve. - dynamicMaxResults: It is a Function that accepts a Query and returns a maxResults value. It can be used to dynamically define maxResults value, depending on factors such as the query, the user (using Metadata#chatMemoryId()} from metadata), etc. - minScore: The minimum relevance score for the returned Contents. Contents scoring below #minScore are excluded from the results. - dynamicMinScore: It is a Function that accepts a Query and returns a minScore value. It can be used to dynamically define minScore value, depending on factors such as the query, the user (using Metadata#chatMemoryId()} from metadata), etc. - filter: The Filter that will be applied to a dev.langchain4j.data.document.Metadata in the textSegment. - dynamicFilter: It is a Function that accepts a Query and returns a filter value. It can be used to dynamically define filter value, depending on factors such as the query, the user (using Metadata#chatMemoryId()} from metadata), etc.