ConsolidationProvenance

org.llm4s.agent.memory.ConsolidationProvenance

Where a consolidation's summary came from, as its metadata records it (#3035).

LLMMemoryManager consolidates only memories that share one scope: every metadata value except the DescriptiveKeys, which may differ from memory to memory. So a summary carries the same conversation_id, user_id, entity_id, source, writer (llm4s.writer) and any key of the application's own as each of its sources, and an erasure by any of them (MemoryStore.deleteMatching) removes the summary with the rest. A descriptive key is kept on the summary only when every source has the same value.

The summary also records ConsolidatedFrom (how many memories it replaced), ConsolidatedAt, ConsolidationMethod, OriginalIds (every memory it stands for, through earlier summaries too) and Version. These keys are a stored format.

A summary written before #3035 has no Version: its scope is the first source's, so it may hold the content of memories in other conversations or of other users. It is never consolidated again; legacySummaries finds such summaries, to review or delete them.

Attributes

Source
ConsolidationProvenance.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Whether memory is a summary written before #3035, without provenance.

Whether memory is a summary written before #3035, without provenance.

Attributes

Source
ConsolidationProvenance.scala
def isSummary(memory: Memory): Boolean

Whether memory is a consolidation's summary, of any version.

Whether memory is a consolidation's summary, of any version.

Attributes

Source
ConsolidationProvenance.scala
def scopeOf(memory: Memory): Map[String, String]

memory's scope: its metadata without the DescriptiveKeys. Only memories with equal scopes are merged.

memory's scope: its metadata without the DescriptiveKeys. Only memories with equal scopes are merged.

Attributes

Source
ConsolidationProvenance.scala
def sourceIds(memory: Memory): Seq[MemoryId]

The ids memory stands for: its OriginalIds if it is a current summary, else its own id.

The ids memory stands for: its OriginalIds if it is a current summary, else its own id.

Attributes

Source
ConsolidationProvenance.scala

Concrete fields

The bookkeeping keys above: never part of a scope, and set afresh on each summary.

The bookkeeping keys above: never part of a scope, and set afresh on each summary.

Attributes

Source
ConsolidationProvenance.scala

When the summary was written, an ISO-8601 instant.

When the summary was written, an ISO-8601 instant.

Attributes

Source
ConsolidationProvenance.scala

How many memories the summary replaced.

How many memories the summary replaced.

Attributes

Source
ConsolidationProvenance.scala

How the summary was made: llm_summary.

How the summary was made: llm_summary.

Attributes

Source
ConsolidationProvenance.scala

The current Version.

The current Version.

Attributes

Source
ConsolidationProvenance.scala

Keys that describe one memory rather than whom or what it belongs to, so memories that differ in them may still be consolidated together: a message's role, a knowledge chunk's chunk_index, an entity's entity_name and entity_type, and the BookkeepingKeys. Every other metadata key is part of a memory's scope.

Keys that describe one memory rather than whom or what it belongs to, so memories that differ in them may still be consolidated together: a message's role, a knowledge chunk's chunk_index, an entity's entity_name and entity_type, and the BookkeepingKeys. Every other metadata key is part of a memory's scope.

Attributes

Source
ConsolidationProvenance.scala

The ids of every memory the summary stands for, comma-separated: its sources', and, for a source that was itself a summary, that summary's own original_ids.

The ids of every memory the summary stands for, comma-separated: its sources', and, for a source that was itself a summary, that summary's own original_ids.

Attributes

Source
ConsolidationProvenance.scala

The provenance format: 2 since #3035. A summary without it was written before.

The provenance format: 2 since #3035. A summary without it was written before.

Attributes

Source
ConsolidationProvenance.scala

Summaries written before #3035: a consolidation method and no Version.

Summaries written before #3035: a consolidation method and no Version.

Attributes

Source
ConsolidationProvenance.scala