@framers/agentos 0.3.0 → 0.3.2

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.
Files changed (61) hide show
  1. package/dist/memory/retrieval/store/Brain.d.ts +6 -11
  2. package/dist/memory/retrieval/store/Brain.d.ts.map +1 -1
  3. package/dist/memory/retrieval/store/Brain.js +122 -68
  4. package/dist/memory/retrieval/store/Brain.js.map +1 -1
  5. package/dist/memory/retrieval/store/migrations/MigrationRunner.d.ts +50 -0
  6. package/dist/memory/retrieval/store/migrations/MigrationRunner.d.ts.map +1 -0
  7. package/dist/memory/retrieval/store/migrations/MigrationRunner.js +100 -0
  8. package/dist/memory/retrieval/store/migrations/MigrationRunner.js.map +1 -0
  9. package/dist/memory/retrieval/store/migrations/index.d.ts +20 -0
  10. package/dist/memory/retrieval/store/migrations/index.d.ts.map +1 -0
  11. package/dist/memory/retrieval/store/migrations/index.js +19 -0
  12. package/dist/memory/retrieval/store/migrations/index.js.map +1 -0
  13. package/dist/memory/retrieval/store/migrations/types.d.ts +28 -0
  14. package/dist/memory/retrieval/store/migrations/types.d.ts.map +1 -0
  15. package/dist/memory/retrieval/store/migrations/types.js +7 -0
  16. package/dist/memory/retrieval/store/migrations/types.js.map +1 -0
  17. package/dist/memory/retrieval/store/migrations/v1-to-v2.d.ts +9 -0
  18. package/dist/memory/retrieval/store/migrations/v1-to-v2.d.ts.map +1 -1
  19. package/dist/memory/retrieval/store/migrations/v1-to-v2.js +72 -4
  20. package/dist/memory/retrieval/store/migrations/v1-to-v2.js.map +1 -1
  21. package/dist/memory/retrieval/store/portable-tables.d.ts +27 -0
  22. package/dist/memory/retrieval/store/portable-tables.d.ts.map +1 -0
  23. package/dist/memory/retrieval/store/portable-tables.js +56 -0
  24. package/dist/memory/retrieval/store/portable-tables.js.map +1 -0
  25. package/dist/memory/retrieval/typed-network/FourWayRrf.d.ts +51 -0
  26. package/dist/memory/retrieval/typed-network/FourWayRrf.d.ts.map +1 -0
  27. package/dist/memory/retrieval/typed-network/FourWayRrf.js +47 -0
  28. package/dist/memory/retrieval/typed-network/FourWayRrf.js.map +1 -0
  29. package/dist/memory/retrieval/typed-network/TemporalIntervalOverlap.d.ts +34 -0
  30. package/dist/memory/retrieval/typed-network/TemporalIntervalOverlap.d.ts.map +1 -0
  31. package/dist/memory/retrieval/typed-network/TemporalIntervalOverlap.js +86 -0
  32. package/dist/memory/retrieval/typed-network/TemporalIntervalOverlap.js.map +1 -0
  33. package/dist/memory/retrieval/typed-network/TypedNetworkObserver.d.ts +67 -0
  34. package/dist/memory/retrieval/typed-network/TypedNetworkObserver.d.ts.map +1 -0
  35. package/dist/memory/retrieval/typed-network/TypedNetworkObserver.js +78 -0
  36. package/dist/memory/retrieval/typed-network/TypedNetworkObserver.js.map +1 -0
  37. package/dist/memory/retrieval/typed-network/TypedNetworkStore.d.ts +83 -0
  38. package/dist/memory/retrieval/typed-network/TypedNetworkStore.d.ts.map +1 -0
  39. package/dist/memory/retrieval/typed-network/TypedNetworkStore.js +109 -0
  40. package/dist/memory/retrieval/typed-network/TypedNetworkStore.js.map +1 -0
  41. package/dist/memory/retrieval/typed-network/TypedSpreadingActivation.d.ts +80 -0
  42. package/dist/memory/retrieval/typed-network/TypedSpreadingActivation.d.ts.map +1 -0
  43. package/dist/memory/retrieval/typed-network/TypedSpreadingActivation.js +97 -0
  44. package/dist/memory/retrieval/typed-network/TypedSpreadingActivation.js.map +1 -0
  45. package/dist/memory/retrieval/typed-network/index.d.ts +18 -0
  46. package/dist/memory/retrieval/typed-network/index.d.ts.map +1 -0
  47. package/dist/memory/retrieval/typed-network/index.js +18 -0
  48. package/dist/memory/retrieval/typed-network/index.js.map +1 -0
  49. package/dist/memory/retrieval/typed-network/prompts/extraction-prompt.d.ts +30 -0
  50. package/dist/memory/retrieval/typed-network/prompts/extraction-prompt.d.ts.map +1 -0
  51. package/dist/memory/retrieval/typed-network/prompts/extraction-prompt.js +47 -0
  52. package/dist/memory/retrieval/typed-network/prompts/extraction-prompt.js.map +1 -0
  53. package/dist/memory/retrieval/typed-network/prompts/extraction-schema.d.ts +71 -0
  54. package/dist/memory/retrieval/typed-network/prompts/extraction-schema.d.ts.map +1 -0
  55. package/dist/memory/retrieval/typed-network/prompts/extraction-schema.js +39 -0
  56. package/dist/memory/retrieval/typed-network/prompts/extraction-schema.js.map +1 -0
  57. package/dist/memory/retrieval/typed-network/types.d.ts +123 -0
  58. package/dist/memory/retrieval/typed-network/types.d.ts.map +1 -0
  59. package/dist/memory/retrieval/typed-network/types.js +48 -0
  60. package/dist/memory/retrieval/typed-network/types.js.map +1 -0
  61. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @file extraction-schema.ts
3
+ * @description Zod schema for parsing the LLM's structured-output
4
+ * response in the typed-network extraction pipeline. Mirrors
5
+ * {@link TypedFact} fields but uses snake_case for the LLM API
6
+ * boundary (LLMs tend to emit snake_case more reliably than
7
+ * camelCase). The {@link TypedNetworkObserver} translates from this
8
+ * schema's snake_case shape to the camelCase TypedFact at construction
9
+ * time.
10
+ *
11
+ * @module @framers/agentos/memory/retrieval/typed-network/prompts/extraction-schema
12
+ */
13
+ import { z } from 'zod';
14
+ /**
15
+ * Schema for one extracted fact, matching the LLM's expected output.
16
+ * `confidence` defaults to 1.0 when missing — the schema permits
17
+ * omission for non-Opinion facts where the value is structurally 1.0.
18
+ */
19
+ export declare const TypedExtractionFactSchema: z.ZodObject<{
20
+ text: z.ZodString;
21
+ bank: z.ZodEnum<{
22
+ WORLD: "WORLD";
23
+ EXPERIENCE: "EXPERIENCE";
24
+ OPINION: "OPINION";
25
+ OBSERVATION: "OBSERVATION";
26
+ }>;
27
+ temporal: z.ZodObject<{
28
+ start: z.ZodOptional<z.ZodString>;
29
+ end: z.ZodOptional<z.ZodString>;
30
+ mention: z.ZodString;
31
+ }, z.core.$strip>;
32
+ participants: z.ZodArray<z.ZodObject<{
33
+ name: z.ZodString;
34
+ role: z.ZodString;
35
+ }, z.core.$strip>>;
36
+ reasoning_markers: z.ZodArray<z.ZodString>;
37
+ entities: z.ZodArray<z.ZodString>;
38
+ confidence: z.ZodDefault<z.ZodNumber>;
39
+ }, z.core.$strip>;
40
+ /**
41
+ * Top-level schema. Wraps the fact array under a `facts` key so the
42
+ * LLM has a stable structural anchor to emit against.
43
+ */
44
+ export declare const TypedExtractionSchema: z.ZodObject<{
45
+ facts: z.ZodArray<z.ZodObject<{
46
+ text: z.ZodString;
47
+ bank: z.ZodEnum<{
48
+ WORLD: "WORLD";
49
+ EXPERIENCE: "EXPERIENCE";
50
+ OPINION: "OPINION";
51
+ OBSERVATION: "OBSERVATION";
52
+ }>;
53
+ temporal: z.ZodObject<{
54
+ start: z.ZodOptional<z.ZodString>;
55
+ end: z.ZodOptional<z.ZodString>;
56
+ mention: z.ZodString;
57
+ }, z.core.$strip>;
58
+ participants: z.ZodArray<z.ZodObject<{
59
+ name: z.ZodString;
60
+ role: z.ZodString;
61
+ }, z.core.$strip>>;
62
+ reasoning_markers: z.ZodArray<z.ZodString>;
63
+ entities: z.ZodArray<z.ZodString>;
64
+ confidence: z.ZodDefault<z.ZodNumber>;
65
+ }, z.core.$strip>>;
66
+ }, z.core.$strip>;
67
+ /** TypeScript type inferred from {@link TypedExtractionSchema}. */
68
+ export type TypedExtractionOutput = z.infer<typeof TypedExtractionSchema>;
69
+ /** Per-fact type inferred from {@link TypedExtractionFactSchema}. */
70
+ export type TypedExtractionFact = z.infer<typeof TypedExtractionFactSchema>;
71
+ //# sourceMappingURL=extraction-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction-schema.d.ts","sourceRoot":"","sources":["../../../../../src/memory/retrieval/typed-network/prompts/extraction-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;iBAcpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;iBAEhC,CAAC;AAEH,mEAAmE;AACnE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @file extraction-schema.ts
3
+ * @description Zod schema for parsing the LLM's structured-output
4
+ * response in the typed-network extraction pipeline. Mirrors
5
+ * {@link TypedFact} fields but uses snake_case for the LLM API
6
+ * boundary (LLMs tend to emit snake_case more reliably than
7
+ * camelCase). The {@link TypedNetworkObserver} translates from this
8
+ * schema's snake_case shape to the camelCase TypedFact at construction
9
+ * time.
10
+ *
11
+ * @module @framers/agentos/memory/retrieval/typed-network/prompts/extraction-schema
12
+ */
13
+ import { z } from 'zod';
14
+ /**
15
+ * Schema for one extracted fact, matching the LLM's expected output.
16
+ * `confidence` defaults to 1.0 when missing — the schema permits
17
+ * omission for non-Opinion facts where the value is structurally 1.0.
18
+ */
19
+ export const TypedExtractionFactSchema = z.object({
20
+ text: z.string().min(1),
21
+ bank: z.enum(['WORLD', 'EXPERIENCE', 'OPINION', 'OBSERVATION']),
22
+ temporal: z.object({
23
+ start: z.string().optional(),
24
+ end: z.string().optional(),
25
+ mention: z.string(),
26
+ }),
27
+ participants: z.array(z.object({ name: z.string(), role: z.string() })),
28
+ reasoning_markers: z.array(z.string()),
29
+ entities: z.array(z.string()),
30
+ confidence: z.number().min(0).max(1).default(1.0),
31
+ });
32
+ /**
33
+ * Top-level schema. Wraps the fact array under a `facts` key so the
34
+ * LLM has a stable structural anchor to emit against.
35
+ */
36
+ export const TypedExtractionSchema = z.object({
37
+ facts: z.array(TypedExtractionFactSchema),
38
+ });
39
+ //# sourceMappingURL=extraction-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction-schema.js","sourceRoot":"","sources":["../../../../../src/memory/retrieval/typed-network/prompts/extraction-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAC/D,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC;IACF,YAAY,EAAE,CAAC,CAAC,KAAK,CACnB,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACjD;IACD,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;CAClD,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;CAC1C,CAAC,CAAC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * @file types.ts
3
+ * @description Core types for the Hindsight 4-network typed observer.
4
+ * Each fact lives in one of four typed banks: World (objective external
5
+ * facts), Experience (first-person biographical), Opinion (claims with
6
+ * confidence < 1), Observation (preference-neutral entity summaries).
7
+ *
8
+ * The schema follows Hindsight paper Equation 1
9
+ * (arxiv.org/html/2512.12818v1 §2.1):
10
+ *
11
+ * f = (u, b, t, v, τs, τe, τm, ℓ, c, x)
12
+ *
13
+ * mapped to TypeScript field names below. See spec
14
+ * `packages/agentos-bench/docs/specs/2026-04-26-hindsight-4network-observer-design.md`
15
+ * §2.1-§2.2 for the verbatim definition.
16
+ *
17
+ * @module @framers/agentos/memory/retrieval/typed-network/types
18
+ */
19
+ /**
20
+ * Bank identifier — one of four typed networks per Hindsight §2.2. The
21
+ * bank determines retrieval semantics: World facts compose under
22
+ * objective truth, Experience under first-person continuity, Opinion
23
+ * under belief evolution, Observation under entity descriptions.
24
+ */
25
+ export declare const BANK_IDS: readonly ["WORLD", "EXPERIENCE", "OPINION", "OBSERVATION"];
26
+ /** {@link BANK_IDS} as a TypeScript literal type. */
27
+ export type BankId = (typeof BANK_IDS)[number];
28
+ /**
29
+ * Type guard: narrows an arbitrary string to {@link BankId}. Use to
30
+ * validate untrusted inputs (LLM extraction output, deserialized
31
+ * persistence) before routing into the typed network.
32
+ */
33
+ export declare function isBankId(s: string): s is BankId;
34
+ /**
35
+ * Edge kind in the typed-network graph. Each kind carries a different
36
+ * spreading-activation multiplier μ(ℓ) per Hindsight Eq. 12 (§2.4.1).
37
+ *
38
+ * - **temporal**: connects facts that share an occurrence-interval
39
+ * overlap. Weight derived from `exp(−Δt / σt)`.
40
+ * - **semantic**: connects facts whose embeddings exceed a cosine
41
+ * threshold θs.
42
+ * - **entity**: bidirectional link between facts mentioning the same
43
+ * named entity. Weight 1.0.
44
+ * - **causal**: explicit reasoning marker linking premise → conclusion
45
+ * facts. LLM-extracted at observation time; weight 1.0.
46
+ */
47
+ export declare const EDGE_KINDS: readonly ["temporal", "semantic", "entity", "causal"];
48
+ /** {@link EDGE_KINDS} as a TypeScript literal type. */
49
+ export type EdgeKind = (typeof EDGE_KINDS)[number];
50
+ /**
51
+ * Single named participant in a fact (e.g. "Alice", "the deployment
52
+ * server"). Roles match the participant's grammatical / conversational
53
+ * function — speaker, addressee, subject, object, etc.
54
+ */
55
+ export interface Participant {
56
+ /** Resolved name (after coreference). */
57
+ name: string;
58
+ /** Conversational or semantic role. */
59
+ role: string;
60
+ }
61
+ /**
62
+ * Temporal envelope per Hindsight Eq. 1 fields τs, τe, τm. ISO 8601
63
+ * strings; missing `start` / `end` indicates an instant rather than an
64
+ * interval. `mention` is always populated — it's the timestamp at
65
+ * which the fact was authored.
66
+ */
67
+ export interface FactTemporal {
68
+ /** Interval start (inclusive). ISO 8601. Optional for instant facts. */
69
+ start?: string;
70
+ /** Interval end (inclusive). ISO 8601. Optional for instant facts. */
71
+ end?: string;
72
+ /** Mention timestamp — when the fact was first authored. ISO 8601. */
73
+ mention: string;
74
+ }
75
+ /**
76
+ * A typed fact in the Hindsight memory schema. Carries narrative text,
77
+ * embedding, temporal envelope, participants, reasoning markers,
78
+ * extracted entities, and a confidence score in [0, 1]. Confidence
79
+ * defaults to 1.0 for World/Experience/Observation facts; the Opinion
80
+ * bank stores `(text, confidence, timestamp)` tuples per §2.2.
81
+ */
82
+ export interface TypedFact {
83
+ /** Stable unique identifier. Convention: `<sessionId>-fact-<index>`. */
84
+ id: string;
85
+ /** Bank assignment from the LLM extractor's fact-type classification. */
86
+ bank: BankId;
87
+ /** Narrative text of the fact, post-coreference resolution. */
88
+ text: string;
89
+ /** Embedding vector. Empty until {@link IEmbeddingManager.embed} populates. */
90
+ embedding: number[];
91
+ /** Temporal envelope (occurrence interval + mention timestamp). */
92
+ temporal: FactTemporal;
93
+ /** Named participants and their roles. */
94
+ participants: Participant[];
95
+ /**
96
+ * Verbatim reasoning markers preserved from the source content
97
+ * ("because", "since", "therefore", etc.). Used downstream to
98
+ * extract causal edges.
99
+ */
100
+ reasoningMarkers: string[];
101
+ /** Named entities mentioned in the fact (proper nouns, products, places). */
102
+ entities: string[];
103
+ /** Confidence ∈ [0, 1]. 1.0 for non-Opinion facts; LLM-output for Opinion. */
104
+ confidence: number;
105
+ /** Optional auxiliary metadata (source ID, conversation turn index, etc.). */
106
+ metadata?: Record<string, unknown>;
107
+ }
108
+ /**
109
+ * Typed edge between two facts in the network graph. Direction matters
110
+ * for causal edges (premise → conclusion); other kinds are
111
+ * bidirectional and stored as a pair of edges.
112
+ */
113
+ export interface TypedEdge {
114
+ /** Source fact ID. */
115
+ fromFactId: string;
116
+ /** Target fact ID. */
117
+ toFactId: string;
118
+ /** Edge kind — drives μ(ℓ) multiplier in spreading activation. */
119
+ kind: EdgeKind;
120
+ /** Edge weight. Composed with decay δ and μ(ℓ) at activation time. */
121
+ weight: number;
122
+ }
123
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/memory/retrieval/typed-network/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,4DAA6D,CAAC;AAEnF,qDAAqD;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,MAAM,CAE/C;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,uDAAwD,CAAC;AAChF,uDAAuD;AACvD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,YAAY,CAAC;IACvB,0CAA0C;IAC1C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,IAAI,EAAE,QAAQ,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @file types.ts
3
+ * @description Core types for the Hindsight 4-network typed observer.
4
+ * Each fact lives in one of four typed banks: World (objective external
5
+ * facts), Experience (first-person biographical), Opinion (claims with
6
+ * confidence < 1), Observation (preference-neutral entity summaries).
7
+ *
8
+ * The schema follows Hindsight paper Equation 1
9
+ * (arxiv.org/html/2512.12818v1 §2.1):
10
+ *
11
+ * f = (u, b, t, v, τs, τe, τm, ℓ, c, x)
12
+ *
13
+ * mapped to TypeScript field names below. See spec
14
+ * `packages/agentos-bench/docs/specs/2026-04-26-hindsight-4network-observer-design.md`
15
+ * §2.1-§2.2 for the verbatim definition.
16
+ *
17
+ * @module @framers/agentos/memory/retrieval/typed-network/types
18
+ */
19
+ /**
20
+ * Bank identifier — one of four typed networks per Hindsight §2.2. The
21
+ * bank determines retrieval semantics: World facts compose under
22
+ * objective truth, Experience under first-person continuity, Opinion
23
+ * under belief evolution, Observation under entity descriptions.
24
+ */
25
+ export const BANK_IDS = ['WORLD', 'EXPERIENCE', 'OPINION', 'OBSERVATION'];
26
+ /**
27
+ * Type guard: narrows an arbitrary string to {@link BankId}. Use to
28
+ * validate untrusted inputs (LLM extraction output, deserialized
29
+ * persistence) before routing into the typed network.
30
+ */
31
+ export function isBankId(s) {
32
+ return BANK_IDS.includes(s);
33
+ }
34
+ /**
35
+ * Edge kind in the typed-network graph. Each kind carries a different
36
+ * spreading-activation multiplier μ(ℓ) per Hindsight Eq. 12 (§2.4.1).
37
+ *
38
+ * - **temporal**: connects facts that share an occurrence-interval
39
+ * overlap. Weight derived from `exp(−Δt / σt)`.
40
+ * - **semantic**: connects facts whose embeddings exceed a cosine
41
+ * threshold θs.
42
+ * - **entity**: bidirectional link between facts mentioning the same
43
+ * named entity. Weight 1.0.
44
+ * - **causal**: explicit reasoning marker linking premise → conclusion
45
+ * facts. LLM-extracted at observation time; weight 1.0.
46
+ */
47
+ export const EDGE_KINDS = ['temporal', 'semantic', 'entity', 'causal'];
48
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/memory/retrieval/typed-network/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAU,CAAC;AAKnF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IAChC,OAAQ,QAA8B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Modular AgentOS orchestration library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",