Skip to content

DOC-6854 Add redis-rb (Ruby) vector search docs: vecsearch page + ruby_home_query_vec - #3652

Merged
andy-stark-redis merged 3 commits into
mainfrom
DOC-6854-redis-rb-vecsearch-docs
Jul 31, 2026
Merged

DOC-6854 Add redis-rb (Ruby) vector search docs: vecsearch page + ruby_home_query_vec#3652
andy-stark-redis merged 3 commits into
mainfrom
DOC-6854-redis-rb-vecsearch-docs

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds Ruby (redis-rb) coverage for vector search with the Query Engine.

What's here

  • Page: content/develop/clients/ruby/vecsearch.md — a new "Index and query vectors" page for Ruby, mirroring the redis-py/jedis vector-search pages: indexing text embeddings in hash and JSON documents and running KNN queries, with a section on the differences for JSON documents.
  • Example: local_examples/client-specific/ruby/home_query_vec.rb — the ruby_home_query_vec example set backing the page.

Notes for reviewers

  • Requires redis-rb v6.0.0 or later (noted on the page).
  • Embeddings are generated locally with the informers gem running the ONNX all-MiniLM-L6-v2 model (384-dim) — the same model the other languages' vector pages and the Ruby semantic-cache example use, so vectors stay comparable across examples. No external embedding service is required.
  • Embeddings are normalised (normalize: true); this is load-bearing — the reported L2 distances and cross-example comparability depend on unit vectors.
  • Vector encoding: hash fields store raw little-endian float32 (Array#pack('e*')); JSON stores a plain Array<Float>, but the query parameter is packed bytes either way.
  • The page embeds the ruby_home_query_vec set; data/examples.json is git-ignored/generated (Ruby tabs appear when CI regenerates it).
  • Builds on the Query Engine docs (DOC-6843 Add redis-rb (Ruby) Query Engine docs: queryjson #3641).

Verification

home_query_vec.rb runs green against the released redis-rb 6.0.0 gem (published 2026-07-31) on Redis 8.8 with informers 1.3.0 — exit 0, and the canonical L2 distances (0.114169895649 / 0.610845208168 / 1.48624789715) are reproduced exactly on both the hash and JSON paths. RESP3-as-default changed nothing.

…y_home_query_vec example

Adds the Ruby "Index and query vectors" page and its backing example set,
mirroring the redis-py/jedis vecsearch pages (hash + JSON). The embedding
library was the open question that got vector search deferred out of
DOC-6843; resolved it by reusing the semantic-cache Ruby choice — informers
running the ONNX all-MiniLM-L6-v2 encoder locally — the same 384-dim model
every other language's page uses, so vectors stay comparable across examples.
Normalising the embeddings is what makes the reported L2 distances line up
with the canonical page; run-verified against the fork (QE branch) and
Redis 8, where informers matched the reference distances to ~7 significant
figures, much closer than the ONNX drift I had expected.

Learned: informers with normalised embeddings reproduces the canonical L2 distances almost exactly; the deferred embedding-lib decision was already answered by the semantic-cache Ruby example
Constraint: keep normalize on for every encode — the L2 distances and cross-example comparability depend on unit vectors
Constraint: embedding model/library must stay aligned with the semantic-cache Ruby example (all-MiniLM-L6-v2 via informers) or stored vectors stop being comparable
Recheck: when redis-rb#1356 ships in a released redis gem (page is a parked preview against the fork)
Ticket: DOC-6854
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@andy-stark-redis andy-stark-redis added do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

DOC-6854

@github-actions

Copy link
Copy Markdown
Contributor

andy-stark-redis added a commit that referenced this pull request Jul 22, 2026
Renamed the parked-PR thaw skill from `/pickup` to `/unpark` — directory, frontmatter, title, and prose — to free the `/pickup` name for another skill where it fits better; `park`/`unpark` also reads as a cleaner verb pair. Updated the two files that reference it, `/park` and the shared `_shared/park-manifest.md` contract, so the pairing stays consistent. The three parked PRs that instructed `/pickup <n>` (#3611, #3641, #3652) were updated out-of-band so no stale invocation survives. Approved by dwdougherty; Cursor Bugbot clean.

Directive: Two "pickup" strings are left un-renamed on purpose — the historical .claude/state/assess-comments.coverage.md audit log (it records the skill's old name as it was at the time; renaming falsifies history) and the "Trigger to pick up:" manifest field name in park-manifest.md (a header field, not the skill name). Don't "fix" them in a follow-up grep-and-replace.
Ticket: DOC-6876
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eleased)

redis-rb 6.0.0 shipped the Query Engine (search module) to rubygems.org on
2026-07-31; home_query_vec.rb re-verified green against the released gem on
Redis 8.8 with informers 1.3.0 — canonical KNN distances reproduced exactly.
Remove the 'not yet in a released gem' banner and add a v6.0.0+ note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history:

Memory updated at a13be71

@andy-stark-redis
andy-stark-redis requested a review from a team July 31, 2026 09:23
@andy-stark-redis andy-stark-redis self-assigned this Jul 31, 2026
@andy-stark-redis andy-stark-redis added clients Client library docs and removed do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@andy-stark-redis

Copy link
Copy Markdown
Contributor Author

Unpark reflection (predicted vs actual) — 2026-07-31

redis-rb 6.0.0 shipped the Query Engine (search/ module) to rubygems.org on 2026-07-31, later than v5.4.1. Trigger fired.

  • Predicted at park (MEDIUM confidence): the run-verified KNN distances / API shape could shift between fork master and the released gem.
  • Actual: no behavioural change. home_query_vec.rb ran green against the released 6.0.0 gem on Redis 8.8 (search) with informers 1.3.0 — exit 0, and the canonical L2 distances reproduced exactly (0.114169895649 / 0.610845208168 / 1.48624789715) on both the hash and JSON paths. RESP3-as-default changed nothing. The only search-module drift since park was additive (optional SearchResult#warnings, new ft_aliaslist) and doesn't touch the vector query/result surface.
  • Reconciliation: removed the preview banner; added a "requires redis-rb v6.0.0 or later" note.

The normalize: true / model-alignment constraints from the original commit still hold — stored vectors stop being comparable across examples otherwise. Branch merged up to date with main (100 commits, no conflicts). hugo --gc exits 0; the only vecsearch warning is the expected local Example not found "ruby_home_query_vec" (examples.json is git-ignored, regenerated by build/local_examples.py in CI). Ready for /finalize.

@andy-stark-redis andy-stark-redis changed the title DOC-6854 Add redis-rb (Ruby) vector search docs: vecsearch page + ruby_home_query_vec [PARKED] DOC-6854 Add redis-rb (Ruby) vector search docs: vecsearch page + ruby_home_query_vec Jul 31, 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.

LGTM.

@andy-stark-redis
andy-stark-redis merged commit 76fdf63 into main Jul 31, 2026
86 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-6854-redis-rb-vecsearch-docs branch July 31, 2026 15:56
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