Skip to content

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

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

DOC-7033 Add Ruby (redis-rb) vector set client docs [PARKED]#3922
andy-stark-redis wants to merge 2 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) in using redis-rb master
ahead of a release.

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. Same park status as the
rest 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 by
convention_src_path() in run.sh rather than the legacy_src_path()
case-statement used by the other Ruby dt_*.rb tutorial files.

Ran this file for real too, against the same redis-rb master + Redis 8.8.0
setup. One real bug found and fixed in the process: Kernel#puts special-cases
Array (prints one element per line, no brackets/quotes) but not Hash, so an
initial draft's # >>> comments for five array-returning steps (the five
vemb calls, vsim_basic, and the two vsim_filter queries) would have shown
readers one-value-per-line instead of the bracketed list actually documented.
Switched those specific print calls to p (which calls .inspect).

⛔ Do not merge yet

These examples are written against redis-rb master, where vector set
support is merged but not released. redis-rb#1382
merged 2026-09-03; the latest gem, v6.0.0 (2026-07-31), predates the
merge and has no lib/redis/commands/vector_sets.rb.

Merging to main auto-publishes. A reader on the released gem would get
NoMethodError on every line. Hold until a released gem ships the vector-set
commands.

Park manifest

Ticket: DOC-7033
Parked at: 2026-09-04
Trigger to pick up: a released redis gem (tag newer than v6.0.0) that contains lib/redis/commands/vector_sets.rb — testably, gh api "repos/redis/redis-rb/contents/lib/redis/commands?ref=<tag>" --jq '.[].name' | grep vector_sets returns a match at that tag.
Labels: parked, do not merge yet

Pinned sources (state observed at park time, 2026-09-04)

Source State @ park Re-fetch
redis-rb#1382 — "Add Vector Set commands" merged 2026-09-03T11:00:54Z; merge commit 5a495492a3e9b8b23607c457da0d3254f1d21cd9; head f2bdabfb002dd3c7c672bd3494f0d93402b9ff90; base master gh 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 from blob e2dc3e9c70f3121199f57280f33f899291cd88c9, 16689 bytes gh api "repos/redis/redis-rb/contents/lib/redis/commands/vector_sets.rb?ref=master" --jq '{sha,size}'
Released gem — the actual blocker latest release v6.0.0, published 2026-07-31; confirmed no vector_sets.rb at that tag gh api repos/redis/redis-rb/releases --jq '.[0].tag_name'

The blob SHA is the drift tripwire: if e2dc3e9c still 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.rb at the pinned blob, and every call in the example was run for real (not just compiled) against redis-rb master + 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. The entertainer_query result does not: Ruby's informers/onnxruntime binding ranks "Linus Pauling" ahead of "Masako Natsume", where Python's sentence-transformers binding 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

  • Re-run both example files end-to-end (home_vecsets.rb and dt_vec_set.rb) against the released gem + Redis 8.8+, not just re-diff signatures. Embedding-dependent orderings (home_vecsets.rb only) are exactly the kind of thing a signature diff can't catch.
  • Re-diff vector_sets.rb against blob e2dc3e9c; 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.
  • Add a ruby entry to data/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).
  • Confirm the Ruby tab actually renders on both vecsets.md (client guide) and content/develop/data-types/vector-sets/{_index,memory,performance}.md (data-type tutorial) after examples.json regenerates from a full build/make.py run — this PR's own verification only ran npx hugo on 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.
  • Resolve the <!-- TODO(DOC-7033) --> comment at the top of vecsets.md and update the Gemfile install snippet from the git:/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/finalize pipeline to merge. /finalize is deferred until then — squashing now would discard this episodic note. The do not merge yet guard holds until /finalize completes.

🤖 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.md and wires it into the shared home_vecsets example set so Ruby appears alongside the other client tabs.

The guide walks through informers + redis-rb (vadd, vsim with count and attribute filters) using the same famous-people embedding tutorial. The runnable example lives in home_vecsets.rb, with assertions on observed similarity rankings from the Ruby ONNX stack.

The page still pins redis from master and 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 on v6.0.0 would hit NoMethodError if 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.

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>
@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 8 related items from repository history (3 new this commit):

Memory updated at 884de28

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

Labels

clients Client library docs do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant