@tangleai/memory 0.20.1 → 0.21.1
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/CHANGELOG.md +31 -0
- package/package.json +5 -5
- package/src/contradiction.d.ts +2 -2
- package/src/contradiction.js +2 -2
- package/src/crystallize.js +1 -1
- package/src/ingest.d.ts +1 -1
- package/src/ingest.js +1 -1
- package/src/novelty.js +1 -1
- package/src/retrieval.d.ts +1 -1
- package/src/retrieval.js +2 -2
- package/src/store.d.ts +1 -1
- package/src/store.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @tangleai/memory
|
|
2
2
|
|
|
3
|
+
## 0.21.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update the exact Jaren foundation dependencies and source pin to the published
|
|
8
|
+
0.84.3 release after verifying its AI-free archives against source-built bytes.
|
|
9
|
+
Retain Tangle's model, context and agent ownership and align the development
|
|
10
|
+
Node pin with 24.20.0. Tangle publication remains a manual author action.
|
|
11
|
+
Allow release preparation after an already committed local release while
|
|
12
|
+
preserving its record and rejecting unprepared version edits.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @tangleai/context@0.21.1
|
|
15
|
+
- @tangleai/core@0.21.1
|
|
16
|
+
|
|
17
|
+
## 0.21.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- Use the models, context and agents owners of the inherited AI mechanisms. MAS
|
|
22
|
+
executable identity version 3 names all executed mechanism versions; an old
|
|
23
|
+
executable checkpoint is refused intact through the existing mismatch path.
|
|
24
|
+
Memory and ledger records retain their schemas and projection contracts.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
- @tangleai/core@0.21.0
|
|
32
|
+
- @tangleai/context@0.21.0
|
|
33
|
+
|
|
3
34
|
## 0.20.1
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangleai/memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Tangle AI memory policies — novelty gating, crystallization, contradiction resolution, outcome learning — over an injected store",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@jarenjs/
|
|
59
|
-
"@
|
|
56
|
+
"@tangleai/core": "^0.21.1",
|
|
57
|
+
"@jarenjs/core": "0.84.3",
|
|
58
|
+
"@jarenjs/validate": "0.84.3",
|
|
59
|
+
"@tangleai/context": "^0.21.1"
|
|
60
60
|
},
|
|
61
61
|
"private": false,
|
|
62
62
|
"types": "./src/index.d.ts",
|
package/src/contradiction.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* memflow called `llm.invoke()` inline and regex-scraped JSON out of the
|
|
6
6
|
* reply. Here the judge is INJECTED: any async function answering the
|
|
7
7
|
* verdict shape. The intended production judge is two lines of
|
|
8
|
-
* @
|
|
8
|
+
* @tangleai/models — `createStructuredOutput({ client, schema:
|
|
9
9
|
* CONTRADICTION_VERDICT_SCHEMA })` over `contradictionMessages(a, b)` —
|
|
10
10
|
* which buys schema-constrained decoding and the bounded repair loop
|
|
11
11
|
* instead of a regex. The tests inject a table.
|
|
@@ -35,7 +35,7 @@ import type { JsonSchema, MemoryUnit } from '@tangleai/core/schemas/memory';
|
|
|
35
35
|
import type { MemoryStore } from './store.ts';
|
|
36
36
|
export declare const DEFAULT_CONTRADICTION_THRESHOLD = 0.75;
|
|
37
37
|
export declare const DEFAULT_MAX_PAIRS = 20;
|
|
38
|
-
/** What a judge must answer. Wire it to @
|
|
38
|
+
/** What a judge must answer. Wire it to @tangleai/models `createStructuredOutput`
|
|
39
39
|
* as the `schema` and the repair loop enforces it for free. */
|
|
40
40
|
export declare const CONTRADICTION_VERDICT_SCHEMA: JsonSchema;
|
|
41
41
|
export interface ContradictionVerdict {
|
package/src/contradiction.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* memflow called `llm.invoke()` inline and regex-scraped JSON out of the
|
|
6
6
|
* reply. Here the judge is INJECTED: any async function answering the
|
|
7
7
|
* verdict shape. The intended production judge is two lines of
|
|
8
|
-
* @
|
|
8
|
+
* @tangleai/models — `createStructuredOutput({ client, schema:
|
|
9
9
|
* CONTRADICTION_VERDICT_SCHEMA })` over `contradictionMessages(a, b)` —
|
|
10
10
|
* which buys schema-constrained decoding and the bounded repair loop
|
|
11
11
|
* instead of a regex. The tests inject a table.
|
|
@@ -35,7 +35,7 @@ import { cosineSimilarity } from '@jarenjs/core/vector';
|
|
|
35
35
|
import { createMemoryUnit } from "./ingest.js";
|
|
36
36
|
export const DEFAULT_CONTRADICTION_THRESHOLD = 0.75;
|
|
37
37
|
export const DEFAULT_MAX_PAIRS = 20;
|
|
38
|
-
/** What a judge must answer. Wire it to @
|
|
38
|
+
/** What a judge must answer. Wire it to @tangleai/models `createStructuredOutput`
|
|
39
39
|
* as the `schema` and the repair loop enforces it for free. */
|
|
40
40
|
export const CONTRADICTION_VERDICT_SCHEMA = {
|
|
41
41
|
$id: 'https://tangleai.dev/schemas/contradiction-verdict.json',
|
package/src/crystallize.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* different outcomes.
|
|
34
34
|
*/
|
|
35
35
|
import { cosineSimilarity } from '@jarenjs/core/vector';
|
|
36
|
-
import { sameIdentity } from '@
|
|
36
|
+
import { sameIdentity } from '@tangleai/context/ledger';
|
|
37
37
|
export const DEFAULT_CRYSTALLIZE_THRESHOLD = 0.92;
|
|
38
38
|
export const CONFIDENCE_BOOST = 0.05;
|
|
39
39
|
export const CONFIDENCE_FLOOR = 0.1;
|
package/src/ingest.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Turning raw observations into memory units.
|
|
3
3
|
*
|
|
4
4
|
* Ids are content-addressed — `m-<fnv1a(text)>-<length>` via the same
|
|
5
|
-
* `hashContent` the @
|
|
5
|
+
* `hashContent` the @tangleai/context recall slots use — so ingesting the same
|
|
6
6
|
* observation twice produces the same id and the second write is an
|
|
7
7
|
* overwrite, not a duplicate. Idempotence by construction beats
|
|
8
8
|
* deduplication by policy; the crystallizer then only has to handle
|
package/src/ingest.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Turning raw observations into memory units.
|
|
3
3
|
*
|
|
4
4
|
* Ids are content-addressed — `m-<fnv1a(text)>-<length>` via the same
|
|
5
|
-
* `hashContent` the @
|
|
5
|
+
* `hashContent` the @tangleai/context recall slots use — so ingesting the same
|
|
6
6
|
* observation twice produces the same id and the second write is an
|
|
7
7
|
* overwrite, not a duplicate. Idempotence by construction beats
|
|
8
8
|
* deduplication by policy; the crystallizer then only has to handle
|
package/src/novelty.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Pure: no store, no clock, no log. The caller applies the result.
|
|
22
22
|
*/
|
|
23
23
|
import { cosineSimilarity } from '@jarenjs/core/vector';
|
|
24
|
-
import { sameIdentity } from '@
|
|
24
|
+
import { sameIdentity } from '@tangleai/context/ledger';
|
|
25
25
|
export const DEFAULT_NOVELTY_THRESHOLD = 0.75;
|
|
26
26
|
export function noveltyGate(candidates, existing, options = {}) {
|
|
27
27
|
const threshold = options.threshold ?? DEFAULT_NOVELTY_THRESHOLD;
|
package/src/retrieval.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Embedding-ranked retrieval over memory units.
|
|
3
3
|
*
|
|
4
4
|
* This is Tangle's ranker over its OWN store of full units, beside the
|
|
5
|
-
* @
|
|
5
|
+
* @tangleai/context ledger's `recall({ near })` (which ranks the mirrored
|
|
6
6
|
* ledger records the same way, through the same kernels). Superseded
|
|
7
7
|
* records never surface — they exist for audit, not for recall. Records
|
|
8
8
|
* without embeddings never surface either, which is a real bias (see
|
package/src/retrieval.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Embedding-ranked retrieval over memory units.
|
|
3
3
|
*
|
|
4
4
|
* This is Tangle's ranker over its OWN store of full units, beside the
|
|
5
|
-
* @
|
|
5
|
+
* @tangleai/context ledger's `recall({ near })` (which ranks the mirrored
|
|
6
6
|
* ledger records the same way, through the same kernels). Superseded
|
|
7
7
|
* records never surface — they exist for audit, not for recall. Records
|
|
8
8
|
* without embeddings never surface either, which is a real bias (see
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* the suite ranks by, higher-is-better, 0 for a malformed pair.
|
|
23
23
|
*/
|
|
24
24
|
import { cosineSimilarity } from '@jarenjs/core/vector';
|
|
25
|
-
import { sameIdentity } from '@
|
|
25
|
+
import { sameIdentity } from '@tangleai/context/ledger';
|
|
26
26
|
/**
|
|
27
27
|
* Rank the live, comparably-embedded units against a query vector and
|
|
28
28
|
* report what could not be ranked. `queryEmbedding` may be the
|
package/src/store.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The memory store seam and its default in-memory implementation.
|
|
3
3
|
*
|
|
4
4
|
* The contract is four async methods — `get`, `put`, `delete`, `list` —
|
|
5
|
-
* the same injection shape as the @
|
|
5
|
+
* the same injection shape as the @tangleai/context ledger's storage seam, one
|
|
6
6
|
* level up: this store holds validated memory UNITS, not raw strings.
|
|
7
7
|
* A host backs it with SQLite, OPFS, a graph database, whatever; the
|
|
8
8
|
* policies in this package only ever see the contract.
|
package/src/store.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The memory store seam and its default in-memory implementation.
|
|
3
3
|
*
|
|
4
4
|
* The contract is four async methods — `get`, `put`, `delete`, `list` —
|
|
5
|
-
* the same injection shape as the @
|
|
5
|
+
* the same injection shape as the @tangleai/context ledger's storage seam, one
|
|
6
6
|
* level up: this store holds validated memory UNITS, not raw strings.
|
|
7
7
|
* A host backs it with SQLite, OPFS, a graph database, whatever; the
|
|
8
8
|
* policies in this package only ever see the contract.
|