Skip to content

Category search compares only matching embedding spaces - #1036

Merged
zlareb1 merged 2 commits into
mainfrom
fix/issue-1033
Nov 20, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
fix/issue-1033

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Closes: #1033

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry

Category search compares only embeddings from the query's model with the same vector length. Categories embedded by another model stay out of the ranking.

Why

Category registration records its embedding model and dimension, but search filtered only for a positive dimension. This mixed unrelated embedding spaces and allowed different vector lengths to reach cosine distance. Search binds the model from the query embedder and the length of the vector it returned.

Scope and risk

The change adds two predicates to the category search read. Regression tests cover both bindings and live searches with incompatible models or dimension metadata. The analyzer corpus and category-search documentation match the read. Tenant and tombstone filters remain in the query.

Compatibility, rollout and rollback

  • Wire: no operations, fields or defaults change.
  • Operator steps: none. Re-register categories to search them after an embedding model change.
  • Rollback: reverting restores the broader read; no stored data or migrations change.

Tests

  • Merge status: the following hosted checks have not passed: Cell trigger end-to-end acceptance. The unchecked validation item below records these limits.

  • Category unit regressions failed on both missing predicates before the fix and pass after it.

  • make format, make format-check, make lint and make typecheck pass after rebasing.

  • Current-head category, documentation, linear-cost fixture and benchmark-harness unit tests: 540 passed.

  • Current-head offline analyzer corpus render and shape checks: 4 passed.

  • Historical database evidence before this rebase: analyzer corpus against the pinned release, 12 passed.

  • Historical database evidence before this rebase: live category integration checks, 2 passed.

  • On the previous head, Linux unit shards, coverage/floors, integrations, mixed-version checks, and quickstarts passed. Two initial unit-job failures passed on one unchanged-head diagnostic retry; no cause was established for those initial failures.

  • Cell acceptance failed at the fixed workload deadline during measurement. The retained evidence records 20,159 of 20,500 API requests completed. The gate has not passed at merge; the shared entity-normalization work is tracked in Avoid redundant work when resolving entity names #1060.

Current local results apply to 5380d898b9fd220508ec006100db53e8b9beb959, rebased on 5fa9f58f7ddec4b6d51c8923848e703abc71bb71. Not all hosted checks passed on this composition. Full Linux unit shards, coverage, integrations, isolation, mixed-version checks, quickstarts and Cell acceptance are incomplete at merge. The separate performance change is not a prerequisite for this rebase.

AI assistance in the code

  • AI-generated (Codex). Verified the query parameters, generated shape diff and targeted test results; each pushed commit receives a fresh independent review.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated from their sources; the analyzer corpus replaces one statement shape.
  • No migration, plugin or frontend changes require additional updates.
  • Docs describe category search and model changes.
  • Repository text passes test_public_copy.py.
  • Commits are signed off.

@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 20, 2026 6:15pm UTC

Request Review

@zlareb1
zlareb1 force-pushed the fix/issue-1033 branch 2 times, most recently from b4ebaeb to dd0f815 Compare November 20, 2026 16:54
Bind the query embedder model and vector length in category search so incompatible category vectors stay out of the cosine ranking.

Signed-off-by: Lareb Zafar <[email protected]>
The quantized category column fixes the physical vector width. Vary dimension metadata to exercise the search filter without failing fixture insertion.

Signed-off-by: Lareb Zafar <[email protected]>
@zlareb1
zlareb1 merged commit a934082 into main Nov 20, 2026
55 of 56 checks passed
@zlareb1
zlareb1 deleted the fix/issue-1033 branch November 20, 2026 21:00
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.

namespace.search_categories ignores embedding_model

1 participant