Skip to content

Class HTM::Models::Robot

Inherits Object
Defined in lib/htm/models/robot.rb

Robot model - represents an LLM agent using the HTM system

Robots can share memories through the many-to-many relationship with nodes. When a robot is deleted, only the robot_nodes links are removed; shared nodes remain in the database for other robots.

Public Class Methods

find_or_create_by_name(robot_name)

Find or create a robot by name - @param robot_name [String] Name of the robot - @return [Robot] The found or created robot

Public Instance Methods

before_create()

Hooks

memory_summary()

Get a summary of this robot's memory state - @return [Hash] Summary including: - :total_nodes [Integer] Total nodes associated with this robot - :in_working_memory [Integer] Nodes currently in working memory - :with_embeddings [Integer] Nodes that have embeddings generated

node_count()

Get the total number of nodes associated with this robot - @return [Integer] Number of nodes

nodes_with_metadata(limit = 10)

Get nodes with their remember metadata for this robot - @param limit [Integer] Max nodes to return - @return [Array] Nodes with remember_count, first/last_remembered_at

recent_nodes(limit = 10)

Get the most recent nodes for this robot - @param limit [Integer] Maximum number of nodes to return (default: 10) - @return [Array] Recent nodes ordered by created_at desc

validate()

Validations