Class: SwarmMemory::Core::Entry
- Inherits:
-
Struct
- Object
- Struct
- SwarmMemory::Core::Entry
- Defined in:
- lib/swarm_memory/core/entry.rb
Overview
Represents a single memory entry with metadata and optional embedding
Instance Attribute Summary collapse
-
#content ⇒ String
The actual content stored.
-
#embedding ⇒ Array<Float>?
Optional 384-dim embedding vector.
-
#metadata ⇒ Hash?
Optional parsed frontmatter metadata.
-
#size ⇒ Integer
Content size in bytes.
-
#title ⇒ String
Brief description of the content.
-
#updated_at ⇒ Time
Last modification timestamp.
Instance Method Summary collapse
-
#embedded? ⇒ Boolean
Check if entry has an embedding.
-
#has_metadata? ⇒ Boolean
Check if entry has metadata.
Instance Attribute Details
#content ⇒ String
The actual content stored
13 14 15 |
# File 'lib/swarm_memory/core/entry.rb', line 13 def content @content end |
#embedding ⇒ Array<Float>?
Optional 384-dim embedding vector
13 14 15 |
# File 'lib/swarm_memory/core/entry.rb', line 13 def end |
#metadata ⇒ Hash?
Optional parsed frontmatter metadata
13 14 15 |
# File 'lib/swarm_memory/core/entry.rb', line 13 def end |
#size ⇒ Integer
Content size in bytes
13 14 15 |
# File 'lib/swarm_memory/core/entry.rb', line 13 def size @size end |
#title ⇒ String
Brief description of the content
13 14 15 |
# File 'lib/swarm_memory/core/entry.rb', line 13 def title @title end |
#updated_at ⇒ Time
Last modification timestamp
13 14 15 |
# File 'lib/swarm_memory/core/entry.rb', line 13 def updated_at @updated_at end |
Instance Method Details
#embedded? ⇒ Boolean
Check if entry has an embedding
25 26 27 |
# File 'lib/swarm_memory/core/entry.rb', line 25 def !.nil? && !.empty? end |
#has_metadata? ⇒ Boolean
Check if entry has metadata
32 33 34 |
# File 'lib/swarm_memory/core/entry.rb', line 32 def !.nil? && !.empty? end |