hippo-memory 1.15.0 → 1.17.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.
Files changed (97) hide show
  1. package/README.md +862 -861
  2. package/dist/audit.d.ts +1 -1
  3. package/dist/audit.d.ts.map +1 -1
  4. package/dist/audit.js.map +1 -1
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1244 -3
  7. package/dist/cli.js.map +1 -1
  8. package/dist/customer-notes.d.ts +95 -0
  9. package/dist/customer-notes.d.ts.map +1 -0
  10. package/dist/customer-notes.js +296 -0
  11. package/dist/customer-notes.js.map +1 -0
  12. package/dist/db.d.ts.map +1 -1
  13. package/dist/db.js +731 -1
  14. package/dist/db.js.map +1 -1
  15. package/dist/graph-extract.d.ts +55 -0
  16. package/dist/graph-extract.d.ts.map +1 -0
  17. package/dist/graph-extract.js +259 -0
  18. package/dist/graph-extract.js.map +1 -0
  19. package/dist/graph-recall.d.ts +41 -0
  20. package/dist/graph-recall.d.ts.map +1 -0
  21. package/dist/graph-recall.js +246 -0
  22. package/dist/graph-recall.js.map +1 -0
  23. package/dist/graph.d.ts +137 -0
  24. package/dist/graph.d.ts.map +1 -0
  25. package/dist/graph.js +433 -0
  26. package/dist/graph.js.map +1 -0
  27. package/dist/incidents.d.ts +100 -0
  28. package/dist/incidents.d.ts.map +1 -0
  29. package/dist/incidents.js +322 -0
  30. package/dist/incidents.js.map +1 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +1 -0
  34. package/dist/index.js.map +1 -1
  35. package/dist/memory.d.ts +6 -0
  36. package/dist/memory.d.ts.map +1 -1
  37. package/dist/memory.js +6 -0
  38. package/dist/memory.js.map +1 -1
  39. package/dist/policies.d.ts +149 -0
  40. package/dist/policies.d.ts.map +1 -0
  41. package/dist/policies.js +380 -0
  42. package/dist/policies.js.map +1 -0
  43. package/dist/processes.d.ts +104 -0
  44. package/dist/processes.d.ts.map +1 -0
  45. package/dist/processes.js +330 -0
  46. package/dist/processes.js.map +1 -0
  47. package/dist/project-briefs.d.ts +126 -0
  48. package/dist/project-briefs.d.ts.map +1 -0
  49. package/dist/project-briefs.js +453 -0
  50. package/dist/project-briefs.js.map +1 -0
  51. package/dist/search.d.ts +7 -0
  52. package/dist/search.d.ts.map +1 -1
  53. package/dist/search.js.map +1 -1
  54. package/dist/server.d.ts.map +1 -1
  55. package/dist/server.js +1028 -16
  56. package/dist/server.js.map +1 -1
  57. package/dist/skills.d.ts +98 -0
  58. package/dist/skills.d.ts.map +1 -0
  59. package/dist/skills.js +339 -0
  60. package/dist/skills.js.map +1 -0
  61. package/dist/src/audit.js.map +1 -1
  62. package/dist/src/cli.js +1244 -3
  63. package/dist/src/cli.js.map +1 -1
  64. package/dist/src/customer-notes.js +296 -0
  65. package/dist/src/customer-notes.js.map +1 -0
  66. package/dist/src/db.js +731 -1
  67. package/dist/src/db.js.map +1 -1
  68. package/dist/src/graph-extract.js +259 -0
  69. package/dist/src/graph-extract.js.map +1 -0
  70. package/dist/src/graph-recall.js +246 -0
  71. package/dist/src/graph-recall.js.map +1 -0
  72. package/dist/src/graph.js +433 -0
  73. package/dist/src/graph.js.map +1 -0
  74. package/dist/src/incidents.js +322 -0
  75. package/dist/src/incidents.js.map +1 -0
  76. package/dist/src/index.js +1 -0
  77. package/dist/src/index.js.map +1 -1
  78. package/dist/src/memory.js +6 -0
  79. package/dist/src/memory.js.map +1 -1
  80. package/dist/src/policies.js +380 -0
  81. package/dist/src/policies.js.map +1 -0
  82. package/dist/src/processes.js +330 -0
  83. package/dist/src/processes.js.map +1 -0
  84. package/dist/src/project-briefs.js +453 -0
  85. package/dist/src/project-briefs.js.map +1 -0
  86. package/dist/src/search.js.map +1 -1
  87. package/dist/src/server.js +1028 -16
  88. package/dist/src/server.js.map +1 -1
  89. package/dist/src/skills.js +339 -0
  90. package/dist/src/skills.js.map +1 -0
  91. package/dist/src/version.js +1 -1
  92. package/dist/version.d.ts +1 -1
  93. package/dist/version.js +1 -1
  94. package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
  95. package/extensions/openclaw-plugin/package.json +1 -1
  96. package/openclaw.plugin.json +1 -1
  97. package/package.json +2 -2
