Class RagSearchResult

java.lang.Object
ai.vectros.types.RagSearchResult

public final class RagSearchResult extends Object
  • Method Details

    • getDocumentId

      public String getDocumentId()
      Returns:
      The stable identifier of the matched result (a document or a record).
    • getScore

      public double getScore()
      Returns:
      The combined relevance score from hybrid ranking. Higher is more relevant.
    • getTextScore

      public Optional<Double> getTextScore()
      Returns:
      The keyword (BM25) relevance score, from 0 to 1. Null when this match came from semantic search only.
    • getSemanticScore

      public Optional<Double> getSemanticScore()
      Returns:
      The cosine-similarity score from semantic (vector) search, from 0 to 1. Null when this match came from keyword search only.
    • getChunkText

      public Optional<String> getChunkText()
      Returns:
      The specific chunk of text that matched the query — the narrowest snippet, useful for citation.
    • getContextText

      public Optional<String> getContextText()
      Returns:
      The wider surrounding passage supplied to the model as context — broader than chunkText to better ground the answer.
    • getSnippet

      public Optional<String> getSnippet()
      Returns:
      A display-ready snippet with the matched query terms emphasized — suitable for search-result UIs.
    • getMetadata

      public Optional<Map<String,Object>> getMetadata()
      Returns:
      Metadata you supplied on the source document, such as its title, folder id, or custom tags.
    • getCreatedAt

      public Optional<OffsetDateTime> getCreatedAt()
      Returns:
      The result's creation timestamp, as an ISO-8601 UTC timestamp.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static RagSearchResult.DocumentIdStage builder()