Skip to content

Add VSIM neighbours feature to Workbench - #3929

Open
paoloredis wants to merge 4 commits into
mainfrom
DOC-7030
Open

Add VSIM neighbours feature to Workbench#3929
paoloredis wants to merge 4 commits into
mainfrom
DOC-7030

Conversation

@paoloredis

@paoloredis paoloredis commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Workbench-only UI that adds one batched Redis command per element view; no auth, data model, or backend changes.

Overview
When you open a vector-set element in the Workbench, the value pane now loads nearest neighbours via VSIM (alongside the existing VEMB / VGETATTR reads) and shows them as a bar chart with similarity scores.

Readers can change how many neighbours to fetch (5 / 10 / 25), run an optional attribute filter expression, clear the filter, and click a neighbour to drill into that element while keeping count and filter on the dock. VSIM options persist across re-renders and keyspace sweeps. Errors and empty filter results get explicit messaging; new CSS covers the controls, bars, and failed-read styling.

Reviewed by Cursor Bugbot for commit fdbe872. Bugbot is set up for automated code reviews on this repo. Configure here.

paoloredis and others added 3 commits September 4, 2026 14:57
Opening an element of a vector set showed its embedding and its
attributes — the two things Redis Insight shows — and stopped there. The
question a vector set exists to answer is which elements are near this
one, and answering it meant leaving the browser to type VSIM by hand.

So the element view ends with Nearest: VSIM ELE <element> WITHSCORES,
one bar per result in the order the server ranked them. A score runs 1
(identical) to 0 (opposite), so it is already the share of the track and
the list needs no axis. The element itself comes back first, scored 1 and
marked "this one" — it anchors the scale and says why it is there.

Clicking a neighbour opens it and asks again, which is how a reader
actually explores an embedding space: hop from a point to its neighbour
and see what that one is near.

Two controls, both arguments of VSIM a reader would change by hand: how
many to return (5/10/25 — one more is asked for, since the element itself
takes a place) and a FILTER expression. The filter is the one part of a
vector set whose effect cannot be seen from a reply, and a bad expression
shows the server's error rather than an empty list.

The command is in the READ WITH line with the others, so a reader can
take it away.

Verified against a live sandbox with three 2-d vectors: the near element
outranks the opposite one, the opposite one scores 0, a filter on
attributes cuts the list to what matches, a broken filter reports the
error, walking to a neighbour re-asks from there, and the count chips
change the COUNT in the command that runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The 5/10/25 chips borrow .rwb-chip from the KEYS heading, where it holds a
word and is padded for one. With a digit in it the number sat off centre and
each chip came out a different width. One fixed size, no padding, centred on
both axes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Enter re-rendered the pane, so the box the reader had just typed into was
gone and the caret went with it — the same thing the JSONPath box did before
DOC-7028. The reply now puts the caret back where it was. The × appears only
while a filter is in force and drops it in one click, the way emptying the box
by hand and pressing Enter does in two.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@paoloredis paoloredis changed the title Doc 7030 Add VSIM neighbours feature to Workbench Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

DOC-7030

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 10 related items from repository history (5 new this commit):

Memory updated at fdbe872

Comment thread static/js/redis-workbench.js
Comment thread static/js/redis-workbench.js
A filter can leave the element itself out of its own VSIM reply — failing the
expression, or having no attributes at all, is enough. The command asks for one
more than the chip on the assumption that first row is the element, so without
it the list showed one neighbour more than was asked for. Trimmed when the
element is absent.

A count chip only wrote the count, so the pane it rebuilt filled the filter box
from the last submitted filter and dropped whatever had been typed since. The
chip now searches with the box as it stands, which is what Search does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@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 fdbe872. Configure here.

dock.vsimOptions = function () {
if (!this.vsim) this.vsim = { count: VSIM_COUNTS[0], filter: '' };
return this.vsim;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Search state leaks across keys

Medium Severity

vsimOptions keeps count and filter on the dock with no key. Opening another vector set still runs VSIM with the previous FILTER, so a leftover expression such as .year > 2000 can hide every neighbour on an unrelated set.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fdbe872. Configure here.

@mich-elle-luna mich-elle-luna 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.

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants