THE ENGINESSD PRIMARY / RAM FRUGAL

The life of a query,
in four moves.

Between your call and the ranked answer, four things happen.
The full vectors never have to be in memory.

Follow a request through the engine ↓
FULL VECTORS ON SSD. CODES IN MEMORY.
01
TQ2CODES IN MEMORY

Walk the graph in compressed space

The query expands a Vamana proximity graph and compares candidates through TurboQuant two-bit codes instead of full vectors. Neighbour lists and codes are what stay resident, a small fraction of the original vectors; with --graph-mmap and --tier-mmap the operating system can take those pages back too.

02
SSDWHERE THE VECTORS LIVE

Keep the full vectors on disk

The original float32 vectors stay in vectors.bin and are never loaded wholesale. Only the handful of rows that reach the re-rank are read, at their offset, and a bounded row cache keeps the ones asked for again.

03
f32RE-RANK PRECISION

Re-rank the shortlist at full precision

The candidates that survive the walk are re-scored against their original float32 vectors. Compression narrows the field; it never gets the last word. Every tier keeps this step.

04
RESP3HOW IT COMES BACK

Answer through the protocol you already use

Ranked ids, scores and optional payloads return over RESP3, filtered if you asked for it. Your Redis client does not know it just walked a graph on an SSD.

INSIDE THE ENGINE

Follow a request
through it.

Pick a command and watch it cross the engine: connection, execution, memory, disk. Every component and every step is named after something in the source. Select one to read what it does.

Select a component to learn more · ⌘/Ctrl + scroll to zoom · drag to pan when zoomed

  • Ingress
  • Compute
  • Hot set
  • Durable
FOLLOW THE REQUEST · choose a step
EXPLORE THE COMPONENTSSelect a component · click again to follow its next step
CONNECTION / client & protocol
EXECUTION / routing & algorithms
MEMORY / indexes & caches
DISK / persistent files
WHAT YOU GET

One small engine that does the whole job.

01

Vectors and key-value, one engine

Your agent’s embeddings and its working memory live in the same store, behind the same protocol. No second database to run, back up, or explain.

redis-cli01
> SKEG.VINDEX.CREATE docs 1024 tq2 disk
> SKEG.VSET docs 1 <vec> PAYLOAD "ch-3"
> SET session:42 "ctx"
> SKEG.VSEARCH docs 10 100 <q> WITHPAYLOAD
02

It already speaks your Redis client

RESP3 on the port your tools expect, so every Redis client ever written can talk to it. A leaner native protocol sits beside it for key-value and basic vector work when overhead is all that matters.

python02
import skeg

with skeg.connect() as c:
    c.vindex_create("notes", dim=1024, backend="disk")
    c.vset("notes", 1, embedding)
    hits = c.vsearch("notes", q, k=10)
03

It reads the room it runs in

skeg reads the memory the machine actually has, container limits included, and asks before it spends it: work that would cross the line is refused with an error, not left for the kernel to kill. Full vectors stay on disk; only the compact codes sit in RAM. One variable tightens the ceiling further.

shell03
SKEG_MEMORY_LIMIT_BYTES=268435456 \
  skeg --data-dir ./data
04

Multi-tenant by construction, not by filter

One binary, two profiles. Turn on tenant auth and every connection is scoped from the handshake down through the engine. Isolation is structural, with per-tenant quotas and share-aware cache eviction.

shell · redis-cli04
skeg --tenant-auth auth.kdb --tenant-strict \
  --admin-tenant ops
> HELLO 3 AUTH ops s3cret
> SKEG.QUOTA.SET acme 100000 *
05

Filter while you search

A vector can carry a small payload of key=value fields. Integers index as ranges, everything else as keywords. A search can then ask for the nearest vectors that also match: this user, this collection, anything tagged pdf after a date.

redis-cli05
> SKEG.VSET docs 7 <vec> PAYLOAD "user=alice type=pdf ts=20240115"
> SKEG.VSEARCH docs 10 100 <q> WITHPAYLOAD \
    FILTER "user = alice AND ts >= 20240101"
QUANTIZATION TIERS

Six ways to trade bytes for precision.

Every tier is one argument at index creation, and every tier keeps the full-precision re-rank. Pick the one that fits the machine.

