Skip to content

DOC-7033 Add Rust (redis-rs) vector set client docs - #3923

Open
andy-stark-redis wants to merge 2 commits into
mainfrom
DOC-7033-rust-vecsets-examples
Open

DOC-7033 Add Rust (redis-rs) vector set client docs#3923
andy-stark-redis wants to merge 2 commits into
mainfrom
DOC-7033-rust-vecsets-examples

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Adds content/develop/clients/rust/vecsets.md and a new home_vecsets example
(local_examples/client-specific/{rust-sync,rust-async}/home_vecsets.rs), 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.

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-rs tag
(1.6.0, 2026-08-15) since before this PR, gated behind the opt-in vector-sets
Cargo 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. The entertainer_query does
not: this binding (via fastembed, ONNX) ranks "Linus Pauling" ahead of "Masako
Natsume" where Python's sentence-transformers (PyTorch) binding ranks them the
other way. This is the same divergence observed on the parked Ruby PR (#3922),
which also uses an ONNX-based binding (informers) — both ONNX bindings agree
with 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)

  1. local_examples/{rust-sync,rust-async}/dt-vecsets.rs (DOC-6510, the
    vecset_tutorial example 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 in the first
    place — those types live under redis::vector_sets::* instead. Confirmed by
    actually 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.
  2. The vector-sets Cargo feature is not wired through. #[cfg(feature = "vector-sets")] checks the consuming crate's own feature table, not a
    dependency's feature. It only takes effect with a
    [features]\nvector-sets = ["redis/vector-sets"] re-export in the crate that
    compiles the example. build/example-test-harness/run.sh's run_rust_sync
    and run_rust_async functions currently write a bare
    redis = { version = "1.3", features = ["json"] } dependency line with no
    such re-export, so dt-vecsets.rs's test module silently compiles to zero
    tests under that harness today (verified by reproducing the same setup and
    watching cargo test report 0 tests with an unexpected cfg condition
    warning, 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.json and siblings still only have a redis_py
entry. Adding a rust entry 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.md page that walks through embedding text with fastembed, storing vectors via vadd_options / VAddOptions, and querying with vsim / VSimOptions (including top-K and attribute filters), with the vector-sets Cargo feature called out in the setup snippet.

The page pulls live snippets from a new home_vecsets example set in sync and async Rust tests that mirror the shared “famous people” dataset used by other clients, including assertions on real VSIM result ordering from the ONNX fastembed path.

Reviewed by Cursor Bugbot for commit ddd76cd. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

DOC-7033

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant