v0.5.0
Filtered vector search
From the changelog · release notes and binaries
Added
-
Filtered vector search. A vector can carry an optional payload, and a search can restrict its results to vectors whose payload matches a filter.
SKEG.VSET <name> <id> <vector> [PAYLOAD <blob>]stores an opaque blob beside the vector (in the KV vLog under a reserved, tenant-scoped key, so the quantized graph stays dense).SKEG.VSEARCH <name> <k> <l_search> <query> [WITHPAYLOAD] [FILTER <expr>]returns the blob with each hit (WITHPAYLOAD) and/or applies a payload filter (FILTER). The blob’skey=valuefields are parsed into a per-index payload index; the filter grammar supportsfield = value,field IN (...), the ranges>= > <= < BETWEEN a AND b,field EXISTS, andAND/OR/NOTwith parentheses. A field repeated in a payload is multi-valued (matches any of its values). -
Adaptive filtered-search planner. A selective filter (small matching set) is scored exactly over just the matching vectors. A broad filter runs a filtered graph search: two complementary walks merged (one that explores only the matching subgraph, one that navigates the whole graph and filters at re-rank), so recall holds whether the matching vectors cluster together (real metadata) or scatter. Validated on real 1024-dim embeddings at 100k and 500k: recall@10 0.98 to 1.00 across selectivities and metadata shapes, at query time with no extra build cost. The payload index is rebuilt from the stored blobs on the first filtered search after a restart.
-
TurboQuant tiers on the read-write disk path.
SKEG.VINDEX.CREATE name dim tq1|tq2|tq4 diskbuilds a live-writable disk index whose resident tier is TurboQuant (dim*bits/8bytes/vector) instead of int8. No trained codebook (unlike PQ, which stays serve-only), so it works under streaming writes. The tier kind persists in a sidecar and is rebuilt on open and consolidate. tq2 is the recommended sweet spot (recall ~1.0, sub-int8 RAM, latency ~int8); tq1 is the leanest but best-effort below 512d. -
SKEG.VMSETbulk insert. Onenamefollowed by(id, vector, payload)triples; the server fans the items out concurrently so durable payload writes batch in the group committer. Combined with relaxed payload durability and a geometric delta rebuild, 100k ingest dropped from 1928s to 28s. -
SKEG.VINDEX.CONSOLIDATE nameforce-folds a disk index’s delta into the graph after a bulk load. Idle indexes also self-consolidate: a per-shard background task folds a delta that has been stable across ticks, so an index is lean by default without an explicit call. -
Vindex tiering control plane (mechanism, not policy). A new
Server::control_handle()returns aControlHandlefor managing resident vindexes out of band:open_indices()enumerates every open index per shard with itsIndexStat(resident bytes, last-access, vector count, whether it is evictable),total_resident_bytes()sums the fleet, andevict(tenant, index)drops an index from RAM non-destructively: thevindex-<name>/files stay and the next access reopens it lazily. A disk-backed index reopens off the shard thread (spawn_blocking), so a cold-start reopen does not stall other indexes on the same shard. The eviction policy (RAM budget, LRU, hysteresis) is left to an external controller; the engine ships only the knobs. -
tq2 is now the default tier.
SKEG.VINDEX.CREATE name dim backend(kind omitted, 3 args) builds a tq2 disk index, and--mode servewithout--tierserves tq2. Validated recall-neutral vs int8 across 100-784d real embeddings (r@10 >= 0.999, r@100 within 0.004) at lower RAM. Pass an explicit kind /--tier int8for the prior full-fidelity tier. Behavior change on upgrade: an existing serve deployment that relied on the implicit int8 default now serves tq2 (recall-neutral, leaner) unless it passes--tier int8. -
Per-command admission carries the command kind.
TenantBackend::admitnow takes anAdmission { tenant, op, cost }(was(tenant, cost)), whereopis a coarseCommandKind. A backend can apply command-level RBAC (e.g. refuseVINDEX.DROPfor some tenants) and per-operation metering from one gate. Both types are#[non_exhaustive]. Single-tenant deployments and the default (admit-everything) backend are unaffected.
Changed
-
Vindex RAM accounting (
VindexSizeBytesgauge) is now tier-accurate. Disk indexes report their ownresident_bytes()(graph + quantized tier + delta) instead of ann*dimint8 estimate, so the gauge tracks tq1/tq2/tq4 correctly. -
Plain (non-filtered) search and writes are unchanged. A VSET without
PAYLOADdoes no extra work; a VSEARCH withoutFILTER/WITHPAYLOADtakes the existing path byte-for-byte. The native binary protocol stays payload/filter-free; RESP3 is the surface for the new feature. -
ShardSet::vset/ShardSet::vsearchgained parameters (payload, the tenant,want_payload, and an optional filter), andskeg-vectorgainedDiskVamanaIndex::search_filtered/score_ids/live_ids. Library code on these APIs must update its call sites, which is whyskeg-servertakes a minor version bump. -
TenantBackend::admitsignature changed fromadmit(tenant, cost)toadmit(Admission). Backends that override it must update; the default (admit-everything) is unchanged, so single-tenant and non-overriding backends need no change.
Versions bumped
skeg-vector0.1.5,skeg-resp30.2.1,skeg-server0.5.0,skeg-server-tenant0.2.1