fix(memory): expose vectorScore and textScore in hybrid search results#68830
fix(memory): expose vectorScore and textScore in hybrid search results#68830tianhaocui wants to merge 1 commit intoopenclaw:mainfrom
Conversation
mergeHybridResults() computes per-result vectorScore and textScore but drops them when building the final output array. Consumers that need to inspect individual signal contributions (e.g. for debugging search quality or building relevance UIs) cannot access these values. Carry vectorScore and textScore through to the output and add them as optional fields on MemorySearchResult so existing consumers are unaffected. Fixes openclaw#68166
Greptile SummaryThis PR exposes Confidence Score: 5/5Safe to merge — the change is additive only, with no behavioral changes to existing consumers. All three files are straightforward type/field additions. The new fields were already being computed and stored; this just stops discarding them. Both pipeline stages (temporal decay and MMR) preserve extra fields correctly. The optional typing in the public SDK is backward-compatible. No files require special attention. Reviews (1): Last reviewed commit: "fix(memory): expose vectorScore and text..." | Re-trigger Greptile |
|
Related work from PRtags group Title: Open PR duplicate: [Feature]: expose vectorScore and textScore in hybrid search results
|
Fixes #68166
Summary
mergeHybridResults()computes per-resultvectorScore(cosine similarity) andtextScore(BM25) internally but drops them when building the final output array. This prevents consumers from inspecting individual signal contributions for debugging search quality or building relevance UIs.Changes
extensions/memory-core/src/memory/hybrid.ts— AddedvectorScoreandtextScoreto the return type and the output.map()callsrc/memory-host-sdk/host/types.ts— Added optionalvectorScoreandtextScorefields toMemorySearchResultpackages/memory-host-sdk/src/host/types.ts— Same type update (mirrored package)Net: 8 lines added across 3 files. Fields are optional so existing consumers are unaffected.
Test Plan
pnpm test extensions/memory-core/src/memory/hybrid.test.tsvectorScoreandtextScorefields