@jeremiaheth/neolata-mem 0.8.2 → 0.8.4
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/package.json +1 -1
- package/src/supabase-storage.mjs +12 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeremiaheth/neolata-mem",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "Trustworthy graph-native memory engine for AI agents - belief updates, provenance tracking, trust-gated supersession, and poisoning resistance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.mjs",
|
package/src/supabase-storage.mjs
CHANGED
|
@@ -490,13 +490,18 @@ export function supabaseStorage({
|
|
|
490
490
|
async upsertLinks(sourceId, links) {
|
|
491
491
|
assertUUID(sourceId, 'upsertLinks: sourceId');
|
|
492
492
|
if (!links.length) return;
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
493
|
+
// Normalize to canonical direction (sorted pair) to prevent bidirectional dupes.
|
|
494
|
+
// loadLinks() already treats each row as bidirectional, so one row per pair suffices.
|
|
495
|
+
const rows = links.map(l => {
|
|
496
|
+
const [a, b] = [sourceId, l.id].sort();
|
|
497
|
+
return {
|
|
498
|
+
id: randomUUID(),
|
|
499
|
+
source_id: a,
|
|
500
|
+
target_id: b,
|
|
501
|
+
strength: l.similarity,
|
|
502
|
+
created_at: new Date().toISOString(),
|
|
503
|
+
};
|
|
504
|
+
});
|
|
500
505
|
await request('POST', `/rest/v1/${linksTable}`, rows, {
|
|
501
506
|
'Prefer': 'return=minimal,resolution=merge-duplicates',
|
|
502
507
|
});
|