Skip to content

orcalib.memoryset.memory_types#

Memory dataclass #

1
2
3
Memory(
    value, embedding, memory_id, memory_version, metadata
)

The base class for a labeled memory. This includes fields that are ALWAYS required.

value instance-attribute #

value

The value used to generate the embedding for looking up this memory.

embedding instance-attribute #

embedding

The embedding of the memory value, automatically generated by the Memoryset model.

memory_id instance-attribute #

memory_id

The ID of the memory in the table, automatically generated by the Memoryset.

memory_version instance-attribute #

memory_version

The version of the memory, automatically maintained by the Memoryset.

metadata instance-attribute #

metadata

Metadata associated with the memory that is not used in the model.

LabeledMemory dataclass #

1
2
3
4
5
6
7
8
9
LabeledMemory(
    value,
    embedding,
    memory_id,
    memory_version,
    metadata,
    label,
    label_name=None,
)

Bases: _LabeledMemoryFields, Memory

A labeled memory is a single item that can be stored in the database and has a label.

value instance-attribute #

value

The value used to generate the embedding for looking up this memory.

embedding instance-attribute #

embedding

The embedding of the memory value, automatically generated by the Memoryset model.

memory_id instance-attribute #

memory_id

The ID of the memory in the table, automatically generated by the Memoryset.

memory_version instance-attribute #

memory_version

The version of the memory, automatically maintained by the Memoryset.

metadata instance-attribute #

metadata

Metadata associated with the memory that is not used in the model.

label instance-attribute #

label

The label of the memory.

label_name class-attribute instance-attribute #

label_name = None

The human-readable name of the label.

MemoryLookup dataclass #

MemoryLookup(
    lookup_score,
    value,
    embedding,
    memory_id,
    memory_version,
    metadata,
    reranker_score=None,
    reranker_embedding=None,
    attention_weight=None,
)

Bases: _OptionalLookupProperties, Memory, _RequiredLookupProperties

Single labeled memory lookup result.

lookup_score instance-attribute #

lookup_score

The similarity score between the query and the memory.

value instance-attribute #

value

The value used to generate the embedding for looking up this memory.

embedding instance-attribute #

embedding

The embedding of the memory value, automatically generated by the Memoryset model.

memory_id instance-attribute #

memory_id

The ID of the memory in the table, automatically generated by the Memoryset.

memory_version instance-attribute #

memory_version

The version of the memory, automatically maintained by the Memoryset.

metadata instance-attribute #

metadata

Metadata associated with the memory that is not used in the model.

reranker_score class-attribute instance-attribute #

reranker_score = None

The similarity score assigned by the reranker.

Note

This will be automatically generated if a reranker is attached to the memoryset.

reranker_embedding class-attribute instance-attribute #

reranker_embedding = None

The reranker embedding for this memory value.

Note

This will be automatically generated if a reranker is attached to the memoryset.

attention_weight class-attribute instance-attribute #

attention_weight = None

The attention the model gave to this memory lookup.

Note

This is not provided during lookup but can instead be optionally added by the model during its forward pass to store for later analysis.

LabeledMemoryLookup dataclass #

LabeledMemoryLookup(
    lookup_score,
    value,
    embedding,
    memory_id,
    memory_version,
    metadata,
    label,
    label_name=None,
    reranker_score=None,
    reranker_embedding=None,
    attention_weight=None,
)

Bases: _OptionalLookupProperties, _LabeledMemoryFields, Memory, _RequiredLookupProperties

Single labeled memory lookup result.

lookup_score instance-attribute #

lookup_score

The similarity score between the query and the memory.

value instance-attribute #

value

The value used to generate the embedding for looking up this memory.

embedding instance-attribute #

embedding

The embedding of the memory value, automatically generated by the Memoryset model.

memory_id instance-attribute #

memory_id

The ID of the memory in the table, automatically generated by the Memoryset.

memory_version instance-attribute #

memory_version

The version of the memory, automatically maintained by the Memoryset.

metadata instance-attribute #

metadata

Metadata associated with the memory that is not used in the model.

label instance-attribute #

label

The label of the memory.

label_name class-attribute instance-attribute #

label_name = None

The human-readable name of the label.

reranker_score class-attribute instance-attribute #

reranker_score = None

The similarity score assigned by the reranker.

Note

This will be automatically generated if a reranker is attached to the memoryset.

reranker_embedding class-attribute instance-attribute #

reranker_embedding = None

The reranker embedding for this memory value.

Note

This will be automatically generated if a reranker is attached to the memoryset.

attention_weight class-attribute instance-attribute #

attention_weight = None

The attention the model gave to this memory lookup.

Note

This is not provided during lookup but can instead be optionally added by the model during its forward pass to store for later analysis.