Omnigraph
Schema

Types

Every property has a type — scalars, enums, lists, vectors, and blobs.

Every property in a .pg schema must have a type. Types determine how values are stored, validated, and indexed.

Scalar types

TypeDescriptionExample values
StringUTF-8 text, variable length."hello"
BoolBoolean.true, false
I32Signed 32-bit integer.-42, 0, 100
I64Signed 64-bit integer.9_000_000_000
U32Unsigned 32-bit integer.0, 4_294_967_295
U64Unsigned 64-bit integer.0, 18_446_744_073_709_551_615
F3232-bit floating point.3.14
F6464-bit floating point.2.718281828
DateCalendar date (no time).2025-06-15
DateTimeDate and time with timezone.2025-06-15T09:30:00Z
node Measurement {
    sensor:    String @key
    timestamp: DateTime
    value:     F64
    count:     U32
    active:    Bool
}

Enum types

An inline enumeration restricts a property to a fixed set of string values. Values are declared inside enum(...):

node Task {
    slug:   String @key
    status: enum(pending, in_progress, completed, cancelled)
}

Enum values are unquoted identifiers. They are stored as strings but validated at load and mutation time — any value not in the declared set is rejected.

List types

Wrap a type in [...] to declare a list property:

node Paper {
    doi:      String @key
    authors:  [String]
    scores:   [F64]
    tags:     [String]
}

Lists are variable-length and ordered. The element type must be a scalar — nested lists and lists of vectors are not supported.

Vector types

Vector(N) declares a fixed-dimension floating-point vector, used for embeddings and similarity search:

node Document {
    title:     String @key
    embedding: Vector(1536) @embed(source: title)
}

The dimension N is a positive integer specified at schema time. All vectors in a column must have exactly N elements.

Vector annotations

AnnotationPurpose
@embedMarks the vector for automatic embedding.
@embed(source: prop)Specifies which text property to embed from.
@indexCreates an IVF-HNSW index for approximate nearest-neighbor search.
node Chunk {
    content:   String
    embedding: Vector(768) @embed(source: content) @index
}

Blob types

Blob stores arbitrary binary data. Use it for images, PDFs, or other opaque payloads:

node Attachment {
    name:    String @key
    mime:    String
    payload: Blob
}

Blob properties cannot be indexed or used in constraints.

Nullability

Any type can be made nullable by appending ?:

node Person {
    name:  String       # required — every row must have a value
    email: String?      # optional — may be null
    age:   I32?         # optional
    tags:  [String]?    # optional list
}

A required property (no ?) must be present in every insert. A nullable property can be omitted or explicitly set to null.

On this page