Package com.tnsai.rag

Record Class RetrievalEvidence.Provenance

java.lang.Object
java.lang.Record
com.tnsai.rag.RetrievalEvidence.Provenance
Record Components:
sourceName - canonical KnowledgeSourceConfig.name()
documentId - stable document or chunk identity
location - optional external location such as a file path or URI
score - strategy-specific relevance score
rank - one-based rank in the returned result
strategy - executed retrieval strategy, or configured fallback for DIRECT
Enclosing class:
RetrievalEvidence

public static record RetrievalEvidence.Provenance(String sourceName, String documentId, String location, double score, int rank, Search.Strategy strategy) extends Record
Stable provenance required for audit, citation, and diagnostics.

Scores are required to be finite but are not constrained to 0..1; keyword and graph strategies may use other score ranges.

  • Constructor Details

    • Provenance

      public Provenance(String sourceName, String documentId, String location, double score, int rank, Search.Strategy strategy)
      Validates provenance fields.
  • Method Details

    • 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.
    • sourceName

      public String sourceName()
      Returns the value of the sourceName record component.
      Returns:
      the value of the sourceName record component
    • documentId

      public String documentId()
      Returns the value of the documentId record component.
      Returns:
      the value of the documentId record component
    • location

      public String location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • score

      public double score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component
    • rank

      public int rank()
      Returns the value of the rank record component.
      Returns:
      the value of the rank record component
    • strategy

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