@amemhq/core 1.0.1 → 1.1.0
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/chunk-B2NS7WAM.js +2182 -0
- package/dist/chunk-B2NS7WAM.js.map +1 -0
- package/dist/cli-migrate.cjs +932 -0
- package/dist/cli-migrate.cjs.map +1 -0
- package/dist/cli-migrate.d.cts +16 -0
- package/dist/cli-migrate.d.ts +16 -0
- package/dist/cli-migrate.js +86 -0
- package/dist/cli-migrate.js.map +1 -0
- package/dist/index.cjs +68 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +72 -2120
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.d.cts
CHANGED
|
@@ -29,6 +29,30 @@ type PoolingMode = 'mean' | 'cls';
|
|
|
29
29
|
* assumed.
|
|
30
30
|
*/
|
|
31
31
|
declare function getEmbeddingPooling(): PoolingMode;
|
|
32
|
+
/**
|
|
33
|
+
* Where inference runs. Unset means Transformers.js picks, which on Node is `cpu`.
|
|
34
|
+
*
|
|
35
|
+
* It is not CPU-only for lack of anything else: `onnxruntime-node`'s macOS arm64
|
|
36
|
+
* binary links CoreML.framework and exports the CoreML provider, and
|
|
37
|
+
* Transformers.js lists `coreml` (macOS), `dml` (Windows), `cuda` (Linux x64) and
|
|
38
|
+
* `webgpu` alongside `cpu`. It simply defaults to `cpu` and amem never asked for
|
|
39
|
+
* anything else.
|
|
40
|
+
*
|
|
41
|
+
* Whether asking helps is **unmeasured**. CoreML partitions a graph operator by
|
|
42
|
+
* operator and falls back to CPU for the ones it cannot take, so it can lose to
|
|
43
|
+
* plain CPU on some models and pay a compile cost on first load. Hence: opt-in,
|
|
44
|
+
* default unchanged, and no recommendation until someone benchmarks it.
|
|
45
|
+
*/
|
|
46
|
+
declare function getEmbeddingDevice(): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Weight precision. Unset means Transformers.js picks, which on Node is `fp32` —
|
|
49
|
+
* the largest download of every variant a model publishes.
|
|
50
|
+
*
|
|
51
|
+
* Passed through rather than validated against a list: Transformers.js already
|
|
52
|
+
* rejects an unknown value and names the valid ones, and a list here would go
|
|
53
|
+
* stale the moment it gains a quantization.
|
|
54
|
+
*/
|
|
55
|
+
declare function getEmbeddingDtype(): string | undefined;
|
|
32
56
|
/**
|
|
33
57
|
* The vector width this model produces, measured rather than looked up.
|
|
34
58
|
*
|
|
@@ -39,7 +63,8 @@ declare function getEmbeddingPooling(): PoolingMode;
|
|
|
39
63
|
*/
|
|
40
64
|
declare function getEmbeddingDim(): Promise<number>;
|
|
41
65
|
/**
|
|
42
|
-
* Encode text to
|
|
66
|
+
* Encode text to a normalized embedding vector. The width is the model's — 384
|
|
67
|
+
* for the default, 1024 for bge-m3 — so nothing here should assume a number.
|
|
43
68
|
* Singleton model, loaded once and reused.
|
|
44
69
|
*/
|
|
45
70
|
declare function encode(text: string): Promise<number[]>;
|
|
@@ -153,6 +178,18 @@ declare class EmbeddingDimensionMismatchError extends Error {
|
|
|
153
178
|
readonly model: string;
|
|
154
179
|
constructor(collection: string, collectionDim: number, modelDim: number, model: string);
|
|
155
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Which embedding model built a collection, and what the process wants to use.
|
|
183
|
+
*
|
|
184
|
+
* Vector width is the only thing Qdrant can check for us, and two models of the
|
|
185
|
+
* same width are indistinguishable to it. This is the case that check misses.
|
|
186
|
+
*/
|
|
187
|
+
declare class EmbeddingModelMismatchError extends Error {
|
|
188
|
+
readonly collection: string;
|
|
189
|
+
readonly collectionModel: string;
|
|
190
|
+
readonly configuredModel: string;
|
|
191
|
+
constructor(collection: string, collectionModel: string, configuredModel: string);
|
|
192
|
+
}
|
|
156
193
|
/**
|
|
157
194
|
* Ask Qdrant whether it can serve, right now.
|
|
158
195
|
*
|
|
@@ -512,4 +549,4 @@ declare function llmCrudDecision(userText: string, assistantText: string, existi
|
|
|
512
549
|
content: string;
|
|
513
550
|
}>): Promise<MemoryOperation[]>;
|
|
514
551
|
|
|
515
|
-
export { type AgentAmemConfig, type AmemPluginConfig, type ConflictMode, type ConflictSweepResult, DEFAULT_CRUD_UPDATE_MIN_SIM, DEFAULT_EMBEDDING_MODEL, EmbeddingDimensionMismatchError, type EvolutionEntry, type LlmConfig, type LowQualityItem, type LowQualityReason, type MemoryNote, type MemoryOperation, type MigrateResult, type PoolingMode, type QueryResult, type SearchResult, type StorageContext, addEpisodic, addMemory, canRead, canWrite, checkQuality, configure, configureLlm, conflictSweep, consolidateMemories, createStorageContext, deleteNote, encode, ensureCollection, generateReviewBatch, getEmbeddingDim, getEmbeddingModel, getEmbeddingPooling, getNote, invalidateNote, isModelLoaded, isPlausibleUpdateTarget, listMemories, listNotes, llmCrudDecision, loadModel, mergeSimilarNotes, migrateCollection, patchNotePayload, pingQdrant, resolveCrudUpdateMinSim, scanLowQuality, searchMemory, updateNote };
|
|
552
|
+
export { type AgentAmemConfig, type AmemPluginConfig, type ConflictMode, type ConflictSweepResult, DEFAULT_CRUD_UPDATE_MIN_SIM, DEFAULT_EMBEDDING_MODEL, EmbeddingDimensionMismatchError, EmbeddingModelMismatchError, type EvolutionEntry, type LlmConfig, type LowQualityItem, type LowQualityReason, type MemoryNote, type MemoryOperation, type MigrateResult, type PoolingMode, type QueryResult, type SearchResult, type StorageContext, addEpisodic, addMemory, canRead, canWrite, checkQuality, configure, configureLlm, conflictSweep, consolidateMemories, createStorageContext, deleteNote, encode, ensureCollection, generateReviewBatch, getEmbeddingDevice, getEmbeddingDim, getEmbeddingDtype, getEmbeddingModel, getEmbeddingPooling, getNote, invalidateNote, isModelLoaded, isPlausibleUpdateTarget, listMemories, listNotes, llmCrudDecision, loadModel, mergeSimilarNotes, migrateCollection, patchNotePayload, pingQdrant, resolveCrudUpdateMinSim, scanLowQuality, searchMemory, updateNote };
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,30 @@ type PoolingMode = 'mean' | 'cls';
|
|
|
29
29
|
* assumed.
|
|
30
30
|
*/
|
|
31
31
|
declare function getEmbeddingPooling(): PoolingMode;
|
|
32
|
+
/**
|
|
33
|
+
* Where inference runs. Unset means Transformers.js picks, which on Node is `cpu`.
|
|
34
|
+
*
|
|
35
|
+
* It is not CPU-only for lack of anything else: `onnxruntime-node`'s macOS arm64
|
|
36
|
+
* binary links CoreML.framework and exports the CoreML provider, and
|
|
37
|
+
* Transformers.js lists `coreml` (macOS), `dml` (Windows), `cuda` (Linux x64) and
|
|
38
|
+
* `webgpu` alongside `cpu`. It simply defaults to `cpu` and amem never asked for
|
|
39
|
+
* anything else.
|
|
40
|
+
*
|
|
41
|
+
* Whether asking helps is **unmeasured**. CoreML partitions a graph operator by
|
|
42
|
+
* operator and falls back to CPU for the ones it cannot take, so it can lose to
|
|
43
|
+
* plain CPU on some models and pay a compile cost on first load. Hence: opt-in,
|
|
44
|
+
* default unchanged, and no recommendation until someone benchmarks it.
|
|
45
|
+
*/
|
|
46
|
+
declare function getEmbeddingDevice(): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Weight precision. Unset means Transformers.js picks, which on Node is `fp32` —
|
|
49
|
+
* the largest download of every variant a model publishes.
|
|
50
|
+
*
|
|
51
|
+
* Passed through rather than validated against a list: Transformers.js already
|
|
52
|
+
* rejects an unknown value and names the valid ones, and a list here would go
|
|
53
|
+
* stale the moment it gains a quantization.
|
|
54
|
+
*/
|
|
55
|
+
declare function getEmbeddingDtype(): string | undefined;
|
|
32
56
|
/**
|
|
33
57
|
* The vector width this model produces, measured rather than looked up.
|
|
34
58
|
*
|
|
@@ -39,7 +63,8 @@ declare function getEmbeddingPooling(): PoolingMode;
|
|
|
39
63
|
*/
|
|
40
64
|
declare function getEmbeddingDim(): Promise<number>;
|
|
41
65
|
/**
|
|
42
|
-
* Encode text to
|
|
66
|
+
* Encode text to a normalized embedding vector. The width is the model's — 384
|
|
67
|
+
* for the default, 1024 for bge-m3 — so nothing here should assume a number.
|
|
43
68
|
* Singleton model, loaded once and reused.
|
|
44
69
|
*/
|
|
45
70
|
declare function encode(text: string): Promise<number[]>;
|
|
@@ -153,6 +178,18 @@ declare class EmbeddingDimensionMismatchError extends Error {
|
|
|
153
178
|
readonly model: string;
|
|
154
179
|
constructor(collection: string, collectionDim: number, modelDim: number, model: string);
|
|
155
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Which embedding model built a collection, and what the process wants to use.
|
|
183
|
+
*
|
|
184
|
+
* Vector width is the only thing Qdrant can check for us, and two models of the
|
|
185
|
+
* same width are indistinguishable to it. This is the case that check misses.
|
|
186
|
+
*/
|
|
187
|
+
declare class EmbeddingModelMismatchError extends Error {
|
|
188
|
+
readonly collection: string;
|
|
189
|
+
readonly collectionModel: string;
|
|
190
|
+
readonly configuredModel: string;
|
|
191
|
+
constructor(collection: string, collectionModel: string, configuredModel: string);
|
|
192
|
+
}
|
|
156
193
|
/**
|
|
157
194
|
* Ask Qdrant whether it can serve, right now.
|
|
158
195
|
*
|
|
@@ -512,4 +549,4 @@ declare function llmCrudDecision(userText: string, assistantText: string, existi
|
|
|
512
549
|
content: string;
|
|
513
550
|
}>): Promise<MemoryOperation[]>;
|
|
514
551
|
|
|
515
|
-
export { type AgentAmemConfig, type AmemPluginConfig, type ConflictMode, type ConflictSweepResult, DEFAULT_CRUD_UPDATE_MIN_SIM, DEFAULT_EMBEDDING_MODEL, EmbeddingDimensionMismatchError, type EvolutionEntry, type LlmConfig, type LowQualityItem, type LowQualityReason, type MemoryNote, type MemoryOperation, type MigrateResult, type PoolingMode, type QueryResult, type SearchResult, type StorageContext, addEpisodic, addMemory, canRead, canWrite, checkQuality, configure, configureLlm, conflictSweep, consolidateMemories, createStorageContext, deleteNote, encode, ensureCollection, generateReviewBatch, getEmbeddingDim, getEmbeddingModel, getEmbeddingPooling, getNote, invalidateNote, isModelLoaded, isPlausibleUpdateTarget, listMemories, listNotes, llmCrudDecision, loadModel, mergeSimilarNotes, migrateCollection, patchNotePayload, pingQdrant, resolveCrudUpdateMinSim, scanLowQuality, searchMemory, updateNote };
|
|
552
|
+
export { type AgentAmemConfig, type AmemPluginConfig, type ConflictMode, type ConflictSweepResult, DEFAULT_CRUD_UPDATE_MIN_SIM, DEFAULT_EMBEDDING_MODEL, EmbeddingDimensionMismatchError, EmbeddingModelMismatchError, type EvolutionEntry, type LlmConfig, type LowQualityItem, type LowQualityReason, type MemoryNote, type MemoryOperation, type MigrateResult, type PoolingMode, type QueryResult, type SearchResult, type StorageContext, addEpisodic, addMemory, canRead, canWrite, checkQuality, configure, configureLlm, conflictSweep, consolidateMemories, createStorageContext, deleteNote, encode, ensureCollection, generateReviewBatch, getEmbeddingDevice, getEmbeddingDim, getEmbeddingDtype, getEmbeddingModel, getEmbeddingPooling, getNote, invalidateNote, isModelLoaded, isPlausibleUpdateTarget, listMemories, listNotes, llmCrudDecision, loadModel, mergeSimilarNotes, migrateCollection, patchNotePayload, pingQdrant, resolveCrudUpdateMinSim, scanLowQuality, searchMemory, updateNote };
|