Mnemosyne.NodeMetadata (mnemosyne v0.1.6)

Copy Markdown View Source

Metadata tracked per node for value function scoring.

Captures access patterns, temporal information, and accumulated rewards to enable recency, frequency, and reward-based scoring.

Summary

Functions

Returns the average reward, or 0.0 if no rewards recorded.

Creates a new metadata struct with the given options.

Increments access count and updates last accessed timestamp.

Adds a reward observation to the metadata.

Types

t()

@type t() :: %Mnemosyne.NodeMetadata{
  access_count: non_neg_integer(),
  created_at: DateTime.t(),
  cumulative_reward: float(),
  last_accessed_at: DateTime.t() | nil,
  reward_count: non_neg_integer()
}

Functions

avg_reward(meta)

@spec avg_reward(t()) :: float()

Returns the average reward, or 0.0 if no rewards recorded.

new(opts \\ [])

@spec new(keyword()) :: t()

Creates a new metadata struct with the given options.

record_access(meta)

@spec record_access(t()) :: t()

Increments access count and updates last accessed timestamp.

update_reward(meta, reward)

@spec update_reward(t(), float()) :: t()

Adds a reward observation to the metadata.