Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chunk

The fundamental storage unit in the memory system. A Chunk mostly carries a semantic code (any HyperBinary type) along with various diagnostic information.

Structure

FieldTypeDescription
codeHyperBinarySemantic content (can be updated). Required — its domain/pod determines the chunk’s identity.
idSparkleidentity vector, as derived from code’s domain/pod; determines the storage key.
notestringHuman-readable annotation, primarily for debugging
extraprotobuf AnyExtensible payload for application-specific data, primarily for debugging

Inspection

Chunks are typically created via producers (see Producers) — or directly from a code (memory.Chunk(code, note="", extra=msg); the id derives from the code’s domain/pod) — and inspected after retrieval (see Selectors).

chunk = memory.first_picked(view, memory.by_item_key("animals", "cat"))

chunk.id               # Sparkle
chunk.code             # HyperBinary
chunk.note             # str
chunk.extra_message()  # deserialized protobuf message, or None
Last change: , commit: 52f4589