Skip to content

DOC-7033 Add Ruby (redis-rb) vector set client docs - #3922

Merged
andy-stark-redis merged 5 commits into
mainfrom
DOC-7033-redis-rb-vecsets-examples
Nov 25, 2026
Merged

andy-stark-redis merged 5 commits into
mainfrom
DOC-7033-redis-rb-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/ruby/vecsets.md and a new home_vecsets example
(local_examples/client-specific/ruby/home_vecsets.rb), giving the vector-set
client 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 informers gem running sentence-transformers/all-MiniLM-L6-v2 locally.

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 tab
for the separate vecset_tutorial example set embedded on the data-types
tutorial pages (content/develop/data-types/vector-sets/_index.md,
memory.md, performance.md), alongside the existing Python tab. No page
edits needed there: those pages embed clients-example with no lang_filter,
so the tab appears once examples.json regenerates. It is a different example
family from the client guide, with a different file placement convention —
local_examples/<set>/<client-alias>/<file>, resolved by convention_src_path()
in run.sh rather than the legacy_src_path() case-statement used by the
other Ruby dt_*.rb tutorial files.

Kernel#puts special-cases Array (prints one element per line, no brackets)
but not Hash, so the five vemb calls, vsim_basic and the two vsim_filter
queries use p to 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) on redis:8.12-rc3. Both example files ran unchanged on the released gem and exited 0, and vector_sets.rb at v6.1.0 is the same blob as when the examples were written. home_vecsets.rb printed the same orderings as its comments, including the Ruby-specific entertainer order (Linus Pauling before Masako Natsume), which comes from the informers and onnxruntime bindings and differs from the Python tab.

The page's Gemfile snippet pins redis to '>= 6.1', and two hash outputs in dt_vec_set.rb use Ruby 3.4 and later inspect spacing. The examples build produces a Ruby tab for both vecset_tutorial and home_vecsets. Verified on the rc3 image, not a GA image, because redis:8.12 was 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.md walks through text embeddings with informers and sentence-transformers/all-MiniLM-L6-v2, then vadd / vsim (including count and attribute filter), with snippets pulled from the new home_vecsets Ruby example.

local_examples/client-specific/ruby/home_vecsets.rb mirrors the other clients’ “famous people” demo: embed descriptions, store vectors and born/died attributes, and assert similarity query orderings.

local_examples/vecset_tutorial/ruby/dt_vec_set.rb adds a Ruby tab for the data-types vecset_tutorial set (vadd, vemb, attrs, vsim options/filters, quantization, dimension reduction), using p where needed so array/hash output matches docs.

run.sh registers home_vecsets:ruby so 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.

@andy-stark-redis andy-stark-redis added parked PR speculatively added based on pre-release info. Check validity when release goes ahead. do not merge yet labels Sep 4, 2026
@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 12 related items from repository history (2 new this commit):

Memory updated at d966d1e

@andy-stark-redis
andy-stark-redis marked this pull request as ready for review September 4, 2026 10:22
@andy-stark-redis andy-stark-redis self-assigned this Sep 4, 2026
@andy-stark-redis
andy-stark-redis requested a review from a team September 4, 2026 10:23
@andy-stark-redis andy-stark-redis added the clients Client library docs label Sep 4, 2026

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment: a broken link.

Comment thread content/develop/clients/ruby/vecsets.md Outdated
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^ link yields a 404 error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

andy-stark-redis and others added 4 commits November 24, 2026 09:50
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]>
@andy-stark-redis
andy-stark-redis force-pushed the DOC-7033-redis-rb-vecsets-examples branch from b62bd2c to 5ebf6b6 Compare November 24, 2026 10:00
@andy-stark-redis andy-stark-redis changed the title DOC-7033 Add Ruby (redis-rb) vector set client docs [PARKED] DOC-7033 Add Ruby (redis-rb) vector set client docs Nov 24, 2026
@andy-stark-redis andy-stark-redis removed do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Nov 24, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5ebf6b6. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@andy-stark-redis
andy-stark-redis merged commit e18f0a8 into main Nov 25, 2026
115 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7033-redis-rb-vecsets-examples branch November 25, 2026 09:38
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.

2 participants