Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ahvn.top/llms.txt

Use this file to discover all available pages before exploring further.

Define what your data means, not where it lives.

1. Entity definition

Entities are Python classes that extend hb.Entity:
import heavenbase as hb

class Document(hb.Entity):
    title:    hb.ShortText
    body:     hb.LongText
    tags:     hb.Array
    embedding: hb.Vector

2. Logical types

TypeDefault lengthNotes
Identifier63 charsIDs and slugs
ShortText255 charsNames, labels
MediumText4095 charsDescriptions, summaries
LongText65535 charsFull documents
NumberNumeric values
ArrayLists and arrays
VectorEmbedding vectors
JsonArbitrary JSON
BlobBinary data

3. Auto IDs

Every entity has an id: Identifier field. If you omit it on construction, HeavenBase derives a deterministic, schema-salted hash ID from the entity’s field values.
doc = Document(title="My Doc", body="content", tags=["ai"], embedding=[0.1, 0.2])
print(doc.id)  # stable hash

4. JSON compilation

MyEntity = hb.entity_from_dict({
    "name": "Product",
    "fields": {
        "name": "ShortText",
        "price": "Number",
    }
})

Further Exploration

Related resources: