MemoryBounds

org.llm4s.agent.memory.MemoryBounds
See theMemoryBounds companion object
@Experimental
final case class MemoryBounds

How much one store may hold: at most maxMemories memories and maxBytes bytes, measured by MemoryBounds.sizeOf. A TransactionalMemoryStore enforces both in the transaction that adds, by evicting.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def overflow(entries: Seq[Entry]): Vector[MemoryId]

The memories to evict from entries - (id, importance, timestamp, size) - so that the rest are within both bounds: lowest importance first (a memory with none counts as 0.5), then oldest, then by id.

The memories to evict from entries - (id, importance, timestamp, size) - so that the rest are within both bounds: lowest importance first (a memory with none counts as 0.5), then oldest, then by id.

Attributes

def withMaxBytes(n: Long): MemoryBounds

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product