Manta Developers
GitHub
Menu

@manta-eu/client/shared/memory-decay

Reference for @manta-eu/client/shared/memory-decay as it is on main.

Type Aliases

MemoryDecayCandidate

MemoryDecayCandidate = object

Properties

memoryCiteCount?

optional memoryCiteCount?: number | null

memoryLastUsedAt?

optional memoryLastUsedAt?: Date | string | null

memoryUseCount?

optional memoryUseCount?: number | null

scope?

optional scope?: string | null


UseWeights

UseWeights = object

Properties

cited?

optional cited?: number

preloaded?

optional preloaded?: number

Variables

citedUseWeight

const citedUseWeight: 0 = 0


decayDemotionThreshold

const decayDemotionThreshold: 0.5 = 0.5


decayHalfLifeDays

const decayHalfLifeDays: 7 = 7


decayHoldOutDays

const decayHoldOutDays: 30 = 30


decayUseCountCap

const decayUseCountCap: 20 = 20


personalMemoryScope

const personalMemoryScope: "user" = "user"


preloadedUseWeight

const preloadedUseWeight: 1 = 1

Functions

coldOnsetDays()

coldOnsetDays(useCount): number

Parameters

useCount

number

Returns

number


shouldDemoteOnUsage()

shouldDemoteOnUsage(memory, now?, weights?): boolean

Parameters

memory

MemoryDecayCandidate

now?

Date = ...

weights?

UseWeights

Returns

boolean


usageWeight()

usageWeight(useCount, lastUsedAt, now?): number

Parameters

useCount

number | null | undefined

lastUsedAt

string | Date | null | undefined

now?

Date = ...

Returns

number


weightedUseCount()

weightedUseCount(memory, weights?): number

Parameters

memory

MemoryDecayCandidate

weights?

UseWeights

Returns

number