RI-8317 Detect and highlight large vector embeddings in the query editor#6215
Merged
dantovska merged 7 commits intoJul 22, 2026
Merged
Conversation
Contributor
Code Coverage - Frontend unit tests
Test suite run success7852 tests passing in 867 suites. Report generated by 🧪jest coverage report action from d57ca21 |
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 20, 2026 10:33
d25aecb to
5a9bf1b
Compare
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 20, 2026 10:51
5a9bf1b to
5a97a26
Compare
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 20, 2026 11:00
5a97a26 to
5952bbb
Compare
dantovska
marked this pull request as ready for review
July 20, 2026 12:09
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 221b066167
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
valkirilov
reviewed
Jul 20, 2026
| --monaco-color-bg: ${bgColor}; | ||
| --monaco-color-params: ${colors.text.discovery200}; | ||
|
|
pawelangelow
approved these changes
Jul 22, 2026
Add a pure, source-agnostic detector that scans query text and returns marks (range + metadata) for every large vector embedding it finds: binary FLOAT32 "\x" blobs (validated with isBinaryVector) and numeric arrays with >= 10 elements. Each mark carries range, format, byte size, dimensions, a first-3/last-2 preview, and the FT.SEARCH PARAMS argument name when applicable. Expose the marks through a useVectorEmbeddingMarks hook composed inside useQueryEditor, so both the Workbench and Vector Search editors receive them with no extra wiring. Recomputes on query change. Data only, no user-visible change yet; the collapse-rendering ticket consumes these marks. References: #RI-8317
Render a subtle inline background (plus a hover tooltip showing format, dimensions and byte size) behind every embedding surfaced by useVectorEmbeddingMarks. The new useVectorEmbeddingDecorations hook maps each mark's character range to a Monaco range and applies decorations, mirroring the existing useQueryDecorations pattern. Composed inside useQueryEditor, so both the Workbench and Vector Search editors show the highlight. Adds a themed .monaco-vector-embedding style. References: #RI-8317
Move the embedding highlight out of the shared CodeEditor into a self-contained VectorEmbeddingHighlight component (styles + detection + decoration logic) so it can grow independently. CodeEditor and useQueryEditor are no longer touched by embedding concerns; the component is rendered next to the editor in Workbench and Vector Search. Also move the VectorEmbeddingMark/VectorEmbeddingFormat types into a dedicated vectorEmbeddingUtils.types.ts and trim non-essential comments. References: #RI-8317
- i18n the embedding hover tooltip (en/bg) instead of a hardcoded English string, and stop exposing the raw format enum to users - extract a buildMark helper to remove duplication between the two detection branches - keep style import last and trim the highlight barrel to a single export References: #RI-8317
Drop the border; keep just a neutral greyish background with a small radius behind detected embeddings. References: #RI-8317
PARAMS <nargs> counts the tokens that follow (each name and value), not name/value pairs, so the PARAMS lookup must iterate nargs / 2 pairs. Using nargs directly walked past the params list on multi-param queries and could stamp a bogus paramName on an embedding outside PARAMS. Add regression tests for multi-param and trailing non-param blobs. References: #RI-8317
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 22, 2026 13:18
415ca0c to
d57ca21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds detection for large vector embeddings in the query editor, plus a subtle highlight so they're visible.
utils/monaco/vectorEmbeddingUtils.ts):detectVectorEmbeddings(query)scans query text and returns a mark per embedding. Two formats:\xblobs, validated with the existingisBinaryVectorheuristic;Each mark carries range, format, byte size, dimensions, a first-3/last-2 preview, and the FT.SEARCH
PARAMSargument name when applicable (located viasplitQueryByArgs). Thresholds are named constants; marks/types live in their own file.useVectorEmbeddingMarkshook exposes the marks, recomputed on query change.VectorEmbeddingHighlight— a self-contained component (own styles + detection + Monaco decorations) rendered next to the editor in both Workbench and Vector Search. It paints a subtle grey background behind each embedding, with an i18n hover showing dimensions and byte size. The sharedCodeEditor/useQueryEditorare left untouched so the embedding logic can grow independently.Testing
Unit tests —
utils/tests/monaco/vectorEmbeddingUtils.spec.tscover both formats, multiple embeddings in one query, threshold edges, non-vector strings, andPARAMSname extraction:Manual — open a database → Workbench or Vector Search editor and paste the query below:
The
my_blobembedding value should render with a subtle grey background (slightly greyed out on both light and dark themes), and hovering it should show the dimensions and byte size.Closes #RI-8317
Note
Low Risk
Editor-only UI and parsing for display; no changes to query execution, auth, or data persistence.
Overview
Adds detection and in-editor highlighting for large vector embeddings in Workbench and Vector Search query editors, so long
\xblobs and numeric arrays are easier to spot in FT/KNN queries.A new
detectVectorEmbeddingsscanner finds quoted binary FLOAT32 strings (via existingisBinaryVector) and numeric arrays with at least 10 elements, and can attach FT.SEARCHPARAMSargument names when the embedding is passed as a param value.VectorEmbeddingHighlightsits beside the sharedCodeEditor, uses Monaco inline decorations (.monaco-vector-embedding), and shows an i18n hover with dimensions and byte size.The feature is kept out of the core
CodeEditor/useQueryEditorpath; editors only passmonacoObjectsandqueryfrom context. Unit tests cover detection edge cases and PARAMS name mapping.Reviewed by Cursor Bugbot for commit d57ca21. Bugbot is set up for automated code reviews on this repo. Configure here.