@memberjunction/ai-vector-dupe 6.2.0-edge.1 → 6.2.0-edge.2
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/README.md +7 -5
- package/dist/duplicateEntryCheckTypes.d.ts +80 -0
- package/dist/duplicateEntryCheckTypes.d.ts.map +1 -0
- package/dist/duplicateEntryCheckTypes.js +29 -0
- package/dist/duplicateEntryCheckTypes.js.map +1 -0
- package/dist/duplicateRecordDetector.d.ts +152 -12
- package/dist/duplicateRecordDetector.d.ts.map +1 -1
- package/dist/duplicateRecordDetector.js +434 -48
- package/dist/duplicateRecordDetector.js.map +1 -1
- package/dist/entryCheckDeadline.d.ts +73 -0
- package/dist/entryCheckDeadline.d.ts.map +1 -0
- package/dist/entryCheckDeadline.js +118 -0
- package/dist/entryCheckDeadline.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/reasoning/DecisionReasoningProvider.d.ts +177 -0
- package/dist/reasoning/DecisionReasoningProvider.d.ts.map +1 -0
- package/dist/reasoning/DecisionReasoningProvider.js +306 -0
- package/dist/reasoning/DecisionReasoningProvider.js.map +1 -0
- package/dist/reasoning/DecisionThenPromptReasoningProvider.d.ts +88 -0
- package/dist/reasoning/DecisionThenPromptReasoningProvider.d.ts.map +1 -0
- package/dist/reasoning/DecisionThenPromptReasoningProvider.js +159 -0
- package/dist/reasoning/DecisionThenPromptReasoningProvider.js.map +1 -0
- package/dist/reasoning/DuplicateReasoningProvider.d.ts +12 -6
- package/dist/reasoning/DuplicateReasoningProvider.d.ts.map +1 -1
- package/dist/reasoning/DuplicateReasoningProvider.js +12 -6
- package/dist/reasoning/DuplicateReasoningProvider.js.map +1 -1
- package/dist/reasoning/DuplicateReasoningTypes.d.ts +21 -2
- package/dist/reasoning/DuplicateReasoningTypes.d.ts.map +1 -1
- package/dist/reasoning/MatchedSetDeltaBuilder.d.ts +17 -3
- package/dist/reasoning/MatchedSetDeltaBuilder.d.ts.map +1 -1
- package/dist/reasoning/MatchedSetDeltaBuilder.js +49 -2
- package/dist/reasoning/MatchedSetDeltaBuilder.js.map +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 'DecisionThenPrompt' mode reasoning provider: an explicit chain.
|
|
3
|
+
*
|
|
4
|
+
* The detector resolves exactly one provider per `ReasoningMode`, so a decision cannot feed the
|
|
5
|
+
* prompt provider through configuration alone. This provider chains them:
|
|
6
|
+
*
|
|
7
|
+
* 1. {@link DecisionReasoningProvider} runs one decision over the set and drops every candidate
|
|
8
|
+
* whose probability is below its threshold.
|
|
9
|
+
* 2. `PromptReasoningProvider` reasons over **only the survivors**, so auto-merge still works
|
|
10
|
+
* wherever the prompt provider allows it.
|
|
11
|
+
*
|
|
12
|
+
* Both stages resolve through the class factory under the 'Decision' and 'Prompt' modes, so an
|
|
13
|
+
* application's override of either mode applies inside the chain as well.
|
|
14
|
+
*
|
|
15
|
+
* With no survivors the set is `NotDuplicate` and the prompt never runs. If the decision fails,
|
|
16
|
+
* every candidate goes to the prompt provider, which is the `Prompt` mode's behaviour: narrowing is
|
|
17
|
+
* an optimisation, so its failure must never hide a candidate.
|
|
18
|
+
*
|
|
19
|
+
* Each match row points at the run that produced its verdict: a survivor's at the prompt run, a
|
|
20
|
+
* dropped candidate's at the decision run. A failed decision's run is named in the error log, since
|
|
21
|
+
* a match row holds only one prompt run id.
|
|
22
|
+
*
|
|
23
|
+
* @module @memberjunction/ai-vector-dupe
|
|
24
|
+
*/
|
|
25
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
26
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
+
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;
|
|
29
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
+
};
|
|
31
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
|
+
};
|
|
34
|
+
import { LogError } from '@memberjunction/core';
|
|
35
|
+
import { MJGlobal, RegisterClass } from '@memberjunction/global';
|
|
36
|
+
import { DuplicateReasoningProvider, DECISION_REASONING_PROVIDER_KEY, DECISION_THEN_PROMPT_REASONING_PROVIDER_KEY, PROMPT_REASONING_PROVIDER_KEY } from './DuplicateReasoningProvider.js';
|
|
37
|
+
import { PromptReasoningProvider } from './PromptReasoningProvider.js';
|
|
38
|
+
import { DecisionReasoningProvider } from './DecisionReasoningProvider.js';
|
|
39
|
+
/**
|
|
40
|
+
* Chained reasoning provider: the decision filters, then the prompt reasons over the survivors.
|
|
41
|
+
* Registered under the 'DecisionThenPrompt' `ReasoningMode`.
|
|
42
|
+
*/
|
|
43
|
+
let DecisionThenPromptReasoningProvider = class DecisionThenPromptReasoningProvider extends DuplicateReasoningProvider {
|
|
44
|
+
/**
|
|
45
|
+
* The class factory passes no arguments, so both stages resolve through the class factory
|
|
46
|
+
* under the 'Decision' and 'Prompt' modes: an application's override of either mode applies
|
|
47
|
+
* inside the chain too.
|
|
48
|
+
*
|
|
49
|
+
* @param decisionStage the filter stage; defaults to {@link ResolveDecisionStage}, at the pre-filter
|
|
50
|
+
* threshold ({@link DecisionReasoningProvider.PRE_FILTER_UNCERTAIN_ABOVE}), which keeps recall
|
|
51
|
+
* @param promptStage the reasoning stage; defaults to {@link ResolvePromptStage}
|
|
52
|
+
*/
|
|
53
|
+
constructor(decisionStage, promptStage) {
|
|
54
|
+
super();
|
|
55
|
+
this.DecisionStage = decisionStage ?? this.ResolveDecisionStage();
|
|
56
|
+
this.PromptStage = promptStage ?? this.ResolvePromptStage();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Filter the set with the decision, then reason over the survivors with the prompt.
|
|
60
|
+
*/
|
|
61
|
+
async Reason(input, context) {
|
|
62
|
+
const decision = await this.DecisionStage.DecideCandidates(input, context);
|
|
63
|
+
if (!decision.Success) {
|
|
64
|
+
LogError(`DecisionThenPrompt: the decision failed (${this.describeFailure(decision)}); passing every candidate to the prompt.`);
|
|
65
|
+
return this.PromptStage.Reason(input, context);
|
|
66
|
+
}
|
|
67
|
+
const dropped = decision.Candidates.filter(c => !this.DecisionStage.IsPlausible(c.Probability));
|
|
68
|
+
if (dropped.length === decision.Candidates.length) {
|
|
69
|
+
return this.noSurvivorsOutput(decision);
|
|
70
|
+
}
|
|
71
|
+
const output = await this.PromptStage.Reason(this.NarrowToSurvivors(input, dropped), context);
|
|
72
|
+
return this.withDroppedVerdicts(output, dropped, decision.AIPromptRunID);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The input with the dropped candidates removed, from the candidate list and from the field
|
|
76
|
+
* deltas. A field whose remaining values no longer differ is dropped too, since the deltas carry
|
|
77
|
+
* differing fields only.
|
|
78
|
+
*/
|
|
79
|
+
NarrowToSurvivors(input, dropped) {
|
|
80
|
+
const droppedIDs = this.recordIDSet(dropped);
|
|
81
|
+
const keep = (recordID) => !droppedIDs.has(this.normalizeRecordID(recordID));
|
|
82
|
+
return {
|
|
83
|
+
...input,
|
|
84
|
+
Candidates: input.Candidates.filter(c => keep(c.RecordID)),
|
|
85
|
+
FieldDeltas: input.FieldDeltas
|
|
86
|
+
.map(d => ({ FieldName: d.FieldName, Values: d.Values.filter(v => keep(v.RecordID)) }))
|
|
87
|
+
.filter(d => this.stillDiffers(d))
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The filter stage: the provider registered for the 'Decision' mode, built with the pre-filter
|
|
92
|
+
* threshold ({@link DecisionReasoningProvider.PRE_FILTER_UNCERTAIN_ABOVE}) as its `uncertainAbove`
|
|
93
|
+
* argument, since here the decision only drops implausible candidates and keeps recall. The chain
|
|
94
|
+
* needs its probability API, so a registration that is not a `DecisionReasoningProvider` falls
|
|
95
|
+
* back to the shipped one, at the same threshold.
|
|
96
|
+
*/
|
|
97
|
+
ResolveDecisionStage() {
|
|
98
|
+
const threshold = DecisionReasoningProvider.PRE_FILTER_UNCERTAIN_ABOVE;
|
|
99
|
+
const registered = this.resolveRegisteredProvider(DECISION_REASONING_PROVIDER_KEY, threshold);
|
|
100
|
+
return registered instanceof DecisionReasoningProvider ? registered : new DecisionReasoningProvider(threshold);
|
|
101
|
+
}
|
|
102
|
+
/** The reasoning stage: the provider registered for the 'Prompt' mode, else the shipped one. */
|
|
103
|
+
ResolvePromptStage() {
|
|
104
|
+
return this.resolveRegisteredProvider(PROMPT_REASONING_PROVIDER_KEY) ?? new PromptReasoningProvider();
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The provider the class factory registers for a mode, built with `params` as its constructor
|
|
108
|
+
* arguments, or null when none is registered.
|
|
109
|
+
*/
|
|
110
|
+
resolveRegisteredProvider(mode, ...params) {
|
|
111
|
+
const result = MJGlobal.Instance.ClassFactory.TryCreateInstance(DuplicateReasoningProvider, mode, ...params);
|
|
112
|
+
return result.Resolved ? result.Instance : null;
|
|
113
|
+
}
|
|
114
|
+
/** No candidate survived: `NotDuplicate` for the set, from the decision alone, with no prompt call. */
|
|
115
|
+
noSurvivorsOutput(decision) {
|
|
116
|
+
const output = this.DecisionStage.RecommendFromDecision(decision);
|
|
117
|
+
output.Reasoning = `The decision model put all ${decision.Candidates.length} candidates below ` +
|
|
118
|
+
`${this.DecisionStage.UncertainAbove.toFixed(2)}, so the prompt did not run.`;
|
|
119
|
+
return output;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Give each dropped candidate its own `NotDuplicate` verdict from the decision, carrying the
|
|
123
|
+
* decision's run id, so its match row neither falls back to the set-level recommendation nor
|
|
124
|
+
* points at a prompt run that never saw it. The prompt's verdicts and set-level fields are
|
|
125
|
+
* otherwise left as the prompt returned them.
|
|
126
|
+
*/
|
|
127
|
+
withDroppedVerdicts(output, dropped, decisionRunID) {
|
|
128
|
+
if (!output.Success) {
|
|
129
|
+
return output;
|
|
130
|
+
}
|
|
131
|
+
const droppedIDs = this.recordIDSet(dropped);
|
|
132
|
+
output.CandidateVerdicts = [
|
|
133
|
+
...output.CandidateVerdicts.filter(v => !droppedIDs.has(this.normalizeRecordID(v.RecordID))),
|
|
134
|
+
...dropped.map(c => ({ ...this.DecisionStage.BandCandidate(c), AIPromptRunID: decisionRunID }))
|
|
135
|
+
];
|
|
136
|
+
return output;
|
|
137
|
+
}
|
|
138
|
+
/** The failure for the log, naming the decision's run when the runner wrote one. */
|
|
139
|
+
describeFailure(decision) {
|
|
140
|
+
const error = decision.ErrorMessage ?? 'unknown error';
|
|
141
|
+
return decision.AIPromptRunID ? `${error}; decision run ${decision.AIPromptRunID}` : error;
|
|
142
|
+
}
|
|
143
|
+
stillDiffers(delta) {
|
|
144
|
+
return new Set(delta.Values.map(v => v.Value)).size > 1;
|
|
145
|
+
}
|
|
146
|
+
recordIDSet(candidates) {
|
|
147
|
+
return new Set(candidates.map(c => this.normalizeRecordID(c.RecordID)));
|
|
148
|
+
}
|
|
149
|
+
/** Record ids compare case-insensitively (SQL Server and PostgreSQL case UUIDs differently). */
|
|
150
|
+
normalizeRecordID(recordID) {
|
|
151
|
+
return recordID.trim().toLowerCase();
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
DecisionThenPromptReasoningProvider = __decorate([
|
|
155
|
+
RegisterClass(DuplicateReasoningProvider, DECISION_THEN_PROMPT_REASONING_PROVIDER_KEY),
|
|
156
|
+
__metadata("design:paramtypes", [DecisionReasoningProvider, DuplicateReasoningProvider])
|
|
157
|
+
], DecisionThenPromptReasoningProvider);
|
|
158
|
+
export { DecisionThenPromptReasoningProvider };
|
|
159
|
+
//# sourceMappingURL=DecisionThenPromptReasoningProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecisionThenPromptReasoningProvider.js","sourceRoot":"","sources":["../../src/reasoning/DecisionThenPromptReasoningProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;;;;;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACH,0BAA0B,EAC1B,+BAA+B,EAC/B,2CAA2C,EAC3C,6BAA6B,EAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACH,yBAAyB,EAG5B,MAAM,6BAA6B,CAAC;AAQrC;;;GAGG;AAEI,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,0BAA0B;IAM/E;;;;;;;;OAQG;IACH,YAAY,aAAyC,EAAE,WAAwC;QAC3F,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAClE,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAChE,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM,CACf,KAA8B,EAC9B,OAAkC;QAElC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3E,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACpB,QAAQ,CAAC,4CAA4C,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,2CAA2C,CAAC,CAAC;YAChI,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KA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xF,iBAAiB,CAAC,QAAgB;QACtC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;CACJ,CAAA;AAxIY,mCAAmC;IAD/C,aAAa,CAAC,0BAA0B,EAAE,2CAA2C,CAAC;qCAgBvD,yBAAyB,EAAgB,0BAA0B;GAftF,mCAAmC,CAwI/C"}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `DuplicateReasoningProvider` is an abstract base resolved via `@RegisterClass`. The
|
|
5
5
|
* {@link DuplicateRecordDetector} selects an implementation per Entity Document via
|
|
6
|
-
* `ReasoningMode` ('Prompt' | 'Agent') and calls
|
|
7
|
-
* once per source record's matched set.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* agent)
|
|
6
|
+
* `ReasoningMode` ('Prompt' | 'Agent' | 'Decision' | 'DecisionThenPrompt') and calls
|
|
7
|
+
* {@link DuplicateReasoningProvider.Reason} once per source record's matched set. Every shipped
|
|
8
|
+
* implementation consumes the same {@link DuplicateReasoningInput} and emits the same
|
|
9
|
+
* {@link DuplicateReasoningOutput}. `PromptReasoningProvider` and `DuplicateReasoningAgentProvider`
|
|
10
|
+
* (in `@memberjunction/ai-agents`) run the same instruction set and differ only in runtime
|
|
11
|
+
* (single-shot prompt vs. orchestrated agent). `DecisionReasoningProvider` asks a typed decision
|
|
12
|
+
* model instead and never recommends a merge; `DecisionThenPromptReasoningProvider` filters with
|
|
13
|
+
* the decision and then runs the prompt over the survivors.
|
|
12
14
|
*
|
|
13
15
|
* @module @memberjunction/ai-vector-dupe
|
|
14
16
|
*/
|
|
@@ -17,6 +19,10 @@ import { DuplicateReasoningInput, DuplicateReasoningOutput, DuplicateReasoningCo
|
|
|
17
19
|
export declare const PROMPT_REASONING_PROVIDER_KEY = "Prompt";
|
|
18
20
|
/** Class-factory key for the agent provider (registered in @memberjunction/ai-agents). */
|
|
19
21
|
export declare const AGENT_REASONING_PROVIDER_KEY = "Agent";
|
|
22
|
+
/** Class-factory key for the typed-decision provider, which recommends and never merges. */
|
|
23
|
+
export declare const DECISION_REASONING_PROVIDER_KEY = "Decision";
|
|
24
|
+
/** Class-factory key for the chained mode: the decision filters, then the prompt reasons over the survivors. */
|
|
25
|
+
export declare const DECISION_THEN_PROMPT_REASONING_PROVIDER_KEY = "DecisionThenPrompt";
|
|
20
26
|
/**
|
|
21
27
|
* Abstract reasoning provider. Subclasses implement {@link Reason} for their runtime.
|
|
22
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DuplicateReasoningProvider.d.ts","sourceRoot":"","sources":["../../src/reasoning/DuplicateReasoningProvider.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"DuplicateReasoningProvider.d.ts","sourceRoot":"","sources":["../../src/reasoning/DuplicateReasoningProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EACH,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,kCAAkC,EACrC,MAAM,2BAA2B,CAAC;AAEnC,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,WAAW,CAAC;AACtD,0FAA0F;AAC1F,eAAO,MAAM,4BAA4B,UAAU,CAAC;AACpD,4FAA4F;AAC5F,eAAO,MAAM,+BAA+B,aAA+D,CAAC;AAC5G,gHAAgH;AAChH,eAAO,MAAM,2CAA2C,uBAAyE,CAAC;AAElI;;;;;;;;GAQG;AACH,8BAAsB,0BAA0B;IAC5C;;;;;;;;OAQG;aACa,MAAM,CAClB,KAAK,EAAE,uBAAuB,EAC9B,OAAO,EAAE,yBAAyB,GACnC,OAAO,CAAC,wBAAwB,CAAC;IAEpC;;;;OAIG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IA2BlF,2FAA2F;IAC3F,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAOpD;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,wBAAwB;IA0BhE;;;OAGG;IACH,SAAS,CAAC,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,kCAAkC,EAAE;IAsB1F;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,kCAAkC,EAAE,GAAG;QAAE,cAAc,EAAE,gCAAgC,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;IAYxJ,sEAAsE;IACtE,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAetE,iFAAiF;IACjF,SAAS,CAAC,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,gCAAgC;IAOnF;;;OAGG;IACH,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAW5D,iEAAiE;IACjE,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAO1D,qEAAqE;IACrE,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,6BAA6B,EAAE;IAkBhF,+DAA+D;IAC/D,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,wBAAwB;CAapE"}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `DuplicateReasoningProvider` is an abstract base resolved via `@RegisterClass`. The
|
|
5
5
|
* {@link DuplicateRecordDetector} selects an implementation per Entity Document via
|
|
6
|
-
* `ReasoningMode` ('Prompt' | 'Agent') and calls
|
|
7
|
-
* once per source record's matched set.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* agent)
|
|
6
|
+
* `ReasoningMode` ('Prompt' | 'Agent' | 'Decision' | 'DecisionThenPrompt') and calls
|
|
7
|
+
* {@link DuplicateReasoningProvider.Reason} once per source record's matched set. Every shipped
|
|
8
|
+
* implementation consumes the same {@link DuplicateReasoningInput} and emits the same
|
|
9
|
+
* {@link DuplicateReasoningOutput}. `PromptReasoningProvider` and `DuplicateReasoningAgentProvider`
|
|
10
|
+
* (in `@memberjunction/ai-agents`) run the same instruction set and differ only in runtime
|
|
11
|
+
* (single-shot prompt vs. orchestrated agent). `DecisionReasoningProvider` asks a typed decision
|
|
12
|
+
* model instead and never recommends a merge; `DecisionThenPromptReasoningProvider` filters with
|
|
13
|
+
* the decision and then runs the prompt over the survivors.
|
|
12
14
|
*
|
|
13
15
|
* @module @memberjunction/ai-vector-dupe
|
|
14
16
|
*/
|
|
@@ -17,6 +19,10 @@ import { LogError } from '@memberjunction/core';
|
|
|
17
19
|
export const PROMPT_REASONING_PROVIDER_KEY = 'Prompt';
|
|
18
20
|
/** Class-factory key for the agent provider (registered in @memberjunction/ai-agents). */
|
|
19
21
|
export const AGENT_REASONING_PROVIDER_KEY = 'Agent';
|
|
22
|
+
/** Class-factory key for the typed-decision provider, which recommends and never merges. */
|
|
23
|
+
export const DECISION_REASONING_PROVIDER_KEY = 'Decision';
|
|
24
|
+
/** Class-factory key for the chained mode: the decision filters, then the prompt reasons over the survivors. */
|
|
25
|
+
export const DECISION_THEN_PROMPT_REASONING_PROVIDER_KEY = 'DecisionThenPrompt';
|
|
20
26
|
/**
|
|
21
27
|
* Abstract reasoning provider. Subclasses implement {@link Reason} for their runtime.
|
|
22
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DuplicateReasoningProvider.js","sourceRoot":"","sources":["../../src/reasoning/DuplicateReasoningProvider.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"DuplicateReasoningProvider.js","sourceRoot":"","sources":["../../src/reasoning/DuplicateReasoningProvider.ts"],"names":[],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KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,MAAM,GAAG,GAAG,KAAgC,CAAC;gBAC7C,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC;gBACnC,MAAM,cAAc,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBAC7C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;oBACtE,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;gBACvE,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,+DAA+D;IACrD,YAAY,CAAC,OAAe;QAClC,QAAQ,CAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;QACnD,OAAO;YACH,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,OAAO;YACrB,cAAc,EAAE,WAAW;YAC3B,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,EAAE;YACb,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,EAAE;SACxB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -89,6 +89,13 @@ export interface DuplicateReasoningCandidateVerdict {
|
|
|
89
89
|
Confidence: number | null;
|
|
90
90
|
/** Short rationale specific to THIS candidate. */
|
|
91
91
|
Reasoning: string;
|
|
92
|
+
/**
|
|
93
|
+
* The AI Prompt Run that produced THIS verdict, when it is not the set's
|
|
94
|
+
* {@link DuplicateReasoningOutput.AIPromptRunID}. `DecisionThenPrompt` sets it on each candidate
|
|
95
|
+
* its decision dropped, so that candidate's match row points at the decision run rather than at
|
|
96
|
+
* a prompt run that never saw it. Omit it when the set's run produced the verdict.
|
|
97
|
+
*/
|
|
98
|
+
AIPromptRunID?: string | null;
|
|
92
99
|
}
|
|
93
100
|
/**
|
|
94
101
|
* One per-field survivor choice from the reasoner: keep this field's value from the
|
|
@@ -113,7 +120,8 @@ export interface DuplicateReasoningOutput {
|
|
|
113
120
|
/**
|
|
114
121
|
* The overall verdict for the set, **derived** from the per-candidate verdicts (Merge if any
|
|
115
122
|
* candidate is a Merge, else Uncertain if any is Uncertain, else NotDuplicate). Used for the
|
|
116
|
-
* group's dominant display and
|
|
123
|
+
* group's dominant display and, together with each candidate's own verdict, the auto-merge
|
|
124
|
+
* gate — NOT stamped on individual candidate rows.
|
|
117
125
|
*/
|
|
118
126
|
Recommendation: DuplicateReasoningRecommendation;
|
|
119
127
|
/**
|
|
@@ -127,7 +135,8 @@ export interface DuplicateReasoningOutput {
|
|
|
127
135
|
/**
|
|
128
136
|
* Per-candidate verdicts — the authoritative, row-level result. Each entry is judged
|
|
129
137
|
* independently against the source so a false-positive candidate reads NotDuplicate even when
|
|
130
|
-
* another candidate in the same set is a confident Merge.
|
|
138
|
+
* another candidate in the same set is a confident Merge. Auto-merge requires the candidate's
|
|
139
|
+
* own verdict to be Merge, so a candidate with no entry here is never auto-merged.
|
|
131
140
|
*/
|
|
132
141
|
CandidateVerdicts: DuplicateReasoningCandidateVerdict[];
|
|
133
142
|
/** The record id the reasoner proposes should survive (null when NotDuplicate). */
|
|
@@ -155,5 +164,15 @@ export interface DuplicateReasoningContext {
|
|
|
155
164
|
Provider?: IMetadataProvider;
|
|
156
165
|
/** The context user for the run. */
|
|
157
166
|
ContextUser?: UserInfo;
|
|
167
|
+
/**
|
|
168
|
+
* Aborts the reasoning call when the caller stops waiting for it. The `Decision` mode passes it
|
|
169
|
+
* to the decision call as `AIDecisionParams.cancellationToken`; the other modes ignore it.
|
|
170
|
+
*/
|
|
171
|
+
CancellationToken?: AbortSignal;
|
|
172
|
+
/**
|
|
173
|
+
* A bound on the model call, in milliseconds. The `Decision` mode passes it to the decision call
|
|
174
|
+
* as `AIDecisionParams.timeoutMS`; the other modes ignore it.
|
|
175
|
+
*/
|
|
176
|
+
TimeoutMS?: number;
|
|
158
177
|
}
|
|
159
178
|
//# sourceMappingURL=DuplicateReasoningTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DuplicateReasoningTypes.d.ts","sourceRoot":"","sources":["../../src/reasoning/DuplicateReasoningTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAChC,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,iGAAiG;IACjG,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IAClC,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IAC/B,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,4FAA4F;IAC5F,cAAc,EAAE,sBAAsB,CAAC;IACvC,sCAAsC;IACtC,YAAY,EAAE,qBAAqB,CAAC;IACpC,mDAAmD;IACnD,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,2EAA2E;IAC3E,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED,kCAAkC;AAClC,MAAM,MAAM,gCAAgC,GAAG,OAAO,GAAG,cAAc,GAAG,WAAW,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,WAAW,kCAAkC;IAC/C,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,cAAc,EAAE,gCAAgC,CAAC;IACjD,sFAAsF;IACtF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DuplicateReasoningTypes.d.ts","sourceRoot":"","sources":["../../src/reasoning/DuplicateReasoningTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAChC,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,iGAAiG;IACjG,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IAClC,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,+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AM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAC;IACjB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,cAAc,EAAE,gCAAgC,CAAC;IACjD;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,iBAAiB,EAAE,kCAAkC,EAAE,CAAC;IACxD,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,sFAAsF;IACtF,YAAY,EAAE,6BAA6B,EAAE,CAAC;IAC9C;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,oCAAoC;IACpC,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @module @memberjunction/ai-vector-dupe
|
|
18
18
|
*/
|
|
19
|
-
import { RunView, CompositeKey, EntityInfo, UserInfo } from '@memberjunction/core';
|
|
20
|
-
import { RecordComparisonResult, RecordFieldValue } from '@memberjunction/record-comparison';
|
|
19
|
+
import { RunView, CompositeKey, EntityInfo, UserInfo, BaseEntity } from '@memberjunction/core';
|
|
20
|
+
import { RecordComparisonEngine, RecordComparisonResult, RecordFieldValue } from '@memberjunction/record-comparison';
|
|
21
21
|
import { ReasoningFieldDelta } from './DuplicateReasoningTypes.js';
|
|
22
22
|
/**
|
|
23
23
|
* The result of building a matched set's deltas: the differing-field deltas the reasoner
|
|
@@ -47,9 +47,23 @@ export declare class MatchedSetDeltaBuilder {
|
|
|
47
47
|
* @param entityInfo the entity being deduped (already resolved by the detector)
|
|
48
48
|
* @param keys the source key first, then each candidate key (order preserved)
|
|
49
49
|
* @param contextUser the run's context user
|
|
50
|
+
* @param unsavedSource a record that is not in the database yet, whose primary key is among
|
|
51
|
+
* `keys` (the entry-time check's source). Its in-memory values stand in for the row the load
|
|
52
|
+
* cannot find, so the reasoner compares the candidates against what is being entered.
|
|
50
53
|
* @returns the differing-field deltas plus a record-id → label map; empty on load failure
|
|
51
54
|
*/
|
|
52
|
-
Build(entityInfo: EntityInfo, keys: CompositeKey[], contextUser?: UserInfo): Promise<MatchedSetDelta>;
|
|
55
|
+
Build(entityInfo: EntityInfo, keys: CompositeKey[], contextUser?: UserInfo, unsavedSource?: BaseEntity): Promise<MatchedSetDelta>;
|
|
56
|
+
/**
|
|
57
|
+
* The comparison engine for one build: the shared engine, or, when the source is unsaved, one
|
|
58
|
+
* that supplies the source's row from memory.
|
|
59
|
+
*/
|
|
60
|
+
protected CreateComparisonEngine(unsavedSource?: BaseEntity): RecordComparisonEngine;
|
|
61
|
+
/**
|
|
62
|
+
* An unsaved record's values as a comparison row: scalars as they are, other values (dates)
|
|
63
|
+
* stringified as `toStringValue` stringifies a loaded value, and empty as null.
|
|
64
|
+
*/
|
|
65
|
+
protected ToComparisonRow(record: BaseEntity): Record<string, RecordFieldValue>;
|
|
66
|
+
private toComparisonValue;
|
|
53
67
|
/**
|
|
54
68
|
* Map each loaded record's key string to its display label (the engine resolves the
|
|
55
69
|
* name-field value, falling back to the key). Lets the reasoner address records by name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatchedSetDeltaBuilder.d.ts","sourceRoot":"","sources":["../../src/reasoning/MatchedSetDeltaBuilder.ts"],"names":[],"mappings":"AAAA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C,MAAM,EAAE,MAAM,CAAC;IAQ1E;;;OAGG;IACH,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,mBAAmB,EAAE;IAqBxE,sEAAsE;IACtE,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI;CAMlE"}
|
|
@@ -35,13 +35,16 @@ export class MatchedSetDeltaBuilder {
|
|
|
35
35
|
* @param entityInfo the entity being deduped (already resolved by the detector)
|
|
36
36
|
* @param keys the source key first, then each candidate key (order preserved)
|
|
37
37
|
* @param contextUser the run's context user
|
|
38
|
+
* @param unsavedSource a record that is not in the database yet, whose primary key is among
|
|
39
|
+
* `keys` (the entry-time check's source). Its in-memory values stand in for the row the load
|
|
40
|
+
* cannot find, so the reasoner compares the candidates against what is being entered.
|
|
38
41
|
* @returns the differing-field deltas plus a record-id → label map; empty on load failure
|
|
39
42
|
*/
|
|
40
|
-
async Build(entityInfo, keys, contextUser) {
|
|
43
|
+
async Build(entityInfo, keys, contextUser, unsavedSource) {
|
|
41
44
|
if (keys.length === 0) {
|
|
42
45
|
return { FieldDeltas: [], Labels: new Map() };
|
|
43
46
|
}
|
|
44
|
-
const engine =
|
|
47
|
+
const engine = this.CreateComparisonEngine(unsavedSource);
|
|
45
48
|
const result = await engine.CompareRecordsForEntity(entityInfo, keys, contextUser, {
|
|
46
49
|
RunViewInstance: this.runView,
|
|
47
50
|
});
|
|
@@ -50,6 +53,35 @@ export class MatchedSetDeltaBuilder {
|
|
|
50
53
|
}
|
|
51
54
|
return { FieldDeltas: this.project(result), Labels: this.buildLabels(result) };
|
|
52
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* The comparison engine for one build: the shared engine, or, when the source is unsaved, one
|
|
58
|
+
* that supplies the source's row from memory.
|
|
59
|
+
*/
|
|
60
|
+
CreateComparisonEngine(unsavedSource) {
|
|
61
|
+
return unsavedSource
|
|
62
|
+
? new UnsavedSourceComparisonEngine(this.ToComparisonRow(unsavedSource))
|
|
63
|
+
: new RecordComparisonEngine();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* An unsaved record's values as a comparison row: scalars as they are, other values (dates)
|
|
67
|
+
* stringified as `toStringValue` stringifies a loaded value, and empty as null.
|
|
68
|
+
*/
|
|
69
|
+
ToComparisonRow(record) {
|
|
70
|
+
const row = {};
|
|
71
|
+
for (const [fieldName, value] of Object.entries(record.GetAll())) {
|
|
72
|
+
row[fieldName] = this.toComparisonValue(value);
|
|
73
|
+
}
|
|
74
|
+
return row;
|
|
75
|
+
}
|
|
76
|
+
toComparisonValue(value) {
|
|
77
|
+
if (value === null || value === undefined) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
return String(value);
|
|
84
|
+
}
|
|
53
85
|
/**
|
|
54
86
|
* Map each loaded record's key string to its display label (the engine resolves the
|
|
55
87
|
* name-field value, falling back to the key). Lets the reasoner address records by name.
|
|
@@ -92,4 +124,19 @@ export class MatchedSetDeltaBuilder {
|
|
|
92
124
|
return String(value);
|
|
93
125
|
}
|
|
94
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* A comparison engine for a set whose source record is not saved yet. It loads the saved records
|
|
129
|
+
* as the shared engine does, then adds the unsaved record's row, which the engine matches to the
|
|
130
|
+
* source key by its primary-key values like any loaded row.
|
|
131
|
+
*/
|
|
132
|
+
class UnsavedSourceComparisonEngine extends RecordComparisonEngine {
|
|
133
|
+
constructor(unsavedRow) {
|
|
134
|
+
super();
|
|
135
|
+
this.unsavedRow = unsavedRow;
|
|
136
|
+
}
|
|
137
|
+
async loadRecords(entity, keys, fields, contextUser, options) {
|
|
138
|
+
const loaded = await super.loadRecords(entity, keys, fields, contextUser, options);
|
|
139
|
+
return loaded === null ? null : [this.unsavedRow, ...loaded];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
95
142
|
//# sourceMappingURL=MatchedSetDeltaBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatchedSetDeltaBuilder.js","sourceRoot":"","sources":["../../src/reasoning/MatchedSetDeltaBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACH,sBAAsB,
|
|
1
|
+
{"version":3,"file":"MatchedSetDeltaBuilder.js","sourceRoot":"","sources":["../../src/reasoning/MatchedSetDeltaBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACH,sBAAsB,GAIzB,MAAM,mCAAmC,CAAC;AAe3C;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAG/B;;;OAGG;IACH,YAAY,OAAgB;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,KAAK,CACd,UAAsB,EACtB,IAAoB,EACpB,WAAsB,EACtB,aAA0B;QAE1B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpB,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;QAClD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;YAC/E,eAAe,EAAE,IAAI,CAAC,OAAO;SAChC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;QAClD,CAAC;QACD,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,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E,WAAW,EAAE,OAAO,CAAC,CAAC;QACnF,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,CAAC;IACjE,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-vector-dupe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.2",
|
|
5
5
|
"description": "MemberJunction: AI Vector/Entity Sync Package - Handles synchronization between Vector DB and MJ CDP Data",
|
|
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-vectordb": "6.2.0-edge.
|
|
16
|
-
"@memberjunction/ai-core-plus": "6.2.0-edge.
|
|
17
|
-
"@memberjunction/ai-prompts": "6.2.0-edge.
|
|
18
|
-
"@memberjunction/ai-vectors": "6.2.0-edge.
|
|
19
|
-
"@memberjunction/templates": "6.2.0-edge.
|
|
20
|
-
"@memberjunction/ai-vector-sync": "6.2.0-edge.
|
|
21
|
-
"@memberjunction/aiengine": "6.2.0-edge.
|
|
22
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
23
|
-
"@memberjunction/core-entities": "6.2.0-edge.
|
|
24
|
-
"@memberjunction/entity-documents": "6.2.0-edge.
|
|
25
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
26
|
-
"@memberjunction/record-comparison": "6.2.0-edge.
|
|
14
|
+
"@memberjunction/ai": "6.2.0-edge.2",
|
|
15
|
+
"@memberjunction/ai-vectordb": "6.2.0-edge.2",
|
|
16
|
+
"@memberjunction/ai-core-plus": "6.2.0-edge.2",
|
|
17
|
+
"@memberjunction/ai-prompts": "6.2.0-edge.2",
|
|
18
|
+
"@memberjunction/ai-vectors": "6.2.0-edge.2",
|
|
19
|
+
"@memberjunction/templates": "6.2.0-edge.2",
|
|
20
|
+
"@memberjunction/ai-vector-sync": "6.2.0-edge.2",
|
|
21
|
+
"@memberjunction/aiengine": "6.2.0-edge.2",
|
|
22
|
+
"@memberjunction/core": "6.2.0-edge.2",
|
|
23
|
+
"@memberjunction/core-entities": "6.2.0-edge.2",
|
|
24
|
+
"@memberjunction/entity-documents": "6.2.0-edge.2",
|
|
25
|
+
"@memberjunction/global": "6.2.0-edge.2",
|
|
26
|
+
"@memberjunction/record-comparison": "6.2.0-edge.2",
|
|
27
27
|
"dotenv": "^17.2.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|