Repository navigation
DOC-7033 Add Ruby (redis-rb) vector set client docs - #3922
Conversation
🧠 Redis MemoryFound 12 related items from repository history (2 new this commit):
Memory updated at d966d1e |
dwdougherty
left a comment
There was a problem hiding this comment.
Just one comment: a broken link.
| particularly optimized to work with text embedding vectors (see | ||
| [Redis for AI](/content/develop/ai/_index.md) to learn more about text | ||
| embeddings). The example below shows how to use the | ||
| [`informers`](https://github.com/andreibondarev/informers) gem to generate |
There was a problem hiding this comment.
^^^ link yields a 404 error.
There was a problem hiding this comment.
Fixed — wrong GitHub org, I'd mistyped it. Correct repo is ankane/informers (same one already linked correctly on the sibling vecsearch.md page). Pushed in b62bd2c.
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 <[email protected]>
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 <[email protected]>
Wrong GitHub org — https://github.com/andreibondarev/informers 404s. The correct repo is ankane/informers, already linked correctly on the sibling vecsearch.md page (DOC-6854). A recall error, not a renamed/moved repo: confirmed the wrong URL 404s and the right one 200s. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Unpark reconciliation. redis-rb v6.1.0 (2026-11-23) ships lib/redis/commands/vector_sets.rb, and the file is the same blob (e2dc3e9c) the examples were written against, so no signature moved. Both example files ran end to end against v6.1.0 (redis-client 0.31.0) on redis:8.12-rc3 and exited 0 with their assertions holding. home_vecsets.rb printed the same orderings as its comments, including the Ruby-specific entertainer order where Linus Pauling precedes Masako Natsume.
Three edits. The page drops the park TODO comment. The Gemfile snippet pins redis to '>= 6.1' instead of the git master branch, because 6.0.0 has no vector set commands. Two hash outputs in dt_vec_set.rb change from {"a"=>1} to {"a" => 1}: Ruby 3.4 and later print spaces around the arrow, and the comments had been written on an older Ruby, so a reader on a current Ruby would see a different string.
Learned: expected-output comments for Ruby hashes depend on the Ruby version, since 3.4 changed Hash#inspect; regenerate them on the Ruby readers will use
Gaps: verified on redis:8.12-rc3, not a GA image; the Ruby tab was checked by building the examples data into a scratch directory, not by a full Hugo render
Ticket: DOC-7033
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
b62bd2c to
5ebf6b6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5ebf6b6. Configure here.
| # STEP_START import | ||
| require 'redis' | ||
| require 'informers' | ||
| # STEP_END |
There was a problem hiding this comment.
Harness cannot locate Ruby vecsets example
Medium Severity
home_vecsets.rb lives under local_examples/client-specific/ruby/, which the example harness only finds through a legacy_src_path entry. Python, Node, Go, and Lettuce already have home_vecsets mappings there; Ruby does not, so run.sh --with-models home_vecsets ruby skips the new assertions instead of running them.
Reviewed by Cursor Bugbot for commit 5ebf6b6. Configure here.
There was a problem hiding this comment.
Fixed in d966d1e: added a home_vecsets:ruby entry to legacy_src_path() in build/example-test-harness/run.sh. src_path now resolves home_vecsets for Ruby to local_examples/client-specific/ruby/home_vecsets.rb. I checked the path resolution only and did not run the harness end to end.
Bugbot was right: run.sh resolves home_vecsets through a legacy_src_path entry per client, because the file lives under local_examples/client-specific/ rather than a set directory, and Ruby had none. run.sh --with-models home_vecsets ruby would have found no source and skipped the example instead of running its assertions. Added home_vecsets:ruby next to the other clients. Sourcing src_path from run.sh now resolves home_vecsets to client-specific/ruby/home_vecsets.rb and vecset_tutorial to vecset_tutorial/ruby/dt_vec_set.rb, which already worked through the directory convention. Learned: a new client-specific example needs a legacy_src_path entry in the test harness, or run.sh silently skips it Gaps: resolved the path only; did not run run.sh end to end, which installs gems and downloads the embedding model Ticket: DOC-7033 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>


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).
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. It is a different examplefamily from the client guide, with a different file placement convention —
local_examples/<set>/<client-alias>/<file>, resolved byconvention_src_path()in
run.shrather than thelegacy_src_path()case-statement used by theother Ruby
dt_*.rbtutorial files.Kernel#putsspecial-casesArray(prints one element per line, no brackets)but not
Hash, so the fivevembcalls,vsim_basicand the twovsim_filterqueries use
pto show the bracketed list.Verification
Run against released redis-rb v6.1.0 (redis-client 0.31.0, which ships
lib/redis/commands/vector_sets.rb) onredis:8.12-rc3. Both example files ran unchanged on the released gem and exited 0, andvector_sets.rbat v6.1.0 is the same blob as when the examples were written.home_vecsets.rbprinted the same orderings as its comments, including the Ruby-specific entertainer order (Linus Pauling before Masako Natsume), which comes from theinformersand onnxruntime bindings and differs from the Python tab.The page's Gemfile snippet pins
redisto'>= 6.1', and two hash outputs indt_vec_set.rbuse Ruby 3.4 and laterinspectspacing. The examples build produces aRubytab for bothvecset_tutorialandhome_vecsets. Verified on therc3image, not a GA image, becauseredis:8.12was not yet on Docker Hub.🤖 Generated with Claude Code
Note
Low Risk
Documentation and example scripts only; no application or server behavior changes.
Overview
Adds Ruby (
redis-rb) coverage for Redis vector sets in docs and the example test harness.A new client guide at
content/develop/clients/ruby/vecsets.mdwalks through text embeddings withinformersandsentence-transformers/all-MiniLM-L6-v2, thenvadd/vsim(includingcountand attributefilter), with snippets pulled from the newhome_vecsetsRuby example.local_examples/client-specific/ruby/home_vecsets.rbmirrors the other clients’ “famous people” demo: embed descriptions, store vectors andborn/diedattributes, and assert similarity query orderings.local_examples/vecset_tutorial/ruby/dt_vec_set.rbadds a Ruby tab for the data-typesvecset_tutorialset (vadd,vemb, attrs,vsimoptions/filters, quantization, dimension reduction), usingpwhere needed so array/hash output matches docs.run.shregistershome_vecsets:rubyso CI can run the client example alongside Go, Node, Python, and Lettuce.Reviewed by Cursor Bugbot for commit d966d1e. Bugbot is set up for automated code reviews on this repo. Configure here.