DOC-7033 Add Ruby (redis-rb) vector set client docs [PARKED] - #3922
Open
andy-stark-redis wants to merge 2 commits into
Open
DOC-7033 Add Ruby (redis-rb) vector set client docs [PARKED]#3922andy-stark-redis wants to merge 2 commits into
andy-stark-redis wants to merge 2 commits into
Conversation
Adds content/develop/clients/ruby/vecsets.md and the home_vecsets example, following the same famous-people/text-embedding pattern as the go, node, python, and java tabs. Written against redis-rb `master` (redis/redis-rb#1382, merged 2026-09-03), which is not yet released — v6.0.0 predates the merge. Recheck: ran the example for real against redis-rb master + Redis 8.8.0 rather than trusting the printed values inherited from the Python tab's page prose. Four of five queries matched Python's ordering exactly, but the "entertainer" query put Linus Pauling ahead of Masako Natsume where Python ranks them the other way around — a genuine cross-binding embedding difference between `informers`/onnxruntime and `sentence-transformers`, not a bug in either example. Comments and assertions in home_vecsets.rb reflect Ruby's actual observed output, not Python's. Gaps: did not run the full build/make.py example pipeline to confirm the Ruby tab actually renders with content on the built site (that regenerates examples.json from all client repos, out of scope for a parked PR's own verification). A plain `npx hugo` build is clean with no shortcode/link warnings, but that doesn't prove the TCE tab has content yet. Directive: do not add a `ruby` entry to data/command-api-mapping files for VADD/VSIM/etc. until the gem actually ships — mapping entries against unreleased APIs have been wrong before (DOC-6957). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Contributor
Contributor
🧠 Redis MemoryFound 8 related items from repository history (3 new this commit):
Memory updated at 884de28 |
Adds local_examples/vecset_tutorial/ruby/dt_vec_set.rb, giving the vecset_tutorial set (used on content/develop/data-types/vector-sets/ _index.md, memory.md, and performance.md) a Ruby tab alongside the existing Python one. No page edits needed: these pages embed clients-example with no lang_filter, so the tab appears once examples.json regenerates from this file (same as DOC-6957). This is the vecset_tutorial set, separate from the home_vecsets set this branch already adds for content/develop/clients/ruby/vecsets.md — same ticket, same park status (both wait on the same unreleased redis-rb gem), different example family (data-type tutorial vs. client guide). Placed at local_examples/vecset_tutorial/ruby/ rather than local_examples/ruby/dt_vec_set.rb: this set resolves client files by convention_src_path() in build/example-test-harness/run.sh (local_examples/<set>/<client-alias>/<file>, no case-statement entry needed), matching where the existing Python file (local_examples/vecset_tutorial/redis-py/dt_vec_set.py) already lives. That's a different convention from the legacy_src_path() case-statement entries used by other Ruby dt_*.rb tutorial files (local_examples/ruby/dt_<name>.rb). Recheck: ran the whole file for real against redis-rb master + Redis 8.8.0, not just inferred signatures. All values matched the existing Python tab's documented output exactly (no embedding involved here, unlike home_vecsets, so no cross-binding drift expected or found). Found and fixed while verifying: Kernel#puts special-cases Array, printing one element per line with no brackets/quotes, rather than calling Array#inspect. Five of the printed steps return arrays (vemb's five calls, vsim_basic, and the two vsim_filter queries) and an initial draft written from the Python page's printed values used plain `puts` for all of them, which would have shown a reader one-value-per-line instead of the bracketed list documented in the `# >>>` comments. Switched those specific calls to `p`, which calls inspect. Hash didn't have this problem — Kernel#puts does not special-case Hash, so `puts a_hash` already prints the same inspect-style form documented. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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/ruby/vecsets.mdand a newhome_vecsetsexample(
local_examples/client-specific/ruby/home_vecsets.rb), giving the vector-setclient docs a Ruby 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
informersgem runningsentence-transformers/all-MiniLM-L6-v2locally.Follow-up to the vector-set client docs already shipped for other clients, and
sibling to DOC-6957 (Ruby array data type examples) in using redis-rb
masterahead of a release.
Also adds
local_examples/vecset_tutorial/ruby/dt_vec_set.rb— a Ruby tabfor the separate
vecset_tutorialexample set embedded on the data-typestutorial pages (
content/develop/data-types/vector-sets/_index.md,memory.md,performance.md), alongside the existing Python tab. No pageedits needed there: those pages embed
clients-examplewith nolang_filter,so the tab appears once
examples.jsonregenerates. Same park status as therest of this PR (same unreleased gem), different example family (data-type
tutorial vs. client guide) and a different file placement convention —
local_examples/<set>/<client-alias>/<file>, resolved byconvention_src_path()inrun.shrather than thelegacy_src_path()case-statement used by the other Ruby
dt_*.rbtutorial files.Ran this file for real too, against the same redis-rb
master+ Redis 8.8.0setup. One real bug found and fixed in the process:
Kernel#putsspecial-casesArray(prints one element per line, no brackets/quotes) but notHash, so aninitial draft's
# >>>comments for five array-returning steps (the fivevembcalls,vsim_basic, and the twovsim_filterqueries) would have shownreaders one-value-per-line instead of the bracketed list actually documented.
Switched those specific print calls to
p(which calls.inspect).Park manifest
Ticket: DOC-7033
Parked at: 2026-09-04
Trigger to pick up: a released
redisgem (tag newer thanv6.0.0) that containslib/redis/commands/vector_sets.rb— testably,gh api "repos/redis/redis-rb/contents/lib/redis/commands?ref=<tag>" --jq '.[].name' | grep vector_setsreturns a match at that tag.Labels: parked, do not merge yet
Pinned sources (state observed at park time, 2026-09-04)
5a495492a3e9b8b23607c457da0d3254f1d21cd9; headf2bdabfb002dd3c7c672bd3494f0d93402b9ff90; basemastergh api repos/redis/redis-rb/pulls/1382 --jq '{merge_commit_sha,head_sha:.head.sha,base:.base.ref,merged_at}'lib/redis/commands/vector_sets.rb@master— the file every signature came frome2dc3e9c70f3121199f57280f33f899291cd88c9, 16689 bytesgh api "repos/redis/redis-rb/contents/lib/redis/commands/vector_sets.rb?ref=master" --jq '{sha,size}'v6.0.0, published 2026-07-31; confirmed novector_sets.rbat that taggh api repos/redis/redis-rb/releases --jq '.[0].tag_name'The blob SHA is the drift tripwire: if
e2dc3e9cstill matches at unpark, no signature in this PR can have moved.Observed shape the page assumes
HIGH confidence — method signatures and wire behavior. Read directly from
vector_sets.rbat the pinned blob, and every call in the example was run for real (not just compiled) against redis-rbmaster+ Redis 8.8.0 with a live vector-set-capable server.HIGH confidence — semantic correctness, but library-specific. All eight query results were captured from an actual run, not inherited from another client's tab. Four of the five printed query results match the Python (
sentence-transformers) tab's ordering exactly. Theentertainer_queryresult does not: Ruby'sinformers/onnxruntime binding ranks "Linus Pauling" ahead of "Masako Natsume", where Python'ssentence-transformersbinding ranks them the other way around. Both are plausible outputs of the same nominal model — this is a genuine cross-binding floating-point/pooling difference, not a bug in either example. The doc's comments and assertions reflect Ruby's actual observed values.Re-check checklist
home_vecsets.rbanddt_vec_set.rb) against the released gem + Redis 8.8+, not just re-diff signatures. Embedding-dependent orderings (home_vecsets.rbonly) are exactly the kind of thing a signature diff can't catch.vector_sets.rbagainst blobe2dc3e9c; if it moved, re-check every method call in both example files (vadd,vcard,vdim,vemb,vsetattr,vgetattr,vrem,vsim) against the new source, not just the ones each file happens to use.rubyentry todata/command-api-mapping/VADD.json,VSIM.json,VINFO.json,VDIM.json,VCARD.json,VEMB.json,VLINKS.json,VRANGE.json,VSETATTR.json,VGETATTR.json— deliberately not done in this PR (mapping entries against unreleased APIs have been wrong before — DOC-6957).vecsets.md(client guide) andcontent/develop/data-types/vector-sets/{_index,memory,performance}.md(data-type tutorial) afterexamples.jsonregenerates from a fullbuild/make.pyrun — this PR's own verification only rannpx hugoon the checked-in tree (clean, no shortcode/link warnings) and ran both example scripts directly; it did not run the full multi-client example-generation pipeline, so neither TCE tab's actual rendered content was observed.<!-- TODO(DOC-7033) -->comment at the top ofvecsets.mdand update theGemfileinstall snippet from thegit:/branch: 'master'pin to the real released version.On unpark, then
When the trigger fires, run
/unpark <this PR>. It reconciles the docs against the now-settled source and takes the PR through the normal/reflect→/finalizepipeline to merge./finalizeis deferred until then — squashing now would discard this episodic note. Thedo not merge yetguard holds until/finalizecompletes.🤖 Generated with Claude Code
Note
Low Risk
Documentation and example code only; merge is blocked until a released redis-rb gem includes vector-set APIs, limiting exposure of the master-only install instructions.
Overview
Adds a Ruby vector set embeddings page at
vecsets.mdand wires it into the sharedhome_vecsetsexample set so Ruby appears alongside the other client tabs.The guide walks through
informers+redis-rb(vadd,vsimwithcountand attribute filters) using the same famous-people embedding tutorial. The runnable example lives inhome_vecsets.rb, with assertions on observed similarity rankings from the Ruby ONNX stack.The page still pins
redisfrommasterand carries a DOC-7033 note because vector-set commands are not in a released gem yet—the PR is parked until that ships, so readers onv6.0.0would hitNoMethodErrorif this merged without the follow-up Gemfile/version update.Reviewed by Cursor Bugbot for commit c934f56. Bugbot is set up for automated code reviews on this repo. Configure here.