Package com.tnsai.rag

Record Class RetrievalConfig

java.lang.Object
java.lang.Record
com.tnsai.rag.RetrievalConfig

public record RetrievalConfig(Search.Strategy strategy, List<String> sources, String queryParam, boolean rerank, String rerankerModel, int contextWindow, int topK, int topN, double minScore, boolean deduplicate, double dedupeThreshold, Search.QueryExpansion queryExpansion, String queryExpansionModel, String navigatorModel, int expandedQueries, boolean includeSpec, String contextFormat, boolean cache, int cacheTTL, int maxStaleness, Search.FallbackAction onFailure) extends Record
Immutable runtime configuration for action-level retrieval.

Annotation and builder declarations converge on this model while the RetrievalSpi invocation contract remains unchanged.

For ordinary ranked retrieval, minScore is a monotonic strategy-output threshold: increasing it can only remove candidates. Strategies retain their documented score model; HYBRID exposes RRF scores normalized to 0.0..1.0 over the non-empty input streams, where 0.0 preserves every HYBRID candidate.

Since:
0.13.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Builder starting from the framework defaults.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RetrievalConfig(Search.Strategy strategy, List<String> sources, String queryParam, boolean rerank, String rerankerModel, int contextWindow, int topK, int topN, double minScore, boolean deduplicate, double dedupeThreshold, Search.QueryExpansion queryExpansion, String queryExpansionModel, String navigatorModel, int expandedQueries, boolean includeSpec, String contextFormat, boolean cache, int cacheTTL, int maxStaleness, Search.FallbackAction onFailure)
    Creates an instance of a RetrievalConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    Returns the value of the cache record component.
    int
    Returns the value of the cacheTTL record component.
    Returns the value of the contextFormat record component.
    int
    Returns the value of the contextWindow record component.
    double
    Returns the value of the dedupeThreshold record component.
    boolean
    Returns the value of the deduplicate record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the expandedQueries record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the includeSpec record component.
    int
    Returns the value of the maxStaleness record component.
    double
    Returns the value of the minScore record component.
    Returns the value of the navigatorModel record component.
    Returns the value of the onFailure record component.
    Returns the value of the queryExpansion record component.
    Returns the value of the queryExpansionModel record component.
    Returns the value of the queryParam record component.
    boolean
    Returns the value of the rerank record component.
    Returns the value of the rerankerModel record component.
    Returns the value of the sources record component.
    Returns the value of the strategy record component.
    int
    Returns the value of the topK record component.
    int
    Returns the value of the topN record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RetrievalConfig

      public RetrievalConfig(Search.Strategy strategy, List<String> sources, String queryParam, boolean rerank, String rerankerModel, int contextWindow, int topK, int topN, double minScore, boolean deduplicate, double dedupeThreshold, Search.QueryExpansion queryExpansion, String queryExpansionModel, String navigatorModel, int expandedQueries, boolean includeSpec, String contextFormat, boolean cache, int cacheTTL, int maxStaleness, Search.FallbackAction onFailure)
      Creates an instance of a RetrievalConfig record class.
      Parameters:
      strategy - the value for the strategy record component
      sources - the value for the sources record component
      queryParam - the value for the queryParam record component
      rerank - the value for the rerank record component
      rerankerModel - the value for the rerankerModel record component
      contextWindow - the value for the contextWindow record component
      topK - the value for the topK record component
      topN - the value for the topN record component
      minScore - the value for the minScore record component
      deduplicate - the value for the deduplicate record component
      dedupeThreshold - the value for the dedupeThreshold record component
      queryExpansion - the value for the queryExpansion record component
      queryExpansionModel - the value for the queryExpansionModel record component
      navigatorModel - the value for the navigatorModel record component
      expandedQueries - the value for the expandedQueries record component
      includeSpec - the value for the includeSpec record component
      contextFormat - the value for the contextFormat record component
      cache - the value for the cache record component
      cacheTTL - the value for the cacheTTL record component
      maxStaleness - the value for the maxStaleness record component
      onFailure - the value for the onFailure record component
  • Method Details

    • builder

      public static RetrievalConfig.Builder builder()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • strategy

      public Search.Strategy strategy()
      Returns the value of the strategy record component.
      Returns:
      the value of the strategy record component
    • sources

      public List<String> sources()
      Returns the value of the sources record component.
      Returns:
      the value of the sources record component
    • queryParam

      public String queryParam()
      Returns the value of the queryParam record component.
      Returns:
      the value of the queryParam record component
    • rerank

      public boolean rerank()
      Returns the value of the rerank record component.
      Returns:
      the value of the rerank record component
    • rerankerModel

      public String rerankerModel()
      Returns the value of the rerankerModel record component.
      Returns:
      the value of the rerankerModel record component
    • contextWindow

      public int contextWindow()
      Returns the value of the contextWindow record component.
      Returns:
      the value of the contextWindow record component
    • topK

      public int topK()
      Returns the value of the topK record component.
      Returns:
      the value of the topK record component
    • topN

      public int topN()
      Returns the value of the topN record component.
      Returns:
      the value of the topN record component
    • minScore

      public double minScore()
      Returns the value of the minScore record component.
      Returns:
      the value of the minScore record component
    • deduplicate

      public boolean deduplicate()
      Returns the value of the deduplicate record component.
      Returns:
      the value of the deduplicate record component
    • dedupeThreshold

      public double dedupeThreshold()
      Returns the value of the dedupeThreshold record component.
      Returns:
      the value of the dedupeThreshold record component
    • queryExpansion

      public Search.QueryExpansion queryExpansion()
      Returns the value of the queryExpansion record component.
      Returns:
      the value of the queryExpansion record component
    • queryExpansionModel

      public String queryExpansionModel()
      Returns the value of the queryExpansionModel record component.
      Returns:
      the value of the queryExpansionModel record component
    • expandedQueries

      public int expandedQueries()
      Returns the value of the expandedQueries record component.
      Returns:
      the value of the expandedQueries record component
    • includeSpec

      public boolean includeSpec()
      Returns the value of the includeSpec record component.
      Returns:
      the value of the includeSpec record component
    • contextFormat

      public String contextFormat()
      Returns the value of the contextFormat record component.
      Returns:
      the value of the contextFormat record component
    • cache

      public boolean cache()
      Returns the value of the cache record component.
      Returns:
      the value of the cache record component
    • cacheTTL

      public int cacheTTL()
      Returns the value of the cacheTTL record component.
      Returns:
      the value of the cacheTTL record component
    • maxStaleness

      public int maxStaleness()
      Returns the value of the maxStaleness record component.
      Returns:
      the value of the maxStaleness record component
    • onFailure

      public Search.FallbackAction onFailure()
      Returns the value of the onFailure record component.
      Returns:
      the value of the onFailure record component