DOC-7033 Add Rust (redis-rs) vector set client docs - #3923
Open
andy-stark-redis wants to merge 2 commits into
Open
DOC-7033 Add Rust (redis-rs) vector set client docs#3923andy-stark-redis wants to merge 2 commits into
andy-stark-redis wants to merge 2 commits into
Conversation
Adds content/develop/clients/rust/vecsets.md and the home_vecsets example (rust-sync and rust-async variants), giving the vector-set client docs a Rust tab alongside the existing Go, Node.js, Python, and Lettuce tabs. Uses the same famous-people/text-embedding dataset as the other clients, via the fastembed crate running all-MiniLM-L6-v2 locally (ONNX, mean-pooled, L2-normalized by default). Unlike the Ruby side of DOC-7033, this is not parked: vector-set support has been in a released redis-rs tag (1.6.0) since 2026-08-15, gated behind the opt-in `vector-sets` Cargo feature. Recheck: ran both variants for real against Redis 8.8.0, not just compiled them. Output matches the Python tab on four of five queries; the entertainer_query ranks Linus Pauling ahead of Masako Natsume where Python ranks them the other way. This is the same divergence found on the Ruby side (also fastembed/informers vs. sentence-transformers) — both ONNX-based bindings agree with each other and both differ from the PyTorch-based binding on this one near-tied pair. Comments and assertions reflect the real observed values. Gaps: this surfaced a pre-existing, unrelated defect worth a separate look — the already-shipped local_examples/{rust-sync, rust-async}/dt-vecsets.rs (DOC-6510, vecset_tutorial set on the data-types vector-sets index page) imports VectorAddInput, EmbeddingInput, VAddOptions, VSimOptions, and VectorSimilaritySearchInput from the `redis` crate root. As of the released 1.6.0 crate (the version that introduced vector-set support at all), those types live under `redis::vector_sets::*` instead — confirmed by compiling against the real crate, not inferred. The root-level imports have likely never compiled against any released version. Also: the vector-sets Cargo feature only takes effect via a `[features] vector-sets = ["redis/vector-sets"]` re-export in the consuming crate's own Cargo.toml — a bare `redis = { features = ["vector-sets"] }` dependency line, which is what build/example-test-harness/run.sh's run_rust_sync/run_rust_async functions currently write, does not satisfy dt-vecsets.rs's `#[cfg( feature = "vector-sets")]` gate, so that test module silently compiles to zero tests today. Neither issue is in this PR's files or scope; flagging for a follow-up rather than fixing in place. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Contributor
Contributor
🧠 Redis MemoryFound 7 related items from repository history (2 new this commit):
Memory updated at ddd76cd |
Rust has sync and async client-specific example variants, not a single "Rust" language key, so clients-example needs lang_filter="Rust-Sync,Rust-Async" (matching the existing rust/json.md page) rather than lang_filter="Rust". The wrong filter matched no client and rendered as "Error" on the staging build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
5 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
content/develop/clients/rust/vecsets.mdand a newhome_vecsetsexample(
local_examples/client-specific/{rust-sync,rust-async}/home_vecsets.rs), givingthe vector-set client docs a Rust tab alongside the existing Go, Node.js, Python,
and Lettuce tabs. Uses the same "famous people" text-embedding dataset as the
other clients, via the
fastembedcrate runningall-MiniLM-L6-v2locally.Sibling PR to #3922 (Ruby), from the same DOC-7033 ticket. Unlike Ruby, this one
is not parked — vector-set support has shipped in a released
redis-rstag(
1.6.0, 2026-08-15) since before this PR, gated behind the opt-invector-setsCargo feature.
Verification
Both the sync and async variants were compiled and run for real against a live
Redis 8.8.0 server with vector sets enabled — not just checked for type
correctness. Four of the five printed queries match the existing Python
(
sentence-transformers) tab's ordering exactly. Theentertainer_querydoesnot: this binding (via
fastembed, ONNX) ranks "Linus Pauling" ahead of "MasakoNatsume" where Python's
sentence-transformers(PyTorch) binding ranks them theother way. This is the same divergence observed on the parked Ruby PR (#3922),
which also uses an ONNX-based binding (
informers) — both ONNX bindings agreewith each other and both differ from the one PyTorch binding on this one
near-tied pair. This looks like a genuine cross-runtime floating-point
difference rather than a bug in any one example; comments and assertions in
both files reflect the real observed output, not values copied from the Python
tab.
Two unrelated pre-existing issues found while building the test harness for this PR (not fixed here, flagging for a follow-up)
local_examples/{rust-sync,rust-async}/dt-vecsets.rs(DOC-6510, thevecset_tutorialexample on the data-types vector-sets index page) importsVectorAddInput,EmbeddingInput,VAddOptions,VSimOptions, andVectorSimilaritySearchInputfrom therediscrate root. As of the released1.6.0crate — the version that introduced vector-set support in the firstplace — those types live under
redis::vector_sets::*instead. Confirmed byactually compiling against the real crate (not inferred from a changelog):
the root-level imports fail to resolve. The root-level import path has likely
never compiled against any released version of the crate.
vector-setsCargo feature is not wired through.#[cfg(feature = "vector-sets")]checks the consuming crate's own feature table, not adependency's feature. It only takes effect with a
[features]\nvector-sets = ["redis/vector-sets"]re-export in the crate thatcompiles the example.
build/example-test-harness/run.sh'srun_rust_syncand
run_rust_asyncfunctions currently write a bareredis = { version = "1.3", features = ["json"] }dependency line with nosuch re-export, so
dt-vecsets.rs's test module silently compiles to zerotests under that harness today (verified by reproducing the same setup and
watching
cargo testreport0 testswith anunexpected cfg conditionwarning, then fixing it locally to confirm the module does contain real
tests once the feature is wired correctly).
Neither of these touches this PR's own files, so left alone here rather than
fixed in passing.
Also not done here, deliberately
data/command-api-mapping/VADD.jsonand siblings still only have aredis_pyentry. Adding a
rustentry is in scope for DOC-7033 but is a separate,mechanical follow-up rather than part of this PR.
🤖 Generated with Claude Code
Note
Low Risk
Documentation and local example tests only; no runtime or library code changes in this PR.
Overview
Adds Rust vector set documentation alongside the existing client tabs: a new
vecsets.mdpage that walks through embedding text withfastembed, storing vectors viavadd_options/VAddOptions, and querying withvsim/VSimOptions(including top-K and attribute filters), with thevector-setsCargo feature called out in the setup snippet.The page pulls live snippets from a new
home_vecsetsexample set in sync and async Rust tests that mirror the shared “famous people” dataset used by other clients, including assertions on realVSIMresult ordering from the ONNXfastembedpath.Reviewed by Cursor Bugbot for commit ddd76cd. Bugbot is set up for automated code reviews on this repo. Configure here.