Overview

Introduction

Layer provides a retrieval gateway with one Layer API across pluggable stores, and a function runtime for per-row compute on supported backends. The Layer API includes a Turbopuffer-compatible subset as well as gateway query, pipeline and management operations. Use the generated Layer clients or HTTP; select the backend to see the supported shapes and feature gaps.

╔════════════╗      ╔════════════╗          ╔═══ retrieval system ═══════════════════╗
║ generated  ║░     ║ layer      ║░         ║                                        ║░
║ clients    ║◀────▶║ gateway    ║◀──API───▶║  ┏━━━━━━━━━┓  ┏━━━━━━━━━┓              ║░
║            ║░     ║            ║░         ║  ┃ ANN     ┃  ┃ BM25    ┃              ║░
╚════════════╝░     ╚═════╤══════╝░         ║  ┗━━━━━━━━━┛  ┗━━━━━━━━━┛              ║░
 ░░░░░░░░░░░░░░      ░░░░░│░░░░░░░░         ║                                        ║░
                          │                 ╚════════════════════════════════════════╝░
╔════════════╗      ╔═════▼══════╗           ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
║ layer      ║░     ║ layer      ║░
║ dashboard  ║◀────▶║ operator   ║░         ╔═══ kubernetes api ═════════════════════╗
║            ║░     ║ + runtime  ║◀────────▶║                                        ║░
╚════════════╝░     ╚═════╤══════╝░         ║ RBAC · transforms · agents · cache     ║░
 ░░░░░░░░░░░░░░      ░░░░░│░░░░░░░░         ║ telemetry · cost · hosted operations   ║░
                          ▼                 ║                                        ║░
                   ┏━━━━━━━━━━━━━━┓         ╚════════════════════════════════════════╝░
                   ┃ Object Store ┃          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
                   ┃ Bucket (S3)  ┃
                   ┗━━━━━━━━━━━━━━┛
╔═══════════════════════════════╗
║ layer gateway                 ║░
║ ──API──▶ retrieval system     ║░
║          ANN · BM25           ║░
╚═══════════════╤═══════════════╝░
 ░░░░░░░░░░░░░░░│░░░░░░░░░░░░░░░░
                ▼
╔═══════════════════════════════╗
║ layer operator + runtime      ║░
║ ◀──────▶ kubernetes api       ║░
║          RBAC · transforms    ║░
║          telemetry · cost     ║░
╚═══════════════╤═══════════════╝░
 ░░░░░░░░░░░░░░░│░░░░░░░░░░░░░░░░
                ▼
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ object store bucket (S3)      ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

You run two server components in your own cluster: a Rust gateway and a Kubernetes operator. The retrieval gateway routes requests to the configured vector store and serves Layer operations around caching, history, pipelines, state of your index, clickstream, and cost. The configured backend determines which origin operations are available; gateway-managed services have their own storage and worker dependencies.

The function runtime is one primitive for every per-row job over an index. Embedding, classification, tagging, and attribute migration are all the same thing: a stateless UDF declared as a Kubernetes-native Function. The gateway discovers the work, leases it to worker pools, retries, and writes results back, with KEDA scaling each pool to zero between bursts. You write and declare the function, and Layer runs the worker fleet for you.

You call the gateway four ways: the Python client, the Go client, the TypeScript client, or the REST API directly — the clients are generated from the same OpenAPI spec, and every endpoint page shows them side by side. Layer also ships an optional GUI dashboard. The dashboard manages cluster configuration through CRDs; all other state is persisted in object storage (S3). No durable state lives in a Layer process, so the compute tier is stateless and fully elastic.

Because indexing is bursty, especially GPU-bound work, our Terraform installs Karpenter as a cluster autoscaler to provision and scale the nodes Layer’s compute runs on. The remaining backing services are the document cache, the indexing-state store, and the metrics store. Every component Layer runs alongside is open source:

  • Karpenter — cluster autoscaler that provisions and scales nodes for Layer’s bursty, GPU-bound compute (Apache-2.0).
  • Aerospike — ephemeral document cache (AGPL-3.0).
  • PostgreSQL — indexing-state store for the pipeline and embed queue (PostgreSQL License).
  • VictoriaMetrics — metrics store (Apache-2.0).

To get started, see the install guide. For more technical detail, see Concepts, Guarantees, and Tradeoffs.

esc