@aman_asmuei/amem 0.12.0 → 0.14.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/README.md +91 -38
- package/dist/ann.d.ts +18 -0
- package/dist/ann.js +38 -0
- package/dist/ann.js.map +1 -0
- package/dist/auto-relate.d.ts +14 -0
- package/dist/auto-relate.js +47 -0
- package/dist/auto-relate.js.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/dashboard.js +3 -3
- package/dist/doctor.d.ts +23 -0
- package/dist/doctor.js +107 -0
- package/dist/doctor.js.map +1 -0
- package/dist/embeddings.js +10 -3
- package/dist/embeddings.js.map +1 -1
- package/dist/index.js +58 -1
- package/dist/index.js.map +1 -1
- package/dist/memory.d.ts +3 -0
- package/dist/memory.js +62 -14
- package/dist/memory.js.map +1 -1
- package/dist/memory.test.js +3 -2
- package/dist/memory.test.js.map +1 -1
- package/dist/query-expand.d.ts +9 -0
- package/dist/query-expand.js +71 -0
- package/dist/query-expand.js.map +1 -0
- package/dist/schemas.d.ts +30 -30
- package/dist/tools/memory.js +68 -6
- package/dist/tools/memory.js.map +1 -1
- package/package.json +1 -1
package/dist/memory.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.test.js","sourceRoot":"","sources":["../src/memory.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,GAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAC;AAElE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,wBAAwB,EAAE,GAAG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 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Developer-domain query expansion: synonym mapping + basic stemming.
|
|
3
|
+
* Used to improve keyword recall when embeddings are unavailable.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Expand a query string into an array of terms including synonyms and stems.
|
|
7
|
+
* Returns a deduplicated array of lowercase terms.
|
|
8
|
+
*/
|
|
9
|
+
export declare function expandQuery(query: string): string[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Developer-domain query expansion: synonym mapping + basic stemming.
|
|
3
|
+
* Used to improve keyword recall when embeddings are unavailable.
|
|
4
|
+
*/
|
|
5
|
+
const SYNONYM_MAP = {
|
|
6
|
+
auth: ["authentication", "login", "session"],
|
|
7
|
+
config: ["configuration", "settings"],
|
|
8
|
+
test: ["testing", "spec"],
|
|
9
|
+
db: ["database", "sql"],
|
|
10
|
+
api: ["endpoint", "route"],
|
|
11
|
+
deploy: ["deployment", "release"],
|
|
12
|
+
error: ["exception", "bug"],
|
|
13
|
+
cache: ["caching"],
|
|
14
|
+
env: ["environment"],
|
|
15
|
+
perf: ["performance", "optimization"],
|
|
16
|
+
style: ["styling", "css"],
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Basic suffix stripping for common English suffixes.
|
|
20
|
+
* Only applies to words longer than 4 characters.
|
|
21
|
+
*/
|
|
22
|
+
function basicStem(word) {
|
|
23
|
+
if (word.length <= 4)
|
|
24
|
+
return word;
|
|
25
|
+
// Order matters: try longer suffixes first
|
|
26
|
+
if (word.endsWith("tion"))
|
|
27
|
+
return word.slice(0, -4);
|
|
28
|
+
if (word.endsWith("ment"))
|
|
29
|
+
return word.slice(0, -4);
|
|
30
|
+
if (word.endsWith("ness"))
|
|
31
|
+
return word.slice(0, -4);
|
|
32
|
+
if (word.endsWith("able"))
|
|
33
|
+
return word.slice(0, -4);
|
|
34
|
+
if (word.endsWith("ies"))
|
|
35
|
+
return word.slice(0, -3) + "y";
|
|
36
|
+
if (word.endsWith("ing"))
|
|
37
|
+
return word.slice(0, -3);
|
|
38
|
+
if (word.endsWith("es"))
|
|
39
|
+
return word.slice(0, -2);
|
|
40
|
+
if (word.endsWith("s"))
|
|
41
|
+
return word.slice(0, -1);
|
|
42
|
+
return word;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Expand a query string into an array of terms including synonyms and stems.
|
|
46
|
+
* Returns a deduplicated array of lowercase terms.
|
|
47
|
+
*/
|
|
48
|
+
export function expandQuery(query) {
|
|
49
|
+
const words = query
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.split(/\s+/)
|
|
52
|
+
.filter((w) => w.length > 0);
|
|
53
|
+
const terms = new Set();
|
|
54
|
+
for (const word of words) {
|
|
55
|
+
terms.add(word);
|
|
56
|
+
// Add synonyms if available
|
|
57
|
+
const synonyms = SYNONYM_MAP[word];
|
|
58
|
+
if (synonyms) {
|
|
59
|
+
for (const syn of synonyms) {
|
|
60
|
+
terms.add(syn);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Apply stemming and add the stem
|
|
64
|
+
const stem = basicStem(word);
|
|
65
|
+
if (stem !== word) {
|
|
66
|
+
terms.add(stem);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return [...terms];
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=query-expand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-expand.js","sourceRoot":"","sources":["../src/query-expand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,GAA6B;IAC5C,IAAI,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,SAAS,CAAC;IAC5C,MAAM,EAAE,CAAC,eAAe,EAAE,UAAU,CAAC;IACrC,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC;IACvB,GAAG,EAAE,CAAC,UAAU,EAA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AC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEjD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,KAAK,GAAG,KAAK;SAChB,WAAW,EAAE;SACb,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE/B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEhB,4BAA4B;QAC5B,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;QAED,kCAAkC;QAClC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACpB,CAAC"}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -8,16 +8,16 @@ export declare const StoreResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
8
8
|
total: z.ZodNumber;
|
|
9
9
|
reinforced: z.ZodNumber;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
type: string;
|
|
12
11
|
id: string;
|
|
12
|
+
type: string;
|
|
13
13
|
confidence: number;
|
|
14
14
|
tags: string[];
|
|
15
15
|
action: "stored";
|
|
16
16
|
total: number;
|
|
17
17
|
reinforced: number;
|
|
18
18
|
}, {
|
|
19
|
-
type: string;
|
|
20
19
|
id: string;
|
|
20
|
+
type: string;
|
|
21
21
|
confidence: number;
|
|
22
22
|
tags: string[];
|
|
23
23
|
action: "stored";
|
|
@@ -51,16 +51,16 @@ export declare const RecallResultSchema: z.ZodObject<{
|
|
|
51
51
|
tags: z.ZodArray<z.ZodString, "many">;
|
|
52
52
|
age: z.ZodString;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
type: string;
|
|
55
54
|
id: string;
|
|
55
|
+
type: string;
|
|
56
56
|
content: string;
|
|
57
57
|
confidence: number;
|
|
58
58
|
tags: string[];
|
|
59
59
|
score: number;
|
|
60
60
|
age: string;
|
|
61
61
|
}, {
|
|
62
|
-
type: string;
|
|
63
62
|
id: string;
|
|
63
|
+
type: string;
|
|
64
64
|
content: string;
|
|
65
65
|
confidence: number;
|
|
66
66
|
tags: string[];
|
|
@@ -71,8 +71,8 @@ export declare const RecallResultSchema: z.ZodObject<{
|
|
|
71
71
|
query: string;
|
|
72
72
|
total: number;
|
|
73
73
|
memories: {
|
|
74
|
-
type: string;
|
|
75
74
|
id: string;
|
|
75
|
+
type: string;
|
|
76
76
|
content: string;
|
|
77
77
|
confidence: number;
|
|
78
78
|
tags: string[];
|
|
@@ -83,8 +83,8 @@ export declare const RecallResultSchema: z.ZodObject<{
|
|
|
83
83
|
query: string;
|
|
84
84
|
total: number;
|
|
85
85
|
memories: {
|
|
86
|
-
type: string;
|
|
87
86
|
id: string;
|
|
87
|
+
type: string;
|
|
88
88
|
content: string;
|
|
89
89
|
confidence: number;
|
|
90
90
|
tags: string[];
|
|
@@ -147,13 +147,13 @@ export declare const ForgetResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
147
147
|
content: z.ZodString;
|
|
148
148
|
type: z.ZodString;
|
|
149
149
|
}, "strip", z.ZodTypeAny, {
|
|
150
|
-
type: string;
|
|
151
150
|
id: string;
|
|
151
|
+
type: string;
|
|
152
152
|
content: string;
|
|
153
153
|
action: "deleted";
|
|
154
154
|
}, {
|
|
155
|
-
type: string;
|
|
156
155
|
id: string;
|
|
156
|
+
type: string;
|
|
157
157
|
content: string;
|
|
158
158
|
action: "deleted";
|
|
159
159
|
}>, z.ZodObject<{
|
|
@@ -213,15 +213,15 @@ export declare const ExtractResultSchema: z.ZodObject<{
|
|
|
213
213
|
}, "strip", z.ZodTypeAny, {
|
|
214
214
|
content: string;
|
|
215
215
|
action: "stored" | "reinforced";
|
|
216
|
-
type?: string | undefined;
|
|
217
216
|
id?: string | undefined;
|
|
217
|
+
type?: string | undefined;
|
|
218
218
|
similarity?: number | undefined;
|
|
219
219
|
matchedContent?: string | undefined;
|
|
220
220
|
}, {
|
|
221
221
|
content: string;
|
|
222
222
|
action: "stored" | "reinforced";
|
|
223
|
-
type?: string | undefined;
|
|
224
223
|
id?: string | undefined;
|
|
224
|
+
type?: string | undefined;
|
|
225
225
|
similarity?: number | undefined;
|
|
226
226
|
matchedContent?: string | undefined;
|
|
227
227
|
}>, "many">;
|
|
@@ -232,8 +232,8 @@ export declare const ExtractResultSchema: z.ZodObject<{
|
|
|
232
232
|
details: {
|
|
233
233
|
content: string;
|
|
234
234
|
action: "stored" | "reinforced";
|
|
235
|
-
type?: string | undefined;
|
|
236
235
|
id?: string | undefined;
|
|
236
|
+
type?: string | undefined;
|
|
237
237
|
similarity?: number | undefined;
|
|
238
238
|
matchedContent?: string | undefined;
|
|
239
239
|
}[];
|
|
@@ -244,8 +244,8 @@ export declare const ExtractResultSchema: z.ZodObject<{
|
|
|
244
244
|
details: {
|
|
245
245
|
content: string;
|
|
246
246
|
action: "stored" | "reinforced";
|
|
247
|
-
type?: string | undefined;
|
|
248
247
|
id?: string | undefined;
|
|
248
|
+
type?: string | undefined;
|
|
249
249
|
similarity?: number | undefined;
|
|
250
250
|
matchedContent?: string | undefined;
|
|
251
251
|
}[];
|
|
@@ -654,16 +654,16 @@ export declare const TemporalResultSchema: z.ZodObject<{
|
|
|
654
654
|
age: z.ZodString;
|
|
655
655
|
tags: z.ZodArray<z.ZodString, "many">;
|
|
656
656
|
}, "strip", z.ZodTypeAny, {
|
|
657
|
-
type: string;
|
|
658
657
|
id: string;
|
|
658
|
+
type: string;
|
|
659
659
|
content: string;
|
|
660
660
|
confidence: number;
|
|
661
661
|
tags: string[];
|
|
662
662
|
age: string;
|
|
663
663
|
createdAt: number;
|
|
664
664
|
}, {
|
|
665
|
-
type: string;
|
|
666
665
|
id: string;
|
|
666
|
+
type: string;
|
|
667
667
|
content: string;
|
|
668
668
|
confidence: number;
|
|
669
669
|
tags: string[];
|
|
@@ -673,8 +673,8 @@ export declare const TemporalResultSchema: z.ZodObject<{
|
|
|
673
673
|
}, "strip", z.ZodTypeAny, {
|
|
674
674
|
total: number;
|
|
675
675
|
memories: {
|
|
676
|
-
type: string;
|
|
677
676
|
id: string;
|
|
677
|
+
type: string;
|
|
678
678
|
content: string;
|
|
679
679
|
confidence: number;
|
|
680
680
|
tags: string[];
|
|
@@ -686,8 +686,8 @@ export declare const TemporalResultSchema: z.ZodObject<{
|
|
|
686
686
|
}, {
|
|
687
687
|
total: number;
|
|
688
688
|
memories: {
|
|
689
|
-
type: string;
|
|
690
689
|
id: string;
|
|
690
|
+
type: string;
|
|
691
691
|
content: string;
|
|
692
692
|
confidence: number;
|
|
693
693
|
tags: string[];
|
|
@@ -709,17 +709,17 @@ export declare const DetailResultSchema: z.ZodObject<{
|
|
|
709
709
|
age: z.ZodString;
|
|
710
710
|
scope: z.ZodString;
|
|
711
711
|
}, "strip", z.ZodTypeAny, {
|
|
712
|
+
id: string;
|
|
712
713
|
type: string;
|
|
713
714
|
scope: string;
|
|
714
|
-
id: string;
|
|
715
715
|
content: string;
|
|
716
716
|
confidence: number;
|
|
717
717
|
tags: string[];
|
|
718
718
|
age: string;
|
|
719
719
|
}, {
|
|
720
|
+
id: string;
|
|
720
721
|
type: string;
|
|
721
722
|
scope: string;
|
|
722
|
-
id: string;
|
|
723
723
|
content: string;
|
|
724
724
|
confidence: number;
|
|
725
725
|
tags: string[];
|
|
@@ -728,9 +728,9 @@ export declare const DetailResultSchema: z.ZodObject<{
|
|
|
728
728
|
}, "strip", z.ZodTypeAny, {
|
|
729
729
|
total: number;
|
|
730
730
|
memories: {
|
|
731
|
+
id: string;
|
|
731
732
|
type: string;
|
|
732
733
|
scope: string;
|
|
733
|
-
id: string;
|
|
734
734
|
content: string;
|
|
735
735
|
confidence: number;
|
|
736
736
|
tags: string[];
|
|
@@ -740,9 +740,9 @@ export declare const DetailResultSchema: z.ZodObject<{
|
|
|
740
740
|
}, {
|
|
741
741
|
total: number;
|
|
742
742
|
memories: {
|
|
743
|
+
id: string;
|
|
743
744
|
type: string;
|
|
744
745
|
scope: string;
|
|
745
|
-
id: string;
|
|
746
746
|
content: string;
|
|
747
747
|
confidence: number;
|
|
748
748
|
tags: string[];
|
|
@@ -756,13 +756,13 @@ export declare const ReminderSetResultSchema: z.ZodObject<{
|
|
|
756
756
|
dueAt: z.ZodNullable<z.ZodNumber>;
|
|
757
757
|
scope: z.ZodString;
|
|
758
758
|
}, "strip", z.ZodTypeAny, {
|
|
759
|
-
scope: string;
|
|
760
759
|
id: string;
|
|
760
|
+
scope: string;
|
|
761
761
|
content: string;
|
|
762
762
|
dueAt: number | null;
|
|
763
763
|
}, {
|
|
764
|
-
scope: string;
|
|
765
764
|
id: string;
|
|
765
|
+
scope: string;
|
|
766
766
|
content: string;
|
|
767
767
|
dueAt: number | null;
|
|
768
768
|
}>;
|
|
@@ -775,14 +775,14 @@ export declare const ReminderListResultSchema: z.ZodObject<{
|
|
|
775
775
|
completed: z.ZodBoolean;
|
|
776
776
|
scope: z.ZodString;
|
|
777
777
|
}, "strip", z.ZodTypeAny, {
|
|
778
|
-
scope: string;
|
|
779
778
|
id: string;
|
|
779
|
+
scope: string;
|
|
780
780
|
content: string;
|
|
781
781
|
dueAt: number | null;
|
|
782
782
|
completed: boolean;
|
|
783
783
|
}, {
|
|
784
|
-
scope: string;
|
|
785
784
|
id: string;
|
|
785
|
+
scope: string;
|
|
786
786
|
content: string;
|
|
787
787
|
dueAt: number | null;
|
|
788
788
|
completed: boolean;
|
|
@@ -790,8 +790,8 @@ export declare const ReminderListResultSchema: z.ZodObject<{
|
|
|
790
790
|
}, "strip", z.ZodTypeAny, {
|
|
791
791
|
total: number;
|
|
792
792
|
reminders: {
|
|
793
|
-
scope: string;
|
|
794
793
|
id: string;
|
|
794
|
+
scope: string;
|
|
795
795
|
content: string;
|
|
796
796
|
dueAt: number | null;
|
|
797
797
|
completed: boolean;
|
|
@@ -799,8 +799,8 @@ export declare const ReminderListResultSchema: z.ZodObject<{
|
|
|
799
799
|
}, {
|
|
800
800
|
total: number;
|
|
801
801
|
reminders: {
|
|
802
|
-
scope: string;
|
|
803
802
|
id: string;
|
|
803
|
+
scope: string;
|
|
804
804
|
content: string;
|
|
805
805
|
dueAt: number | null;
|
|
806
806
|
completed: boolean;
|
|
@@ -815,14 +815,14 @@ export declare const ReminderCheckResultSchema: z.ZodObject<{
|
|
|
815
815
|
status: z.ZodEnum<["overdue", "today", "upcoming"]>;
|
|
816
816
|
scope: z.ZodString;
|
|
817
817
|
}, "strip", z.ZodTypeAny, {
|
|
818
|
-
scope: string;
|
|
819
818
|
id: string;
|
|
819
|
+
scope: string;
|
|
820
820
|
content: string;
|
|
821
821
|
status: "overdue" | "today" | "upcoming";
|
|
822
822
|
dueAt: number | null;
|
|
823
823
|
}, {
|
|
824
|
-
scope: string;
|
|
825
824
|
id: string;
|
|
825
|
+
scope: string;
|
|
826
826
|
content: string;
|
|
827
827
|
status: "overdue" | "today" | "upcoming";
|
|
828
828
|
dueAt: number | null;
|
|
@@ -830,8 +830,8 @@ export declare const ReminderCheckResultSchema: z.ZodObject<{
|
|
|
830
830
|
}, "strip", z.ZodTypeAny, {
|
|
831
831
|
total: number;
|
|
832
832
|
reminders: {
|
|
833
|
-
scope: string;
|
|
834
833
|
id: string;
|
|
834
|
+
scope: string;
|
|
835
835
|
content: string;
|
|
836
836
|
status: "overdue" | "today" | "upcoming";
|
|
837
837
|
dueAt: number | null;
|
|
@@ -839,8 +839,8 @@ export declare const ReminderCheckResultSchema: z.ZodObject<{
|
|
|
839
839
|
}, {
|
|
840
840
|
total: number;
|
|
841
841
|
reminders: {
|
|
842
|
-
scope: string;
|
|
843
842
|
id: string;
|
|
843
|
+
scope: string;
|
|
844
844
|
content: string;
|
|
845
845
|
status: "overdue" | "today" | "upcoming";
|
|
846
846
|
dueAt: number | null;
|
package/dist/tools/memory.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { MemoryType, recallMemories, detectConflict, consolidateMemories, autoExpireContradictions } from "../memory.js";
|
|
2
|
+
import { MemoryType, recallMemories, detectConflict, consolidateMemories, autoExpireContradictions, getANNIndex } from "../memory.js";
|
|
3
3
|
import { generateEmbedding, cosineSimilarity } from "../embeddings.js";
|
|
4
4
|
import { sanitizeContent, loadConfig } from "../config.js";
|
|
5
|
+
import { autoRelateMemory } from "../auto-relate.js";
|
|
5
6
|
import { RecallResultSchema, ContextResultSchema, ExtractResultSchema, StatsResultSchema, ExportResultSchema, InjectResultSchema, ConsolidateResultSchema, DetailResultSchema, } from "../schemas.js";
|
|
6
7
|
import { TYPE_ORDER, MEMORY_TYPES, CHARACTER_LIMIT, shortId, formatAge } from "./helpers.js";
|
|
7
8
|
export function registerMemoryTools(server, db, project, autoScope) {
|
|
@@ -98,6 +99,17 @@ Returns:
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
const id = db.insertMemory({ content, type: type, tags, confidence, source, embedding, scope: scope ?? autoScope(type) });
|
|
102
|
+
// Keep ANN index in sync
|
|
103
|
+
if (embedding) {
|
|
104
|
+
const annIdx = getANNIndex();
|
|
105
|
+
if (annIdx)
|
|
106
|
+
annIdx.add(id, embedding);
|
|
107
|
+
}
|
|
108
|
+
// Auto-relate to similar existing memories
|
|
109
|
+
const autoRelated = autoRelateMemory(db, id);
|
|
110
|
+
const graphNote = autoRelated.created > 0
|
|
111
|
+
? ` Auto-linked to ${autoRelated.created} related memories.`
|
|
112
|
+
: "";
|
|
101
113
|
// Apply boosts and reinforcements collected in the single pass
|
|
102
114
|
for (const b of toBoostConfidence) {
|
|
103
115
|
db.updateConfidence(b.id, Math.min(1.0, b.confidence + 0.1));
|
|
@@ -110,7 +122,7 @@ Returns:
|
|
|
110
122
|
return {
|
|
111
123
|
content: [{
|
|
112
124
|
type: "text",
|
|
113
|
-
text: `Stored ${type} memory (${shortId(id)}). Confidence: ${confidence}. Tags: [${tags.join(", ")}]. Total memories: ${stats.total}.${evolvedNote}`,
|
|
125
|
+
text: `Stored ${type} memory (${shortId(id)}). Confidence: ${confidence}. Tags: [${tags.join(", ")}]. Total memories: ${stats.total}.${evolvedNote}${graphNote}`,
|
|
114
126
|
}],
|
|
115
127
|
structuredContent: {
|
|
116
128
|
action: "stored",
|
|
@@ -141,11 +153,15 @@ Returns:
|
|
|
141
153
|
};
|
|
142
154
|
}
|
|
143
155
|
const id = db.insertMemory({ content, type: type, tags, confidence, source, embedding, scope: scope ?? autoScope(type) });
|
|
156
|
+
const autoRelated = autoRelateMemory(db, id);
|
|
157
|
+
const graphNote = autoRelated.created > 0
|
|
158
|
+
? ` Auto-linked to ${autoRelated.created} related memories.`
|
|
159
|
+
: "";
|
|
144
160
|
const stats = db.getStats();
|
|
145
161
|
return {
|
|
146
162
|
content: [{
|
|
147
163
|
type: "text",
|
|
148
|
-
text: `Stored ${type} memory (${shortId(id)}). Confidence: ${confidence}. Tags: [${tags.join(", ")}]. Total memories: ${stats.total}
|
|
164
|
+
text: `Stored ${type} memory (${shortId(id)}). Confidence: ${confidence}. Tags: [${tags.join(", ")}]. Total memories: ${stats.total}.${graphNote}`,
|
|
149
165
|
}],
|
|
150
166
|
structuredContent: {
|
|
151
167
|
action: "stored",
|
|
@@ -505,6 +521,10 @@ Error Handling:
|
|
|
505
521
|
};
|
|
506
522
|
}
|
|
507
523
|
db.deleteMemory(fullId);
|
|
524
|
+
// Keep ANN index in sync
|
|
525
|
+
const annIdx = getANNIndex();
|
|
526
|
+
if (annIdx)
|
|
527
|
+
annIdx.remove(fullId);
|
|
508
528
|
return {
|
|
509
529
|
content: [{ type: "text", text: `Deleted memory: "${memory.content}" (${memory.type})` }],
|
|
510
530
|
structuredContent: {
|
|
@@ -544,8 +564,13 @@ Error Handling:
|
|
|
544
564
|
},
|
|
545
565
|
};
|
|
546
566
|
}
|
|
547
|
-
for (const m of matches)
|
|
567
|
+
for (const m of matches) {
|
|
548
568
|
db.deleteMemory(m.id);
|
|
569
|
+
// Keep ANN index in sync
|
|
570
|
+
const annIdx2 = getANNIndex();
|
|
571
|
+
if (annIdx2)
|
|
572
|
+
annIdx2.remove(m.id);
|
|
573
|
+
}
|
|
549
574
|
return {
|
|
550
575
|
content: [{ type: "text", text: `Deleted ${matches.length} memories matching "${query}".` }],
|
|
551
576
|
structuredContent: {
|
|
@@ -670,6 +695,12 @@ Returns:
|
|
|
670
695
|
embedding: pending.embedding,
|
|
671
696
|
scope: autoScope(pending.input.type),
|
|
672
697
|
});
|
|
698
|
+
// Keep ANN index in sync
|
|
699
|
+
if (pending.embedding) {
|
|
700
|
+
const annIdx = getANNIndex();
|
|
701
|
+
if (annIdx)
|
|
702
|
+
annIdx.add(id, pending.embedding);
|
|
703
|
+
}
|
|
673
704
|
stored++;
|
|
674
705
|
details.push(` + Stored [${pending.input.type}]: "${pending.input.content}" (${shortId(id)})`);
|
|
675
706
|
structuredDetails.push({
|
|
@@ -953,11 +984,31 @@ Returns:
|
|
|
953
984
|
};
|
|
954
985
|
}
|
|
955
986
|
// Only touch access for memories actually surfaced to the user
|
|
987
|
+
const injectedIds = new Set();
|
|
956
988
|
for (const r of results) {
|
|
957
989
|
if (r.type === MemoryType.CORRECTION || r.type === MemoryType.DECISION) {
|
|
958
990
|
db.touchAccess(r.id);
|
|
991
|
+
injectedIds.add(r.id);
|
|
959
992
|
}
|
|
960
993
|
}
|
|
994
|
+
// Graph-aware injection: surface 1-hop neighbors of top results
|
|
995
|
+
const graphContext = [];
|
|
996
|
+
const topResults = results.filter(r => r.type === MemoryType.CORRECTION || r.type === MemoryType.DECISION).slice(0, 5);
|
|
997
|
+
for (const r of topResults) {
|
|
998
|
+
const related = db.getRelatedMemories(r.id);
|
|
999
|
+
for (const rel of related.slice(0, 2)) {
|
|
1000
|
+
if (injectedIds.has(rel.id))
|
|
1001
|
+
continue;
|
|
1002
|
+
if (rel.validUntil !== null && rel.validUntil <= Date.now())
|
|
1003
|
+
continue;
|
|
1004
|
+
injectedIds.add(rel.id);
|
|
1005
|
+
graphContext.push(`- [${rel.type}] ${rel.content}`);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
if (graphContext.length > 0) {
|
|
1009
|
+
context += "\n\n## Related Context (from knowledge graph)\n";
|
|
1010
|
+
context += graphContext.join("\n");
|
|
1011
|
+
}
|
|
961
1012
|
return {
|
|
962
1013
|
content: [{ type: "text", text: context.trim() }],
|
|
963
1014
|
structuredContent: {
|
|
@@ -965,7 +1016,7 @@ Returns:
|
|
|
965
1016
|
corrections,
|
|
966
1017
|
decisions,
|
|
967
1018
|
context: context.trim(),
|
|
968
|
-
memoriesUsed: corrections.length + decisions.length,
|
|
1019
|
+
memoriesUsed: corrections.length + decisions.length + graphContext.length,
|
|
969
1020
|
},
|
|
970
1021
|
};
|
|
971
1022
|
}
|
|
@@ -1141,8 +1192,13 @@ Args:
|
|
|
1141
1192
|
// Regenerate embedding if content changed
|
|
1142
1193
|
if (field === "content" && typeof value === "string") {
|
|
1143
1194
|
const newEmbedding = await generateEmbedding(value);
|
|
1144
|
-
if (newEmbedding)
|
|
1195
|
+
if (newEmbedding) {
|
|
1145
1196
|
db.updateEmbedding(fullId, newEmbedding);
|
|
1197
|
+
// Keep ANN index in sync
|
|
1198
|
+
const annIdx = getANNIndex();
|
|
1199
|
+
if (annIdx)
|
|
1200
|
+
annIdx.add(fullId, newEmbedding);
|
|
1201
|
+
}
|
|
1146
1202
|
}
|
|
1147
1203
|
const displayValue = Array.isArray(value) ? `[${value.join(", ")}]` : String(value);
|
|
1148
1204
|
return {
|
|
@@ -1233,6 +1289,12 @@ Returns:
|
|
|
1233
1289
|
embedding,
|
|
1234
1290
|
scope: autoScope(input.type),
|
|
1235
1291
|
});
|
|
1292
|
+
// Keep ANN index in sync
|
|
1293
|
+
if (embedding) {
|
|
1294
|
+
const annIdx = getANNIndex();
|
|
1295
|
+
if (annIdx)
|
|
1296
|
+
annIdx.add(id, embedding);
|
|
1297
|
+
}
|
|
1236
1298
|
stored++;
|
|
1237
1299
|
details.push({
|
|
1238
1300
|
action: "stored",
|