Fase B6: temporal relevance decay and vector-based "similar pages"

- combine-results now applies a bounded (never below 0.5x) exponential
  decay based on :block/updated-at, so more recently touched blocks/pages
  rank slightly higher for otherwise-equal matches.
- New search/similar-blocks reuses the existing zvec index: fetch a
  block's own already-indexed embedding (new :fetch capability on
  open-vector-index, via zvec's fetchSync) and re-query the index with
  it instead of embedding a fresh query string.
- Exposed as a :similar-pages render-resource (worker/handler/render-resource/similar.cljs),
  consistent with how linked/unlinked references are already wired, plus
  a raw :thread-api/search-similar-blocks for non-UI callers.
- New "Similar pages" section on the page view, above the existing
  linked/unlinked references.
This commit is contained in:
2026-08-26 20:21:28 +02:00
parent d59aec181e
commit dadeca7165
9 changed files with 211 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
[frontend.worker.handler.render-resource.common :as common]
[frontend.worker.handler.render-resource.property :as property]
[frontend.worker.handler.render-resource.query :as query]
[frontend.worker.handler.render-resource.similar :as similar]
[frontend.worker.handler.render-resource.view :as view]
[frontend.worker.state :as worker-state]))
@@ -14,6 +15,7 @@
property/resource-renderers
view/resource-renderers
query/resource-renderers
similar/resource-renderers
{:block-sync-conflicts
(common/renderer nil
(fn [_db resource-key _runtime]