RESP3 frame parser and encoder
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.
Between your call and the ranked answer, four things happen.
The full vectors never have to be in memory.
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.
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.
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.
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.
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
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.
> 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
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.
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)
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.
SKEG_MEMORY_LIMIT_BYTES=268435456 \ skeg --data-dir ./data
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.
skeg --tenant-auth auth.kdb --tenant-strict \ --admin-tenant ops > HELLO 3 AUTH ops s3cret > SKEG.QUOTA.SET acme 100000 *
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.
> 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"
Every tier is one argument at index creation, and every tier keeps the full-precision re-rank. Pick the one that fits the machine.
B = bytes of code for one 1024-dim vector, held in RAM. The full f32 vector stays on disk for the re-rank.
SKEG.VINDEX.CREATE docs 1024 tq2 diskMost 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.
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 fieldskeg 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.
> 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.
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 →skeg is built from nine Rust crates. Each handles a different part of the engine, from reading a request to storing a vector.
RESP3 frame parser and encoder
Connections, request routing and resource limits
KV engine, value log, indices, compaction, cache
Vamana graph, quantizers, flat scan
Distance kernels, NEON with a scalar fallback
Auth, tenant ids, scoped keys, quotas
mmap, fsync, F_NOCACHE, F_FULLFSYNC
Wire types and frame encoding for the native protocol
Atomic counters and histograms behind SKEG.STATS