@memberjunction/search-engine 6.2.0-edge.5 → 6.2.0-edge.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generic/EntitySearchProvider.d.ts +97 -0
- package/dist/generic/EntitySearchProvider.d.ts.map +1 -1
- package/dist/generic/EntitySearchProvider.js +124 -11
- package/dist/generic/EntitySearchProvider.js.map +1 -1
- package/dist/generic/ResultFieldProjection.d.ts +35 -0
- package/dist/generic/ResultFieldProjection.d.ts.map +1 -0
- package/dist/generic/ResultFieldProjection.js +97 -0
- package/dist/generic/ResultFieldProjection.js.map +1 -0
- package/dist/generic/SearchEngine.d.ts +25 -0
- package/dist/generic/SearchEngine.d.ts.map +1 -1
- package/dist/generic/SearchEngine.js +56 -5
- package/dist/generic/SearchEngine.js.map +1 -1
- package/dist/generic/VectorSearchProvider.d.ts.map +1 -1
- package/dist/generic/VectorSearchProvider.js +2 -0
- package/dist/generic/VectorSearchProvider.js.map +1 -1
- package/dist/generic/search.types.d.ts +10 -0
- package/dist/generic/search.types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/permissions/SearchScopePermissionResolver.d.ts +8 -0
- package/dist/permissions/SearchScopePermissionResolver.d.ts.map +1 -1
- package/dist/permissions/SearchScopePermissionResolver.js +5 -2
- package/dist/permissions/SearchScopePermissionResolver.js.map +1 -1
- package/dist/rerankers/BGEReRanker.d.ts +2 -2
- package/dist/rerankers/BGEReRanker.js +5 -5
- package/dist/rerankers/BGEReRanker.js.map +1 -1
- package/dist/rerankers/CohereReRanker.d.ts +23 -24
- package/dist/rerankers/CohereReRanker.d.ts.map +1 -1
- package/dist/rerankers/CohereReRanker.js +121 -75
- package/dist/rerankers/CohereReRanker.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Cohere Rerank
|
|
2
|
+
* @fileoverview Cohere Rerank integration for SearchEngine scopes (P2D.2 + Rerank 5 Context Focus).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* for accurate semantic similarity.
|
|
4
|
+
* The Cohere call itself is the AI layer's `CohereReranker` (registered by `@memberjunction/ai-cohere`,
|
|
5
|
+
* which both server bootstraps load), resolved through the ClassFactory so SearchEngine takes no
|
|
6
|
+
* Cohere dependency. This file adds only what scope search needs on top: the relevance threshold,
|
|
7
|
+
* Context Focus snippets on the result items, and per-search cost reporting.
|
|
9
8
|
*
|
|
10
9
|
* **Cost model.** Cohere bills per "search," where one search reranks up to 100
|
|
11
|
-
* documents. Above 100 docs, larger requests count as multiple searches.
|
|
12
|
-
*
|
|
10
|
+
* documents. Above 100 docs, larger requests count as multiple searches. The estimate
|
|
11
|
+
* uses 0.2¢ per search ($2.00 per 1k, Cohere's rerank-v3.5 price as of 2026-04) for every
|
|
12
|
+
* model; it is not adjusted per model.
|
|
13
13
|
*
|
|
14
|
-
* **API key resolution.**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* **Optional peer dependency.** `cohere-ai` is declared in `optionalDependencies`
|
|
19
|
-
* so SearchEngine consumers who don't use Cohere don't pay the bundle cost.
|
|
20
|
-
* Loaded via a dynamic import per CLAUDE.md rule #8 case 2 (optional peer).
|
|
14
|
+
* **API key resolution.** Checks `GetAIAPIKey('CohereReranker')` first (matching
|
|
15
|
+
* `metadata/ai-models/.cohere-reranker-models.json` → `AI_VENDOR_API_KEY__COHERERERANKER`)
|
|
16
|
+
* and falls back to `GetAIAPIKey('CohereLLM')` (`AI_VENDOR_API_KEY__COHERELLM`).
|
|
21
17
|
*
|
|
22
18
|
* @module @memberjunction/search-engine
|
|
23
19
|
*/
|
|
@@ -27,66 +23,103 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
27
23
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
28
24
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
29
25
|
};
|
|
30
|
-
import { RegisterClass } from '@memberjunction/global';
|
|
26
|
+
import { MJGlobal, RegisterClass } from '@memberjunction/global';
|
|
31
27
|
import { LogError } from '@memberjunction/core';
|
|
32
|
-
import { BaseReranker as AIBaseReranker, GetAIAPIKey
|
|
28
|
+
import { BaseReranker as AIBaseReranker, GetAIAPIKey } from '@memberjunction/ai';
|
|
33
29
|
import { BaseReRanker } from '../generic/BaseReRanker.js';
|
|
34
30
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Rerank call.
|
|
39
|
-
*/
|
|
40
|
-
let cohereClientCtorPromise = null;
|
|
41
|
-
async function getCohereClientCtor() {
|
|
42
|
-
if (!cohereClientCtorPromise) {
|
|
43
|
-
cohereClientCtorPromise = (async () => {
|
|
44
|
-
try {
|
|
45
|
-
const mod = await import('cohere-ai');
|
|
46
|
-
return mod.CohereClient;
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
throw new Error(`CohereReRanker: 'cohere-ai' is not installed. Add it to your project's dependencies if you intend to use the Cohere reranker. Underlying error: ${err instanceof Error ? err.message : String(err)}`);
|
|
50
|
-
}
|
|
51
|
-
})();
|
|
52
|
-
}
|
|
53
|
-
return cohereClientCtorPromise;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Inline AI-layer reranker that calls Cohere's `rerank` endpoint with the raw query
|
|
57
|
-
* (no enhanced prompt). Distinct from `@memberjunction/ai-cohere`'s `CohereReranker`
|
|
58
|
-
* which augments the query for memory-note semantics.
|
|
31
|
+
* Wraps the AI layer's `CohereReranker` for scope search: maps the scope config onto its options,
|
|
32
|
+
* applies the threshold, narrows snippets to Context Focus spans, and records whether the call succeeded
|
|
33
|
+
* so cost is only reported for real calls.
|
|
59
34
|
*/
|
|
60
35
|
class CohereScopeAIReranker extends AIBaseReranker {
|
|
61
|
-
constructor(apiKey, modelName) {
|
|
36
|
+
constructor(cohere, apiKey, modelName) {
|
|
62
37
|
super(apiKey, modelName);
|
|
63
|
-
this.
|
|
38
|
+
this.cohere = cohere;
|
|
39
|
+
this.LastCallSucceeded = false;
|
|
64
40
|
}
|
|
65
41
|
async doRerank(params) {
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
topN: params.topK ?? params.documents.length,
|
|
72
|
-
returnDocuments: false,
|
|
42
|
+
this.LastCallSucceeded = false;
|
|
43
|
+
const config = params.options ?? {};
|
|
44
|
+
const response = await this.cohere.Rerank({
|
|
45
|
+
...params,
|
|
46
|
+
options: { RelevantSpans: relevantSpansOption(config['relevantSpans']) },
|
|
73
47
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
48
|
+
if (!response.success) {
|
|
49
|
+
throw new Error(response.errorMessage ?? 'Cohere rerank failed');
|
|
50
|
+
}
|
|
51
|
+
this.LastCallSucceeded = true;
|
|
52
|
+
const focusSnippet = config['focusSnippet'] !== false;
|
|
53
|
+
const results = response.results.map(r => withRelevantSpans(r, focusSnippet));
|
|
54
|
+
const threshold = config['minRelevanceThreshold'];
|
|
55
|
+
if (typeof threshold !== 'number') {
|
|
56
|
+
return results;
|
|
57
|
+
}
|
|
58
|
+
// Like the agents' reranker threshold, this never empties the list: when no result reaches
|
|
59
|
+
// it, the reranked list is returned unfiltered.
|
|
60
|
+
const kept = results.filter(r => r.relevanceScore >= threshold);
|
|
61
|
+
return kept.length > 0 ? kept : results;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Scope config `relevantSpans` (`true` or `{ threshold, maxSpans }`) as the provider's `RelevantSpans` option. */
|
|
65
|
+
function relevantSpansOption(raw) {
|
|
66
|
+
if (raw === true) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (raw && typeof raw === 'object') {
|
|
70
|
+
const { threshold, maxSpans } = raw;
|
|
71
|
+
return { Threshold: threshold, MaxSpans: maxSpans };
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
/** Copy a result's Context Focus spans onto its search item, narrowing the snippet to them when asked. */
|
|
76
|
+
function withRelevantSpans(result, focusSnippet) {
|
|
77
|
+
const spans = result.document.metadata?.['RelevantSpans'];
|
|
78
|
+
const original = result.document.metadata?.['__mjSearchItem'];
|
|
79
|
+
if (!spans?.length || !original) {
|
|
80
|
+
return result;
|
|
80
81
|
}
|
|
82
|
+
const item = {
|
|
83
|
+
...original,
|
|
84
|
+
RelevantSpans: spans,
|
|
85
|
+
Snippet: (focusSnippet && focusedSnippet(result.document.text, original.Snippet, spans)) || original.Snippet,
|
|
86
|
+
};
|
|
87
|
+
return { ...result, document: { ...result.document, metadata: { ...result.document.metadata, __mjSearchItem: item } } };
|
|
81
88
|
}
|
|
82
89
|
/**
|
|
83
|
-
*
|
|
90
|
+
* The spans' text from the snippet onward, in document order. Spans index the text that was sent for
|
|
91
|
+
* reranking (`buildRerankText`, overridable) in Unicode code points, so the snippet's position is found
|
|
92
|
+
* in that text rather than assumed. '' when the snippet isn't in it, which keeps the original snippet.
|
|
93
|
+
*/
|
|
94
|
+
function focusedSnippet(rerankText, snippet, spans) {
|
|
95
|
+
const at = snippet ? rerankText.indexOf(snippet) : -1;
|
|
96
|
+
if (at < 0) {
|
|
97
|
+
return '';
|
|
98
|
+
}
|
|
99
|
+
const snippetStart = Array.from(rerankText.slice(0, at)).length;
|
|
100
|
+
return [...spans]
|
|
101
|
+
.sort((a, b) => a.Start - b.Start)
|
|
102
|
+
.map(s => Array.from(s.Text).slice(Math.max(0, snippetStart - s.Start)).join('').trim())
|
|
103
|
+
.filter(Boolean)
|
|
104
|
+
.join(' … ');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Cohere re-ranker for SearchEngine (defaults to `rerank-v5.0-fast`). Configured per scope via
|
|
84
108
|
* `SearchScope.ScopeConfig.reRanker.driverClass = 'CohereReRanker'`.
|
|
85
109
|
*
|
|
86
|
-
*
|
|
87
|
-
* (
|
|
110
|
+
* Configuration keys in `ScopeConfig.reRanker.config`:
|
|
111
|
+
* - `model`: Cohere model ID (`'rerank-v5.0-fast'`, `'rerank-v5.0-pro'`, `'rerank-v4.0-pro'`, `'rerank-v3.5'`, etc.)
|
|
112
|
+
* - `relevantSpans`: `true` or `{ threshold?: number, maxSpans?: number }` to extract passage-level
|
|
113
|
+
* spans with Cohere Rerank 5 Context Focus.
|
|
114
|
+
* - `focusSnippet`: When Context Focus returns spans, whether to narrow `Snippet` to them (default: `true`).
|
|
115
|
+
* - `minRelevanceThreshold`: Calibrated relevance cutoff (0.0-1.0). Results below it are dropped,
|
|
116
|
+
* unless none reaches it, in which case all are kept.
|
|
88
117
|
*/
|
|
89
118
|
let CohereReRanker = class CohereReRanker extends BaseReRanker {
|
|
119
|
+
constructor() {
|
|
120
|
+
super(...arguments);
|
|
121
|
+
this.currentAIReranker = null;
|
|
122
|
+
}
|
|
90
123
|
get DriverClass() {
|
|
91
124
|
return 'CohereReRanker';
|
|
92
125
|
}
|
|
@@ -105,38 +138,51 @@ let CohereReRanker = class CohereReRanker extends BaseReRanker {
|
|
|
105
138
|
}
|
|
106
139
|
/**
|
|
107
140
|
* Cohere bills per "search". 1 search reranks up to 100 documents; above 100,
|
|
108
|
-
* count as `ceil(N/100)` searches
|
|
109
|
-
* per search. Override via `config.cents_per_search` if Cohere's pricing changes.
|
|
141
|
+
* count as `ceil(N/100)` searches, each estimated at 0.2¢ (see the file header).
|
|
110
142
|
*/
|
|
111
143
|
EstimateCostCents(resultCount) {
|
|
112
144
|
const searches = Math.max(1, Math.ceil(resultCount / 100));
|
|
113
145
|
return searches * 0.2;
|
|
114
146
|
}
|
|
115
147
|
getAIReranker(config, _contextUser) {
|
|
116
|
-
|
|
148
|
+
if (this.currentAIReranker)
|
|
149
|
+
return this.currentAIReranker;
|
|
150
|
+
const apiKey = GetAIAPIKey('CohereReranker') || GetAIAPIKey('CohereLLM');
|
|
117
151
|
if (!apiKey) {
|
|
118
|
-
LogError('CohereReRanker: no API key found for driver "CohereLLM" — set AI_VENDOR_API_KEY__COHERELLM or register an AIAPIKeys subclass.');
|
|
152
|
+
LogError('CohereReRanker: no API key found for driver "CohereReranker" or "CohereLLM" — set AI_VENDOR_API_KEY__COHERERERANKER (or AI_VENDOR_API_KEY__COHERELLM) or register an AIAPIKeys subclass.');
|
|
119
153
|
return null;
|
|
120
154
|
}
|
|
121
|
-
const modelName = config?.['model'] ?? 'rerank-
|
|
122
|
-
|
|
155
|
+
const modelName = config?.['model'] ?? 'rerank-v5.0-fast';
|
|
156
|
+
const cohere = MJGlobal.Instance.ClassFactory.TryCreateInstance(AIBaseReranker, 'CohereReranker', apiKey, modelName);
|
|
157
|
+
if (!cohere.Resolved || !cohere.Instance) {
|
|
158
|
+
LogError(`CohereReRanker: the "CohereReranker" AI reranker is not registered (is @memberjunction/ai-cohere loaded?): ${cohere.Reason}`);
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
this.currentAIReranker = new CohereScopeAIReranker(cohere.Instance, apiKey, modelName);
|
|
162
|
+
return this.currentAIReranker;
|
|
123
163
|
}
|
|
124
164
|
/**
|
|
125
|
-
* Override `ReRank` to record actual cost via
|
|
126
|
-
*
|
|
127
|
-
* the post-call cost equals the pre-call estimate — no separate measurement
|
|
128
|
-
* required.
|
|
165
|
+
* Override `ReRank` to record actual cost via `reportCost` only after a successful
|
|
166
|
+
* Cohere call (matching `VoyageReRanker`'s `super.ReRank` pattern).
|
|
129
167
|
*/
|
|
130
168
|
async ReRank(query, candidates, topN, contextUser, config) {
|
|
131
169
|
if (topN <= 0 || candidates.length === 0)
|
|
132
170
|
return [];
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
171
|
+
this.currentAIReranker = null;
|
|
172
|
+
const apiReranker = this.getAIReranker(config, contextUser);
|
|
173
|
+
try {
|
|
174
|
+
if (!apiReranker) {
|
|
175
|
+
return candidates.slice(0, topN);
|
|
176
|
+
}
|
|
177
|
+
const result = await super.ReRank(query, candidates, topN, contextUser, config);
|
|
178
|
+
if (apiReranker.LastCallSucceeded) {
|
|
179
|
+
this.reportCost(this.EstimateCostCents(candidates.length));
|
|
180
|
+
}
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
this.currentAIReranker = null;
|
|
138
185
|
}
|
|
139
|
-
return result;
|
|
140
186
|
}
|
|
141
187
|
};
|
|
142
188
|
CohereReRanker = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CohereReRanker.js","sourceRoot":"","sources":["../../src/rerankers/CohereReRanker.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CohereReRanker.js","sourceRoot":"","sources":["../../src/rerankers/CohereReRanker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,IAAI,cAAc,EAA8B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKvD;;;;GAIG;AACH,MAAM,qBAAsB,SAAQ,cAAc;IAG9C,YAA6B,MAAsB,EAAE,MAAc,EAAE,SAAiB;QAClF,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QADA,WAAM,GAAN,MAAM,CAAgB;QAF5C,sBAAiB,GAAG,KAAK,CAAC;IAIjC,CAAC;IAES,KAAK,CAAC,QAAQ,C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AC,CAAC,EAAE,IAAI,CAAC,CAAC;YACrC,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;YAChF,IAAI,WAAW,CAAC,iBAAiB,EAAE,CAAC;gBAChC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAClC,CAAC;IACL,CAAC;CACJ,CAAA;AA9EY,cAAc;IAD1B,aAAa,CAAC,YAAY,EAAE,gBAAgB,CAAC;GACjC,cAAc,CA8E1B;;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAC9B,6DAA6D;IAC7D,MAAM,IAAI,GAAG,cAAc,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/search-engine",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.7",
|
|
5
5
|
"description": "MemberJunction: Reusable server-side search engine - vector + full-text + entity search with RRF fusion",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"author": "MemberJunction.com",
|
|
12
12
|
"license": "BUSL-1.1",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@memberjunction/ai": "6.2.0-edge.
|
|
15
|
-
"@memberjunction/ai-prompts": "6.2.0-edge.
|
|
16
|
-
"@memberjunction/ai-vectordb": "6.2.0-edge.
|
|
17
|
-
"@memberjunction/aiengine": "6.2.0-edge.
|
|
18
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
19
|
-
"@memberjunction/core-entities": "6.2.0-edge.
|
|
20
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
21
|
-
"@memberjunction/storage": "6.2.0-edge.
|
|
22
|
-
"@memberjunction/tag-engine-base": "6.2.0-edge.
|
|
14
|
+
"@memberjunction/ai": "6.2.0-edge.7",
|
|
15
|
+
"@memberjunction/ai-prompts": "6.2.0-edge.7",
|
|
16
|
+
"@memberjunction/ai-vectordb": "6.2.0-edge.7",
|
|
17
|
+
"@memberjunction/aiengine": "6.2.0-edge.7",
|
|
18
|
+
"@memberjunction/core": "6.2.0-edge.7",
|
|
19
|
+
"@memberjunction/core-entities": "6.2.0-edge.7",
|
|
20
|
+
"@memberjunction/global": "6.2.0-edge.7",
|
|
21
|
+
"@memberjunction/storage": "6.2.0-edge.7",
|
|
22
|
+
"@memberjunction/tag-engine-base": "6.2.0-edge.7",
|
|
23
23
|
"nunjucks": "^3.2.4"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"
|
|
26
|
+
"@huggingface/transformers": "^4.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "24.10.11",
|