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 ClassesModifier and TypeClassDescriptionstatic final classBuilder starting from the framework defaults. -
Constructor Summary
ConstructorsConstructorDescriptionRetrievalConfig(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 aRetrievalConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RetrievalConfig.Builderbuilder()booleancache()Returns the value of thecacherecord component.intcacheTTL()Returns the value of thecacheTTLrecord component.Returns the value of thecontextFormatrecord component.intReturns the value of thecontextWindowrecord component.doubleReturns the value of thededupeThresholdrecord component.booleanReturns the value of thededuplicaterecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theexpandedQueriesrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theincludeSpecrecord component.intReturns the value of themaxStalenessrecord component.doubleminScore()Returns the value of theminScorerecord component.Returns the value of thenavigatorModelrecord component.Returns the value of theonFailurerecord component.Returns the value of thequeryExpansionrecord component.Returns the value of thequeryExpansionModelrecord component.Returns the value of thequeryParamrecord component.booleanrerank()Returns the value of thererankrecord component.Returns the value of thererankerModelrecord component.sources()Returns the value of thesourcesrecord component.strategy()Returns the value of thestrategyrecord component.inttopK()Returns the value of thetopKrecord component.inttopN()Returns the value of thetopNrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aRetrievalConfigrecord class.- Parameters:
strategy- the value for thestrategyrecord componentsources- the value for thesourcesrecord componentqueryParam- the value for thequeryParamrecord componentrerank- the value for thererankrecord componentrerankerModel- the value for thererankerModelrecord componentcontextWindow- the value for thecontextWindowrecord componenttopK- the value for thetopKrecord componenttopN- the value for thetopNrecord componentminScore- the value for theminScorerecord componentdeduplicate- the value for thededuplicaterecord componentdedupeThreshold- the value for thededupeThresholdrecord componentqueryExpansion- the value for thequeryExpansionrecord componentqueryExpansionModel- the value for thequeryExpansionModelrecord componentnavigatorModel- the value for thenavigatorModelrecord componentexpandedQueries- the value for theexpandedQueriesrecord componentincludeSpec- the value for theincludeSpecrecord componentcontextFormat- the value for thecontextFormatrecord componentcache- the value for thecacherecord componentcacheTTL- the value for thecacheTTLrecord componentmaxStaleness- the value for themaxStalenessrecord componentonFailure- the value for theonFailurerecord component
-
-
Method Details
-
builder
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
strategy
Returns the value of thestrategyrecord component.- Returns:
- the value of the
strategyrecord component
-
sources
Returns the value of thesourcesrecord component.- Returns:
- the value of the
sourcesrecord component
-
queryParam
Returns the value of thequeryParamrecord component.- Returns:
- the value of the
queryParamrecord component
-
rerank
public boolean rerank()Returns the value of thererankrecord component.- Returns:
- the value of the
rerankrecord component
-
rerankerModel
Returns the value of thererankerModelrecord component.- Returns:
- the value of the
rerankerModelrecord component
-
contextWindow
public int contextWindow()Returns the value of thecontextWindowrecord component.- Returns:
- the value of the
contextWindowrecord component
-
topK
public int topK()Returns the value of thetopKrecord component.- Returns:
- the value of the
topKrecord component
-
topN
public int topN()Returns the value of thetopNrecord component.- Returns:
- the value of the
topNrecord component
-
minScore
public double minScore()Returns the value of theminScorerecord component.- Returns:
- the value of the
minScorerecord component
-
deduplicate
public boolean deduplicate()Returns the value of thededuplicaterecord component.- Returns:
- the value of the
deduplicaterecord component
-
dedupeThreshold
public double dedupeThreshold()Returns the value of thededupeThresholdrecord component.- Returns:
- the value of the
dedupeThresholdrecord component
-
queryExpansion
Returns the value of thequeryExpansionrecord component.- Returns:
- the value of the
queryExpansionrecord component
-
queryExpansionModel
Returns the value of thequeryExpansionModelrecord component.- Returns:
- the value of the
queryExpansionModelrecord component
-
expandedQueries
public int expandedQueries()Returns the value of theexpandedQueriesrecord component.- Returns:
- the value of the
expandedQueriesrecord component
-
includeSpec
public boolean includeSpec()Returns the value of theincludeSpecrecord component.- Returns:
- the value of the
includeSpecrecord component
-
contextFormat
Returns the value of thecontextFormatrecord component.- Returns:
- the value of the
contextFormatrecord component
-
cache
public boolean cache()Returns the value of thecacherecord component.- Returns:
- the value of the
cacherecord component
-
cacheTTL
public int cacheTTL()Returns the value of thecacheTTLrecord component.- Returns:
- the value of the
cacheTTLrecord component
-
maxStaleness
public int maxStaleness()Returns the value of themaxStalenessrecord component.- Returns:
- the value of the
maxStalenessrecord component
-
onFailure
Returns the value of theonFailurerecord component.- Returns:
- the value of the
onFailurerecord component
-