TIER f32 4,096 B / vector32 bits / coord No compression. Exact, simple, the reference the other tiers are re-ranked against.
TIER int8 1,024 B / vector8 bits / coord One byte per coordinate. Compression you can reason about in your head.
TIER binary 128 B / vector1 bit / coord One sign bit per coordinate, the simplest code there is. The same budget as tq1, without the rotation TurboQuant applies first.
TIER tq1 128 B / vector1 bit / coord TurboQuant at one bit. The tightest budget on offer, with some recall given up; no trained codebook, so it stays live-writable.
DEFAULT tq2 256 B / vector2 bits / coord TurboQuant at two bits. The default: near-f32 recall after re-rank at a fraction of the RAM, still live-writable.
TIER tq4 512 B / vector4 bits / coord TurboQuant at four bits. Extra headroom for hard distributions where two bits leaves recall on the table.

B = bytes of code for one 1024-dim vector, held in RAM. The full f32 vector stays on disk for the re-rank.

CREATE AN INDEXRESP3
SKEG.VINDEX.CREATE docs 1024 tq2 disk
FILTERED SEARCH

Nearest, and also true.

Most retrieval questions have a second half: nearest to this query and belonging to this user, in this collection, newer than this date. skeg answers both halves in one call.

A payload is an opaque blob stored beside the vector in the key-value log, not in the graph, so the quantized index stays dense. Its key=value tokens are indexed as you write: integers as ranges, everything else as keywords, repeated keys as multi-valued. The filter runs on the RESP3 path only; the native protocol stays payload-free by design.

FILTER GRAMMARFILTER "…"
expr      := or
or        := and ( OR and )*
and       := not ( AND not )*
not       := [ NOT ] atom
atom      := '(' or ')' | predicate
predicate := field = value
             | field IN (v1, v2, …)
             | field >= | > | <= | < n
             | field BETWEEN a AND b
             | EXISTS field
FILTERED SEARCH DOCS →
WHAT IT SPEAKS

Your Redis client, a documented subset, and the SKEG commands.

skeg is not a Redis replacement. It answers the key-value commands an agent actually uses, and adds a vector family under one prefix. Transactions, scripting, cluster and pub/sub are out of scope, on purpose.

HELLOPINGECHOGETSETAPPENDDELEXISTSMGETMSETINCRDECRINCRBYDECRBYSELECTSKEG.*
RESP3 · 6379redis-cli
> HELLO 3
> SKEG.VINDEX.CREATE docs 1024 tq2 disk
> SKEG.VSET docs 1 <1024 × f32 LE> PAYLOAD "chapter-3"
> SET session:42 "ctx"
> SKEG.VSEARCH docs 10 100 <query> WITHPAYLOAD FILTER "lang = en"
> SKEG.STATS

Vectors travel as raw little-endian float32 bytes, dim × 4 long. Ids are unsigned 64-bit integers. Filters accept =, IN, ranges, BETWEEN, EXISTS and AND / OR / NOT.

WHAT IT IS NOT

A single node that tells you the truth.

skeg runs as one process on one machine. There is no replication, no consensus, no failover. A clean shutdown drains writes and syncs the log before it exits, and an exit code of zero means every barrier succeeded. A kill signal carries no promise.

Back it up by stopping it cleanly and copying the data directory. A hot copy of a running server is not a consistent backup, and the documentation says so.

OPERATIONS AND DEPLOYMENT DOCS →
THE CODE BEHIND THE MAP

Nine crates, one binary.

skeg is built from nine Rust crates. Each handles a different part of the engine, from reading a request to storing a vector.

skeg-resp3

RESP3 frame parser and encoder

skeg-server

Connections, request routing and resource limits

skeg-core

KV engine, value log, indices, compaction, cache

skeg-vector

Vamana graph, quantizers, flat scan

skeg-simd

Distance kernels, NEON with a scalar fallback

skeg-tenant

Auth, tenant ids, scoped keys, quotas

skeg-platform

mmap, fsync, F_NOCACHE, F_FULLFSYNC

skeg-proto

Wire types and frame encoding for the native protocol

skeg-telemetry

Atomic counters and histograms behind SKEG.STATS

Run it on the machine in front of you.Get started ↗