Overview

Concepts

Wire protocol matching

Layer accepts the Turbopuffer HTTP wire protocol, so an application can point its Turbopuffer client at Layer’s base URL and keep the same request bodies. With Turbopuffer as the store, Layer forwards native requests after gateway validation. With another store, Layer translates supported operations into that store’s native calls, and a valid request the store cannot serve returns 422 UnsupportedByStore instead of silently dropping part of it. The capability matrix lists what each store supports and how we validate it. See the API reference for authentication and client setup.

Gateway enhancements

Layer adds retrieval operations around the store while keeping one client endpoint. Hybrid text fusion combines retrieval legs, query routing selects a strategy, scans select or count matching rows, and federated queries combine named namespaces. The API reference calls out each backend’s limits at the relevant feature.

The Layer clients expose these additions; plain HTTP can call the same API. Native requests and enhanced requests can share the gateway endpoint. Where Layer needs bookkeeping attributes, it reserves the _hevlayer_* prefix. Treat these fields as read-only; the document model defines the contract.

Gateway and store

The gateway receives writes and queries over HTTP and executes them against the selected store. Local Compose supplies Postgres with pgvector and pg_search; an existing Turbopuffer account is another supported backend. See configuration and store support.

Namespaces and rows

A namespace groups rows addressed by ID. A row contains attributes and can include vectors. The first write creates a namespace.

Retrieval

Query routing chooses a ranking strategy. Scans select rows or aggregate matching values, while federation merges results across explicit namespaces. Support depends on the backing store and request shape.

Scatter/gather

Layer stamps every row it writes to Turbopuffer with a _hevlayer_shard hash bucket. For an existing namespace, initialization backfills rows that were written without one. Scatter/gather starts after layer.shard_lag_rows reaches zero; the single-namespace path serves queries while backfill runs. See CLI initialization.

Glossary

ConceptMeaning
Wire protocolThe HTTP methods, paths, request fields, response shapes, and status codes exchanged by client and server.
Wire featureAn individual operation or option whose backend support is declared in the capability matrix.
GatewayThe Layer service that receives client requests, validates them, and executes them against the configured stores.
VectorStoreA serving connection to the backend that stores and queries rows.
WarehouseAn upstream source connection, separate from the store serving retrieval requests.
NamespaceA named collection of rows addressed through /v2/namespaces/{namespace}.
Document / rowAn ID and application attributes, optionally including vectors.
ScanRow selection that returns matching IDs, field values, or a count; supported selectors depend on the backend.
ShardA hash bucket within a namespace, identified by the reserved _hevlayer_shard attribute.
Scatter/gatherRunning subqueries across shards or namespaces and combining their results into one response.
LegOne subquery contributing to a hybrid or federated result.
RRFReciprocal rank fusion: combining ranked lists using each result’s position in its input lists.
Tokenizer policyThe rules that turn input text into retrieval tokens, including word boundaries, case normalization, and token limits.
RouteA retrieval strategy, such as hybrid_text, semantic, or fused, selected by the query router where supported.
Routing policyThe deterministic, versioned rules used to select an Auto route.
DeferralAn Auto response with executed: false: the application must supply an embedding before the selected route can execute.
esc