Overview
Document model
A Layer document is a Turbopuffer row — an id, your attributes, and an optional vector — read and written through the pull-through cache. Alongside your own schema, Layer reserves the _hevlayer_* attribute prefix for its own bookkeeping. The gateway manages these attributes: your writes and UDF outputs must not set them, and editing them directly breaks Layer’s guarantees (the gateway degrades gracefully if they drift).
| Attribute | Type | Purpose |
|---|---|---|
_hevlayer_upserted_at | integer (epoch ms) | Server-stamped on every write. The gateway filters queries to _hevlayer_upserted_at <= watermark to hold the read-consistency cut while the upstream index catches up. |
_hevlayer_shard | integer | Hash bucket assigned at write time (xxh64(id) % shard_count), present only on sharded namespaces. Lets the gateway scatter/gather a query across the shards of one namespace. |
The _hevlayer_ prefix also namespaces internal cache sets — snapshot field-values and search-history clickstream — but those are cache keys, not part of your document schema.