Store.Memories (fnord v0.8.82)
View SourceUnix file store for memories with composite scope (global + per-project).
Directory structure: ~/.fnord/memories/ # Global memories
.metadata.json
<slug>/
meta.json
heuristic.json
children.log~/.fnord/projects/<project>/memories/ # Project memories
<slug>/
...
Summary
Functions
Adds a child slug to a parent's children.log file.
Creates a new memory directory and writes initial files.
Deletes a memory and all its files.
Checks if a memory exists.
Finds the parent slug for a given child slug. Returns nil if no parent found.
Gets all child slugs for a memory.
Initializes the memories store directory structure. Creates base directory for global memories and root metadata. Project memories are created under each project's store directory.
Checks if the memories store has been initialized.
Loads all memories: global + project if project_name provided.
Loads all global memories from disk.
Loads all memories for a specific project.
Removes a child slug from a parent's children.log file.
Functions
@spec add_child(String.t(), String.t(), AI.Memory.scope()) :: :ok | {:error, term()}
Adds a child slug to a parent's children.log file.
@spec create(AI.Memory.t()) :: :ok | {:error, term()}
Creates a new memory directory and writes initial files.
@spec delete(String.t(), AI.Memory.scope()) :: :ok | {:error, term()}
Deletes a memory and all its files.
@spec exists?(String.t(), AI.Memory.scope()) :: boolean()
Checks if a memory exists.
@spec find_parent(String.t(), AI.Memory.scope()) :: String.t() | nil
Finds the parent slug for a given child slug. Returns nil if no parent found.
@spec get_children(String.t(), AI.Memory.scope()) :: [String.t()]
Gets all child slugs for a memory.
@spec init() :: :ok | {:error, term()}
Initializes the memories store directory structure. Creates base directory for global memories and root metadata. Project memories are created under each project's store directory.
@spec initialized?() :: boolean()
Checks if the memories store has been initialized.
@spec load_all(String.t() | nil) :: [AI.Memory.t()]
Loads all memories: global + project if project_name provided.
@spec load_global() :: [AI.Memory.t()]
Loads all global memories from disk.
@spec load_project(String.t()) :: [AI.Memory.t()]
Loads all memories for a specific project.
@spec remove_child(String.t(), String.t(), AI.Memory.scope()) :: :ok | {:error, term()}
Removes a child slug from a parent's children.log file.