@signetai/core 0.176.1 → 0.176.3
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/index.js
CHANGED
|
@@ -11097,6 +11097,14 @@ function up109(db) {
|
|
|
11097
11097
|
`);
|
|
11098
11098
|
}
|
|
11099
11099
|
|
|
11100
|
+
// src/migrations/110-memory-mention-join-index.ts
|
|
11101
|
+
function up110(db) {
|
|
11102
|
+
db.exec(`
|
|
11103
|
+
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
11104
|
+
ON memory_entity_mentions(entity_id, memory_id);
|
|
11105
|
+
`);
|
|
11106
|
+
}
|
|
11107
|
+
|
|
11100
11108
|
// src/migrations/index.ts
|
|
11101
11109
|
var MIGRATIONS = [
|
|
11102
11110
|
{
|
|
@@ -11968,6 +11976,11 @@ var MIGRATIONS = [
|
|
|
11968
11976
|
artifacts: {
|
|
11969
11977
|
tables: ["telemetry_install"]
|
|
11970
11978
|
}
|
|
11979
|
+
},
|
|
11980
|
+
{
|
|
11981
|
+
version: 110,
|
|
11982
|
+
name: "memory-mention-join-index",
|
|
11983
|
+
up: up110
|
|
11971
11984
|
}
|
|
11972
11985
|
];
|
|
11973
11986
|
function checksum(m) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MigrationDb } from "./index";
|
|
2
|
+
/**
|
|
3
|
+
* Migration 110: entity-side composite index for memory_entity_mentions.
|
|
4
|
+
*
|
|
5
|
+
* The knowledge-graph `COUNT(DISTINCT mem.memory_id)` join in
|
|
6
|
+
* getKnowledgeStats drives from the entity/memory tables when only the
|
|
7
|
+
* `(entity_id)` index and the `(memory_id, entity_id)` PRIMARY KEY exist,
|
|
8
|
+
* turning a stats call over a few thousand entities into a ~30M-iteration
|
|
9
|
+
* nested loop (9.4s on a 5.5K-entity install). The dashboard polls
|
|
10
|
+
* `/api/knowledge/stats` every few seconds, so each poll blocks the main
|
|
11
|
+
* thread (Signet-AI/signetai#1158).
|
|
12
|
+
*
|
|
13
|
+
* The composite `(entity_id, memory_id)` index lets SQLite drive the join
|
|
14
|
+
* from the mentions table and covers both columns; the same query drops to
|
|
15
|
+
* ~13ms. It also serves entity-side mention scans in graph-traversal and
|
|
16
|
+
* relinking paths.
|
|
17
|
+
*/
|
|
18
|
+
export declare function up(db: MigrationDb): void;
|
|
19
|
+
//# sourceMappingURL=110-memory-mention-join-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"110-memory-mention-join-index.d.ts","sourceRoot":"","sources":["../../src/migrations/110-memory-mention-join-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAKxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmHH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QACrB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC9B,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;QAC7D,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;KACnD,CAAC;CACF;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,M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