Record Class TieredContextLoader.TierConfig

java.lang.Object
java.lang.Record
com.tnsai.memory.strategy.TieredContextLoader.TierConfig
Record Components:
recentTurnCount - number of recent turns to keep verbatim (each turn = user + assistant)
summaryTokenBudget - maximum tokens for the summary tier
searchTokenBudget - maximum tokens for the search tier
totalTokenBudget - maximum total tokens across all tiers
Enclosing class:
TieredContextLoader

public static record TieredContextLoader.TierConfig(int recentTurnCount, int summaryTokenBudget, int searchTokenBudget, int totalTokenBudget) extends Record
Configuration for tier token budgets.
  • Constructor Details

    • TierConfig

      public TierConfig(int recentTurnCount, int summaryTokenBudget, int searchTokenBudget, int totalTokenBudget)
      Creates a TierConfig with validation.
  • Method Details

    • defaults

      public static TieredContextLoader.TierConfig defaults()
      Returns default configuration suitable for most use cases.
      • 5 recent turns (10 messages)
      • 500 tokens for summary
      • 300 tokens for search
      • 4000 tokens total
    • 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. All components in this record class 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.
    • recentTurnCount

      public int recentTurnCount()
      Returns the value of the recentTurnCount record component.
      Returns:
      the value of the recentTurnCount record component
    • summaryTokenBudget

      public int summaryTokenBudget()
      Returns the value of the summaryTokenBudget record component.
      Returns:
      the value of the summaryTokenBudget record component
    • searchTokenBudget

      public int searchTokenBudget()
      Returns the value of the searchTokenBudget record component.
      Returns:
      the value of the searchTokenBudget record component
    • totalTokenBudget

      public int totalTokenBudget()
      Returns the value of the totalTokenBudget record component.
      Returns:
      the value of the totalTokenBudget record component