@@ -0,0 +1,246 @@
1
+ /**
2
+ * E3.2 multi-hop graph recall (docs/plans/2026-06-02-e3.2-multihop-recall.md).
3
+ *
4
+ * READ-ONLY consumer of the E3 graph substrate (entities/relations built by E3.1,
5
+ * guarded by E3.3). Given the lexical recall seeds, walk the relations graph up to N
6
+ * hops and surface the memories of reached entities that the lexical search did not
7
+ * already return.
8
+ *
9
+ * Relation-type-AGNOSTIC: it walks whatever edges exist. Today the graph holds only
10
+ * `supersedes` edges (so a 1-hop walk surfaces a supersession-linked predecessor/
11
+ * successor a lexical search may miss); the moment E3.1 emits cross-object edges
12
+ * (owns/depends-on/blocked-by/references) the SAME traversal lights up cross-entity
13
+ * multi-hop with zero rework here.
14
+ *
15
+ * Design points (the first two were forced by the verify-stage benchmark, the rest by
16
+ * codex review — all root-cause, not patches):
17
+ * 1. Graph-reached memories are loaded DIRECTLY by id (tenant-scoped PK fetch), NOT
18
+ * intersected with the recall handler's candidate set — that set is lexically
19
+ * prefiltered (loadSearchRows filters by query tokens), so intersecting would exclude
20
+ * exactly the lexically-orthogonal neighbours graph recall exists to surface. We
21
+ * re-apply the recall HARD filters to the directly-loaded rows: the FULL bi-temporal
22
+ * as-of rule (valid_from <= asOf AND, for a superseded row, successor.valid_from >
23
+ * asOf — same as cmdRecall) and the default superseded-drop. SCOPE is intentionally
24
+ * NOT re-applied: the CLI caller (cmdRecall) does not hard-filter scope either (it
25
+ * only soft-boosts it). Rows are tenant-scoped + archived-excluded (loadEntriesByIds).
26
+ * 2. A graph hit inherits its origin seed's relevance (minus a per-hop discount) and is
27
+ * placed adjacent to that seed; budget selection is by score so a high-value hit wins
28
+ * a token slot over a noise distractor. Dead-last appending made the feature do
29
+ * nothing at realistic budgets.
30
+ * 3. BOTH the local and global stores are expanded — a global seed's entities/relations
31
+ * live under the global root, so graph recall must traverse each seed in the store its
32
+ * graph lives in (codex review).
33
+ * 4. By-id loads are chunked at 500 (loadEntriesByIds caps at 500/call), so a high-fanout
34
+ * traversal (--hops 3 --max-neighbors 200 -> up to 600 ids) loses none (codex review).
35
+ *
36
+ * No graph writes (only SELECTs via graph.ts read helpers + store reads), so the E3.3
37
+ * check-graph-writes lint permits this module living outside graph.ts.
38
+ */
39
+ import { loadEntriesByIds } from './store.js';
40
+ import { estimateTokens } from './search.js';
41
+ import { loadEntitiesByMemoryId, loadEntitiesByIds, loadNeighborRelations, } from './graph.js';
42
+ /** Hard cap on `--hops` (a higher value just walks more of a finite graph; this bounds
43
+ * worst-case work and keeps the flag honest). */
44
+ export const MAX_HOPS = 3;
45
+ /** Default per-hop fanout cap (bounds blow-up on a future dense graph). */
46
+ export const DEFAULT_MAX_NEIGHBORS = 25;
47
+ /** Per-hop relevance discount: a graph hit inherits its origin seed's score, scaled down
48
+ * 1% per hop, so it ranks just below its seed and orders by hop-distance. */
49
+ const HOP_DISCOUNT = 0.01;
50
+ /** loadEntriesByIds caps each call at 500 ids; chunk to lose none on high fanout. */
51
+ const LOAD_CHUNK = 500;
52
+ /** Load memories by id in <=500-id chunks (loadEntriesByIds caps each call at 500). */
53
+ function loadByIdsChunked(root, tenantId, ids) {
54
+ if (ids.length === 0)
55
+ return [];
56
+ const out = [];
57
+ for (let i = 0; i < ids.length; i += LOAD_CHUNK) {
58
+ out.push(...loadEntriesByIds(root, ids.slice(i, i + LOAD_CHUNK), tenantId));
59
+ }
60
+ return out;
61
+ }
62
+ /**
63
+ * Traverse one store's graph from the seeds present in it and accumulate new graph hits
64
+ * into `hitsByOrigin`. Mutates `seenMemoryIds` so a memory is surfaced at most once across
65
+ * stores. Pure reads.
66
+ */
67
+ function produceHitsForRoot(root, baseResults, baseScoreByMemId, seenMemoryIds, hitsByOrigin, opts) {
68
+ const { hops, maxNeighbors, tenantId, includeSuperseded, asOfDate } = opts;
69
+ // Seeds = graph entities (in THIS store) whose source memory is a base result.
70
+ const seedEntities = loadEntitiesByMemoryId(root, tenantId, baseResults.map((r) => r.entry.id));
71
+ if (seedEntities.length === 0)
72
+ return;
73
+ // BFS, both directions, up to `hops`. `visited` prevents re-expansion (cycle-safe).
74
+ // `originMemByEntityId` propagates the base-result memory id each reached node descends
75
+ // from (for adjacency placement + score inheritance).
76
+ const visitedEntityIds = new Set(seedEntities.map((e) => e.id));
77
+ const reached = new Map();
78
+ const originMemByEntityId = new Map();
79
+ for (const se of seedEntities)
80
+ originMemByEntityId.set(se.id, se.memoryId);
81
+ let frontier = seedEntities.map((e) => e.id);
82
+ for (let depth = 1; depth <= hops && frontier.length > 0; depth++) {
83
+ const frontierSet = new Set(frontier);
84
+ const rels = loadNeighborRelations(root, tenantId, frontier, {
85
+ limit: Math.max(maxNeighbors, maxNeighbors * frontier.length),
86
+ });
87
+ const nextFrontier = [];
88
+ for (const rel of rels) {
89
+ const fromIn = frontierSet.has(rel.fromEntityId);
90
+ const toIn = frontierSet.has(rel.toEntityId);
91
+ let neighborId;
92
+ let reacherId;
93
+ let direction;
94
+ if (fromIn && !toIn) {
95
+ neighborId = rel.toEntityId;
96
+ reacherId = rel.fromEntityId;
97
+ direction = 'to';
98
+ }
99
+ else if (toIn && !fromIn) {
100
+ neighborId = rel.fromEntityId;
101
+ reacherId = rel.toEntityId;
102
+ direction = 'from';
103
+ }
104
+ else
105
+ continue;
106
+ if (visitedEntityIds.has(neighborId))
107
+ continue;
108
+ visitedEntityIds.add(neighborId);
109
+ reached.set(neighborId, { hops: depth, relType: rel.relType, direction });
110
+ const origin = originMemByEntityId.get(reacherId);
111
+ if (origin !== undefined)
112
+ originMemByEntityId.set(neighborId, origin);
113
+ nextFrontier.push(neighborId);
114
+ if (nextFrontier.length >= maxNeighbors)
115
+ break; // per-hop fanout cap
116
+ }
117
+ frontier = nextFrontier;
118
+ }
119
+ if (reached.size === 0)
120
+ return;
121
+ // Reached entities -> source memory ids -> load DIRECTLY by id (chunked), not lexical.
122
+ const reachedEntities = loadEntitiesByIds(root, tenantId, [...reached.keys()]);
123
+ const needLoad = [...new Set(reachedEntities.map((e) => e.memoryId).filter((id) => !seenMemoryIds.has(id)))];
124
+ const loadedById = new Map(loadByIdsChunked(root, tenantId, needLoad).map((m) => [m.id, m]));
125
+ // For the bi-temporal as-of rule on a superseded reached row we need its successor's
126
+ // valid_from. Batch-load the successors referenced by the loaded rows.
127
+ let successorValidFrom = new Map();
128
+ if (asOfDate) {
129
+ const succIds = [...new Set([...loadedById.values()].map((m) => m.superseded_by).filter((id) => !!id))];
130
+ successorValidFrom = new Map(loadByIdsChunked(root, tenantId, succIds).map((m) => [m.id, m.valid_from]));
131
+ }
132
+ for (const ent of reachedEntities) {
133
+ const mem = loadedById.get(ent.memoryId);
134
+ if (!mem)
135
+ continue; // not found / wrong tenant / already in base
136
+ if (seenMemoryIds.has(mem.id))
137
+ continue; // another reached entity already added it
138
+ const via = reached.get(ent.id);
139
+ // A node reached as the `to` endpoint of a `supersedes` edge IS the superseded
140
+ // (older) version — the graph is the authoritative signal (the memory mirror's
141
+ // `superseded_by` is NOT set by `hippo decide`, only the decisions table is). By
142
+ // default recall shows current truth, so drop it unless --include-superseded; the
143
+ // `from` endpoint (the newer successor) is always kept.
144
+ const isSupersededEndpoint = via.relType === 'supersedes' && via.direction === 'to';
145
+ if (asOfDate) {
146
+ if (new Date(mem.valid_from) > asOfDate)
147
+ continue; // not yet valid at asOf
148
+ if (mem.superseded_by) {
149
+ const succVf = successorValidFrom.get(mem.superseded_by);
150
+ // Visible only while its successor was NOT yet valid at asOf (matches cmdRecall).
151
+ if (succVf && new Date(succVf) <= asOfDate)
152
+ continue;
153
+ }
154
+ }
155
+ else if (!includeSuperseded && (mem.superseded_by || isSupersededEndpoint)) {
156
+ continue; // default recall drops superseded
157
+ }
158
+ const origin = originMemByEntityId.get(ent.id) ?? baseResults[0].entry.id;
159
+ const originScore = baseScoreByMemId.get(origin) ?? baseResults[baseResults.length - 1].score;
160
+ seenMemoryIds.add(mem.id);
161
+ const hit = {
162
+ entry: mem,
163
+ score: originScore * (1 - HOP_DISCOUNT * via.hops),
164
+ bm25: 0, cosine: 0,
165
+ tokens: estimateTokens(mem.content),
166
+ graphVia: via,
167
+ };
168
+ if (!hitsByOrigin.has(origin))
169
+ hitsByOrigin.set(origin, []);
170
+ hitsByOrigin.get(origin).push(hit);
171
+ }
172
+ }
173
+ /**
174
+ * Augment `baseResults` with memories reached by walking the graph `hops` edges out from
175
+ * the seed results' entities (across the local AND global stores). Each graph hit is
176
+ * inserted directly after the base result it descends from, scored just below that seed;
177
+ * the base list's own order is preserved. Token-budget-bounded; deduped against the base
178
+ * set and across stores.
179
+ *
180
+ * No-op (returns `baseResults` unchanged) when `hops <= 0`, there are no base results, the
181
+ * graph is empty, no seed maps to an entity, or nothing new survives the filters/budget.
182
+ */
183
+ export function graphExpandRecall(baseResults, opts) {
184
+ const { hops, hippoRoot, globalRoot, tenantId } = opts;
185
+ if (hops <= 0 || baseResults.length === 0)
186
+ return baseResults;
187
+ const maxNeighbors = opts.maxNeighbors ?? DEFAULT_MAX_NEIGHBORS;
188
+ const budget = opts.budget ?? 4000;
189
+ const includeSuperseded = opts.includeSuperseded ?? false;
190
+ const asOfDate = opts.asOf ? new Date(opts.asOf) : null;
191
+ const minResults = opts.minResults ?? 1;
192
+ const baseScoreByMemId = new Map(baseResults.map((r) => [r.entry.id, r.score]));
193
+ const seenMemoryIds = new Set(baseResults.map((r) => r.entry.id));
194
+ const hitsByOrigin = new Map();
195
+ // Expand against each distinct store the seeds may live in (local + global).
196
+ const roots = globalRoot && globalRoot !== hippoRoot ? [hippoRoot, globalRoot] : [hippoRoot];
197
+ for (const root of roots) {
198
+ produceHitsForRoot(root, baseResults, baseScoreByMemId, seenMemoryIds, hitsByOrigin, {
199
+ hops, maxNeighbors, tenantId, includeSuperseded, asOfDate,
200
+ });
201
+ }
202
+ if (hitsByOrigin.size === 0)
203
+ return baseResults;
204
+ // Closer hops first within each origin group, then by inherited score.
205
+ for (const hits of hitsByOrigin.values()) {
206
+ hits.sort((a, b) => a.graphVia.hops - b.graphVia.hops || b.score - a.score);
207
+ }
208
+ const allHits = [...hitsByOrigin.values()].flat();
209
+ // Budget SELECTION by score (not by position): a high-value graph hit (it inherits its
210
+ // origin seed's relevance) must be able to win a token slot over a low-score lexical
211
+ // distractor — otherwise a tight --budget keeps the noise and drops the memory --hops
212
+ // surfaced. The greedy pack uses `continue` (not `break`), so a hit's origin seed is
213
+ // NOT guaranteed kept just because the hit is; the DISPLAY loop guards that (a hit is
214
+ // emitted ONLY under a kept seed, never orphaned). At least one result is always kept.
215
+ // (NOTE: at a tight budget a new graph hit can displace a weakly-scored base result;
216
+ // aggregate recall stays >= baseline, the displaced item is the lowest-value one.)
217
+ // Protect the top --min-results base rows from eviction (graph expansion must not
218
+ // violate the recall min-results floor; codex P2). They are kept regardless of budget;
219
+ // baseResults is score-ordered, so slice(0, N) is the top N.
220
+ const protectedCount = Math.min(Math.max(minResults, 1), baseResults.length);
221
+ const keep = new Set(baseResults.slice(0, protectedCount));
222
+ let usedTokens = [...keep].reduce((s, r) => s + r.tokens, 0);
223
+ for (const r of [...baseResults.slice(protectedCount), ...allHits].sort((a, b) => b.score - a.score)) {
224
+ if (usedTokens + r.tokens > budget)
225
+ continue;
226
+ usedTokens += r.tokens;
227
+ keep.add(r);
228
+ }
229
+ // DISPLAY order: base order preserved (it may be MMR-diversified); each kept new hit
230
+ // placed directly after the seed it descends from. Hits emit ONLY under a kept seed.
231
+ const merged = [];
232
+ let emittedHit = false;
233
+ for (const r of baseResults) {
234
+ if (!keep.has(r))
235
+ continue;
236
+ merged.push(r);
237
+ for (const hit of hitsByOrigin.get(r.entry.id) ?? []) {
238
+ if (keep.has(hit)) {
239
+ merged.push(hit);
240
+ emittedHit = true;
241
+ }
242
+ }
243
+ }
244
+ return emittedHit ? merged : baseResults; // nothing new survived budget -> original base
245
+ }
246
+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AAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACrD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAAC,UAAU,GAAG,IAAI,CAAC;YAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,+CAA+C;AAC3F,CAAC"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * E3.3 graph layer over consolidated state - the graph-on-consolidated guard.
3
+ * (docs/plans/2026-06-01-e3-graph-guard.md).
4
+ *
5
+ * A graph of canonical `entities` (person/project/customer/system/policy/decision) and
6
+ * `relations` (owns/supersedes/depends-on/blocked-by/references) sits ON TOP OF
7
+ * consolidated memories. The hard rule: the graph NEVER indexes the raw layer - every
8
+ * entity and relation references a memory whose `kind IN ('distilled','superseded')`,
9
+ * never `kind='raw'`. Enforced at the DB level (CHECK on source_kind/kind + BEFORE
10
+ * INSERT and BEFORE UPDATE triggers that tie source_kind/kind to the FK'd memory's
11
+ * actual kind and enforce tenant-match - relations also reject cross-tenant edges), so
12
+ * the forbidden state is unrepresentable regardless of code path. These helpers
13
+ * surface the same guard as clear throws BEFORE hitting the trigger backstop.
14
+ *
15
+ * Scope (E3.3 first slice): the substrate + the guard + a thin insert/load/enqueue
16
+ * API. The `graph_extraction_queue` is the interface the deferred `hippo sleep`
17
+ * enqueue-hook + E3.1 entity extraction will call. No operator surface (CLI/HTTP/SDK)
18
+ * until E3.2 multi-hop recall.
19
+ */
20
+ export type EntityType = 'person' | 'project' | 'customer' | 'system' | 'policy' | 'decision';
21
+ export type RelationType = 'owns' | 'supersedes' | 'depends-on' | 'blocked-by' | 'references';
22
+ export type GraphQueueStatus = 'pending' | 'processed' | 'skipped';
23
+ /** The consolidated source kinds the graph is permitted to index (never 'raw'). */
24
+ export type SourceKind = 'distilled' | 'superseded';
25
+ export declare const GRAPH_ENTITY_TYPES: ReadonlySet<EntityType>;
26
+ export declare const GRAPH_RELATION_TYPES: ReadonlySet<RelationType>;
27
+ export declare const VALID_QUEUE_STATES: ReadonlySet<GraphQueueStatus>;
28
+ export declare const MAX_ENTITY_NAME_LEN = 512;
29
+ export interface Entity {
30
+ id: number;
31
+ tenantId: string;
32
+ entityType: EntityType;
33
+ name: string;
34
+ /** The consolidated source memory this entity was extracted from. */
35
+ memoryId: string;
36
+ sourceKind: SourceKind;
37
+ createdAt: string;
38
+ }
39
+ export interface Relation {
40
+ id: number;
41
+ tenantId: string;
42
+ fromEntityId: number;
43
+ toEntityId: number;
44
+ relType: RelationType;
45
+ memoryId: string;
46
+ sourceKind: SourceKind;
47
+ createdAt: string;
48
+ }
49
+ export interface GraphQueueItem {
50
+ id: number;
51
+ tenantId: string;
52
+ memoryId: string;
53
+ kind: SourceKind;
54
+ status: GraphQueueStatus;
55
+ enqueuedAt: string;
56
+ processedAt: string | null;
57
+ }
58
+ export interface InsertEntityOpts {
59
+ entityType: EntityType;
60
+ name: string;
61
+ /** A consolidated (distilled/superseded) memory; raw is rejected. */
62
+ memoryId: string;
63
+ }
64
+ export interface InsertRelationOpts {
65
+ fromEntityId: number;
66
+ toEntityId: number;
67
+ relType: RelationType;
68
+ /** A consolidated (distilled/superseded) memory; raw is rejected. */
69
+ memoryId: string;
70
+ }
71
+ /**
72
+ * Insert a graph entity extracted from a consolidated memory. Throws if the source
73
+ * memory is missing / cross-tenant / raw (the DB trigger is the backstop).
74
+ */
75
+ export declare function insertEntity(hippoRoot: string, tenantId: string, opts: InsertEntityOpts): Entity;
76
+ /**
77
+ * Insert a graph relation between two entities, sourced from a consolidated memory.
78
+ * Both entities must exist in the same tenant; the source memory must be consolidated.
79
+ */
80
+ export declare function insertRelation(hippoRoot: string, tenantId: string, opts: InsertRelationOpts): Relation;
81
+ export declare function loadEntityById(hippoRoot: string, tenantId: string, id: number): Entity | null;
82
+ export declare function loadEntities(hippoRoot: string, tenantId: string, opts?: {
83
+ entityType?: EntityType;
84
+ limit?: number;
85
+ }): Entity[];
86
+ export declare function loadRelations(hippoRoot: string, tenantId: string, opts?: {
87
+ fromEntityId?: number;
88
+ limit?: number;
89
+ }): Relation[];
90
+ /**
91
+ * Map consolidated source memory ids -> their graph entities. The SEED step of E3.2
92
+ * multi-hop recall (recall result memory ids -> entities to traverse from). Tenant-
93
+ * scoped, read-only; chunks the IN-list under the SQLite variable cap.
94
+ */
95
+ export declare function loadEntitiesByMemoryId(hippoRoot: string, tenantId: string, memoryIds: string[]): Entity[];
96
+ /**
97
+ * Load entities by their primary ids. Resolves the entity rows reached during the BFS
98
+ * (whose `memory_id` maps back to a recall result). Tenant-scoped, read-only.
99
+ */
100
+ export declare function loadEntitiesByIds(hippoRoot: string, tenantId: string, ids: number[]): Entity[];
101
+ /**
102
+ * All relations touching ANY of `entityIds` in EITHER direction (from OR to) — the
103
+ * per-hop neighbour query for E3.2 multi-hop traversal. ONE query for the whole frontier
104
+ * (not one per node): this is the bidirectional read `loadRelations` (from-only) lacks,
105
+ * and avoids an N+1 across BFS frontier nodes. `limit` caps rows for the frontier and
106
+ * must be a non-negative integer (the raw `LIMIT ?` rejects a fractional value).
107
+ */
108
+ export declare function loadNeighborRelations(hippoRoot: string, tenantId: string, entityIds: number[], opts?: {
109
+ limit?: number;
110
+ }): Relation[];
111
+ /**
112
+ * Enqueue a consolidated memory for later graph extraction. Rejects a raw / missing /
113
+ * cross-tenant memory (the DB trigger is the backstop). The producer hook in
114
+ * `hippo sleep` is deferred (E3.1); this is the API it will call.
115
+ */
116
+ export declare function enqueueExtraction(hippoRoot: string, tenantId: string, memoryId: string): GraphQueueItem;
117
+ export declare function loadExtractionQueue(hippoRoot: string, tenantId: string, opts?: {
118
+ status?: GraphQueueStatus;
119
+ limit?: number;
120
+ }): GraphQueueItem[];
121
+ /**
122
+ * Mark a queue item terminal (processed | skipped). Only `status`/`processed_at`
123
+ * change, so the consolidated-source guard trigger (which fires on
124
+ * memory_id/kind/tenant_id changes) is not involved. CAS on the current status to a
125
+ * non-terminal 'pending'.
126
+ */
127
+ export declare function markExtractionProcessed(hippoRoot: string, tenantId: string, id: number, status?: 'processed' | 'skipped'): GraphQueueItem;
128
+ /**
129
+ * Delete ALL entities for a tenant (relations cascade via the from/to FKs). Returns
130
+ * the number of entities deleted. The rebuild primitive for graph extraction: the
131
+ * deterministic graph is a pure derived function of the consolidated objects, so an
132
+ * extract clears then re-derives. Lives in graph.ts (the sole sanctioned graph
133
+ * writer), so the E3.3 CI lint permits this `DELETE FROM entities`. Does NOT touch
134
+ * graph_extraction_queue (the enqueue-hook's domain).
135
+ */
136
+ export declare function clearGraph(hippoRoot: string, tenantId: string): number;
137
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC9F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAC9F,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AACnE,mFAAmF;AACnF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAEpD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,UAAU,CAErD,CAAC;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,YAAY,CAEzD,CAAC;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,gBAAgB,CAE3D,CAAC;AAEH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM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