Beside the model, not instead of it.
The machine is already running something that wants the memory. skeg takes the disk, a bounded slice of RAM, and leaves the argument about the rest to somebody else.
Start a local Skeg server, index three articles and retrieve the two closest matches.
Install Skeg ↗Use the installed skeg executable and Python 3. Start the server in one terminal and prepare the Python environment in another.
data_dir=$(mktemp -d)
skeg --data-dir "$data_dir" --addr 127.0.0.1:6379 --protocol resp3python3 -m venv .venv
. .venv/bin/activate
python -m pip install redisCopy or download the example and run python first_search.py in the Python environment above. It stores three vectors and prints the IDs, similarity scores and titles of the two closest matches.
The example supplies the vectors. To index your own text, use the same embedding model for documents and queries.
FIRST SEARCH GUIDE →import os
import struct
import redis
port = int(os.environ.get("SKEG_LEARN_PORT", "6379"))
client = redis.Redis(
host="127.0.0.1", port=port, protocol=3, decode_responses=False
)
index = "learn_search"
def vector(values):
return struct.pack("<" + "f" * len(values), *values)
client.execute_command(
"SKEG.VINDEX.CREATE", index, 4, "KIND", "tq2", "BACKEND", "disk",
"PERSISTENCE", "durable", "IFNOTEXISTS",
)
articles = [
(1, "Reset your password", [1.0, 0.0, 0.0, 0.0]),
(2, "Download an invoice", [0.0, 1.0, 0.0, 0.0]),
(3, "Recover account access", [0.8, 0.6, 0.0, 0.0]),
]
for row_id, title, coordinates in articles:
client.set(f"article:{row_id}:title", title)
client.execute_command("SKEG.VSET", index, row_id, vector(coordinates))
query = vector([1.0, 0.0, 0.0, 0.0])
hits = client.execute_command("SKEG.VSEARCH", index, 2, 100, query)
for offset in range(0, len(hits), 2):
row_id, score = hits[offset:offset + 2]
title = client.get(f"article:{int(row_id)}:title")
print(f"{int(row_id)} {float(score):.3f} {title.decode('utf-8')}")
Follow each integration's setup guide for its embedding model, dimensions and supported server and client versions.
See the client guideOPERATOR TOOLSskeg-cliTools for preparing stores, inspecting data and reading server counters. Check the commands supported by your CLI version.See the operator toolsANY REDIS CLIENTredis-cliInspect the RESP command surface from a terminal. Send vectors as raw float32 bytes from an application client.redis-cli -3 -p 6379One binary per platform, and it reads the processor it wakes up on. macOS on Apple silicon, Linux on arm64 or x86_64. The question is never whether the machine is big enough, only what you are willing to give it.
The machine is already running something that wants the memory. skeg takes the disk, a bounded slice of RAM, and leaves the argument about the rest to somebody else.
Because the index is read from disk and only compact codes stay resident, adding vectors adds disk, not resident memory. You size the box for the corpus, not for the count.
skeg reads the headroom the machine and its containers leave, and asks before it spends it. A write or a merge that would cross the line is refused with an error the client can see, instead of the process being killed mid-flight.
Include your Skeg version, the steps to reproduce the issue and the result you expected.
Open an issue ↗