Class: SwarmMemory::Core::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/swarm_memory/core/entry.rb

Overview

Represents a single memory entry with metadata and optional embedding

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentString

The actual content stored

Returns:

  • (String)

    the current value of content



13
14
15
# File 'lib/swarm_memory/core/entry.rb', line 13

def content
  @content
end

#embeddingArray<Float>?

Optional 384-dim embedding vector

Returns:

  • (Array<Float>, nil)

    the current value of embedding



13
14
15
# File 'lib/swarm_memory/core/entry.rb', line 13

def embedding
  @embedding
end

#metadataHash?

Optional parsed frontmatter metadata

Returns:

  • (Hash, nil)

    the current value of metadata



13
14
15
# File 'lib/swarm_memory/core/entry.rb', line 13

def 
  
end

#sizeInteger

Content size in bytes

Returns:

  • (Integer)

    the current value of size



13
14
15
# File 'lib/swarm_memory/core/entry.rb', line 13

def size
  @size
end

#titleString

Brief description of the content

Returns:

  • (String)

    the current value of title



13
14
15
# File 'lib/swarm_memory/core/entry.rb', line 13

def title
  @title
end

#updated_atTime

Last modification timestamp

Returns:

  • (Time)

    the current value of updated_at



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

Returns:

  • (Boolean)


25
26
27
# File 'lib/swarm_memory/core/entry.rb', line 25

def embedded?
  !embedding.nil? && !embedding.empty?
end

#has_metadata?Boolean

Check if entry has metadata

Returns:

  • (Boolean)


32
33
34
# File 'lib/swarm_memory/core/entry.rb', line 32

def has_metadata?
  !.nil? && !.empty?
end