mindgraph 0.1.1 → 0.1.7
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 +35 -1
- package/dist/index.d.mts +312 -82
- package/dist/index.d.ts +312 -82
- package/dist/index.js +228 -22
- package/dist/index.mjs +228 -22
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ new MindGraph({ baseUrl: string, apiKey?: string, jwt?: string })
|
|
|
50
50
|
|
|
51
51
|
| Method | Description |
|
|
52
52
|
|--------|-------------|
|
|
53
|
-
| `
|
|
53
|
+
| `capture(req)` | Capture a source, snippet, or observation |
|
|
54
54
|
| `entity(req)` | Create, alias, resolve, or merge entities |
|
|
55
55
|
| `findOrCreateEntity(label, entityType?, agentId?)` | Convenience: create or find an entity by label |
|
|
56
56
|
|
|
@@ -81,6 +81,7 @@ new MindGraph({ baseUrl: string, apiKey?: string, jwt?: string })
|
|
|
81
81
|
| Method | Description |
|
|
82
82
|
|--------|-------------|
|
|
83
83
|
| `session(req)` | Open a session, record traces, or close a session |
|
|
84
|
+
| `journal(label, props, options?)` | Record a journal entry linked to an optional session |
|
|
84
85
|
| `distill(req)` | Create a summary that distills multiple source nodes |
|
|
85
86
|
| `memoryConfig(req)` | Set/get preferences and memory policies |
|
|
86
87
|
|
|
@@ -117,6 +118,24 @@ new MindGraph({ baseUrl: string, apiKey?: string, jwt?: string })
|
|
|
117
118
|
| `reasoningChain(uid, maxDepth?)` | Follow epistemic edges from a node |
|
|
118
119
|
| `neighborhood(uid, maxDepth?)` | Get all nodes within N hops |
|
|
119
120
|
|
|
121
|
+
### Ingestion & Retrieval
|
|
122
|
+
|
|
123
|
+
| Method | Description |
|
|
124
|
+
|--------|-------------|
|
|
125
|
+
| `ingestChunk(req)` | Ingest a single text chunk (sync): stores, embeds, and runs LLM extraction |
|
|
126
|
+
| `ingestDocument(req)` | Ingest a full document (async): chunks text, returns job ID |
|
|
127
|
+
| `ingestSession(req)` | Ingest a session transcript (async): links to session, returns job ID |
|
|
128
|
+
| `retrieveContext(req)` | Retrieve semantically matched chunks + connected graph nodes/edges |
|
|
129
|
+
| `getJob(id)` | Get async job status and progress |
|
|
130
|
+
| `clearGraph()` | Clear all graph data |
|
|
131
|
+
|
|
132
|
+
### Lifecycle Shortcuts
|
|
133
|
+
|
|
134
|
+
| Method | Description |
|
|
135
|
+
|--------|-------------|
|
|
136
|
+
| `tombstone(uid, reason?, agentId?)` | Soft-delete a node |
|
|
137
|
+
| `restore(uid, agentId?)` | Restore a tombstoned node |
|
|
138
|
+
|
|
120
139
|
### Cross-cutting
|
|
121
140
|
|
|
122
141
|
| Method | Description |
|
|
@@ -132,6 +151,21 @@ new MindGraph({ baseUrl: string, apiKey?: string, jwt?: string })
|
|
|
132
151
|
| `health()` | Health check |
|
|
133
152
|
| `stats()` | Graph-wide statistics |
|
|
134
153
|
|
|
154
|
+
### Management (Cloud only)
|
|
155
|
+
|
|
156
|
+
| Method | Description |
|
|
157
|
+
|--------|-------------|
|
|
158
|
+
| `signup(email, password)` | Create a new account |
|
|
159
|
+
| `login(email, password)` | Login and receive JWT |
|
|
160
|
+
| `createApiKey(name?)` | Create an API key |
|
|
161
|
+
| `listApiKeys()` | List all API keys |
|
|
162
|
+
| `revokeApiKey(id)` | Revoke an API key |
|
|
163
|
+
| `getUsage()` | Get usage statistics |
|
|
164
|
+
|
|
165
|
+
## Examples
|
|
166
|
+
|
|
167
|
+
See [`examples/`](examples/) for runnable demos, including a [research continuity](examples/research-continuity.ts) scenario showing cross-session memory retrieval.
|
|
168
|
+
|
|
135
169
|
## Error Handling
|
|
136
170
|
|
|
137
171
|
All methods throw `MindGraphError` on HTTP errors:
|
package/dist/index.d.mts
CHANGED
|
@@ -38,14 +38,11 @@ interface PathStep {
|
|
|
38
38
|
depth: number;
|
|
39
39
|
parent_uid: string | null;
|
|
40
40
|
}
|
|
41
|
-
interface
|
|
41
|
+
interface CaptureRequest {
|
|
42
42
|
action: "source" | "snippet" | "observation";
|
|
43
43
|
label: string;
|
|
44
|
-
|
|
44
|
+
summary?: string;
|
|
45
45
|
source_uid?: string;
|
|
46
|
-
medium?: string;
|
|
47
|
-
url?: string;
|
|
48
|
-
timestamp?: number;
|
|
49
46
|
confidence?: number;
|
|
50
47
|
salience?: number;
|
|
51
48
|
props?: Record<string, unknown>;
|
|
@@ -54,7 +51,6 @@ interface IngestRequest {
|
|
|
54
51
|
interface EntityRequest {
|
|
55
52
|
action: "create" | "alias" | "resolve" | "fuzzy_resolve" | "merge" | "relate";
|
|
56
53
|
label?: string;
|
|
57
|
-
entity_type?: string;
|
|
58
54
|
text?: string;
|
|
59
55
|
canonical_uid?: string;
|
|
60
56
|
alias_score?: number;
|
|
@@ -64,29 +60,31 @@ interface EntityRequest {
|
|
|
64
60
|
source_uid?: string;
|
|
65
61
|
target_uid?: string;
|
|
66
62
|
edge_type?: string;
|
|
63
|
+
props?: Record<string, unknown>;
|
|
67
64
|
agent_id?: string;
|
|
68
65
|
}
|
|
69
66
|
interface ArgumentRequest {
|
|
70
67
|
claim: {
|
|
71
68
|
label: string;
|
|
72
|
-
content: string;
|
|
73
69
|
confidence?: number;
|
|
70
|
+
props?: Record<string, unknown>;
|
|
74
71
|
};
|
|
75
72
|
evidence?: {
|
|
76
73
|
label: string;
|
|
77
|
-
|
|
78
|
-
evidence_type?: string;
|
|
74
|
+
props?: Record<string, unknown>;
|
|
79
75
|
}[];
|
|
80
76
|
warrant?: {
|
|
81
77
|
label: string;
|
|
82
|
-
|
|
78
|
+
props?: Record<string, unknown>;
|
|
83
79
|
};
|
|
84
80
|
argument?: {
|
|
85
81
|
label: string;
|
|
86
|
-
|
|
82
|
+
props?: Record<string, unknown>;
|
|
87
83
|
};
|
|
88
84
|
refutes_uid?: string;
|
|
89
85
|
extends_uid?: string;
|
|
86
|
+
supersedes_uid?: string;
|
|
87
|
+
contradicts_uid?: string;
|
|
90
88
|
source_uids?: string[];
|
|
91
89
|
props?: Record<string, unknown>;
|
|
92
90
|
agent_id?: string;
|
|
@@ -94,12 +92,13 @@ interface ArgumentRequest {
|
|
|
94
92
|
interface InquiryRequest {
|
|
95
93
|
action: "hypothesis" | "theory" | "paradigm" | "anomaly" | "assumption" | "question" | "open_question";
|
|
96
94
|
label: string;
|
|
97
|
-
|
|
98
|
-
status?: string;
|
|
95
|
+
summary?: string;
|
|
99
96
|
anomalous_to_uid?: string;
|
|
100
97
|
assumes_uid?: string[];
|
|
101
98
|
tests_uid?: string;
|
|
102
99
|
addresses_uid?: string;
|
|
100
|
+
supersedes_uid?: string;
|
|
101
|
+
produces_uid?: string;
|
|
103
102
|
confidence?: number;
|
|
104
103
|
salience?: number;
|
|
105
104
|
related_uids?: string[];
|
|
@@ -109,7 +108,6 @@ interface InquiryRequest {
|
|
|
109
108
|
interface StructureRequest {
|
|
110
109
|
action: "concept" | "pattern" | "mechanism" | "model" | "model_evaluation" | "analogy" | "inference_chain" | "reasoning_strategy" | "sensitivity_analysis" | "theorem" | "equation" | "method" | "experiment";
|
|
111
110
|
label: string;
|
|
112
|
-
content: string;
|
|
113
111
|
summary?: string;
|
|
114
112
|
analogous_to_uid?: string;
|
|
115
113
|
transfers_to_uid?: string[];
|
|
@@ -118,19 +116,24 @@ interface StructureRequest {
|
|
|
118
116
|
chain_steps?: string[];
|
|
119
117
|
derived_from_uid?: string[];
|
|
120
118
|
proven_by_uid?: string;
|
|
119
|
+
method_uid?: string;
|
|
120
|
+
describes_uid?: string;
|
|
121
|
+
part_of_uid?: string;
|
|
122
|
+
supersedes_uid?: string;
|
|
123
|
+
produces_uid?: string;
|
|
121
124
|
related_uids?: string[];
|
|
122
125
|
confidence?: number;
|
|
126
|
+
salience?: number;
|
|
123
127
|
props?: Record<string, unknown>;
|
|
124
128
|
agent_id?: string;
|
|
125
129
|
}
|
|
126
130
|
interface CommitmentRequest {
|
|
127
131
|
action: "goal" | "project" | "milestone";
|
|
128
132
|
label: string;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
summary?: string;
|
|
134
|
+
confidence?: number;
|
|
135
|
+
salience?: number;
|
|
132
136
|
parent_uid?: string;
|
|
133
|
-
due_date?: number;
|
|
134
137
|
motivated_by_uid?: string[];
|
|
135
138
|
props?: Record<string, unknown>;
|
|
136
139
|
agent_id?: string;
|
|
@@ -138,11 +141,11 @@ interface CommitmentRequest {
|
|
|
138
141
|
interface DeliberationRequest {
|
|
139
142
|
action: "open_decision" | "add_option" | "add_constraint" | "resolve" | "get_open";
|
|
140
143
|
label?: string;
|
|
141
|
-
|
|
144
|
+
summary?: string;
|
|
145
|
+
confidence?: number;
|
|
146
|
+
salience?: number;
|
|
142
147
|
decision_uid?: string;
|
|
143
148
|
chosen_option_uid?: string;
|
|
144
|
-
resolution_rationale?: string;
|
|
145
|
-
constraint_type?: string;
|
|
146
149
|
blocks_uid?: string;
|
|
147
150
|
informs_uid?: string[];
|
|
148
151
|
props?: Record<string, unknown>;
|
|
@@ -151,12 +154,11 @@ interface DeliberationRequest {
|
|
|
151
154
|
interface ProcedureRequest {
|
|
152
155
|
action: "create_flow" | "add_step" | "add_affordance" | "add_control";
|
|
153
156
|
label: string;
|
|
154
|
-
|
|
157
|
+
summary?: string;
|
|
158
|
+
confidence?: number;
|
|
159
|
+
salience?: number;
|
|
155
160
|
flow_uid?: string;
|
|
156
|
-
step_order?: number;
|
|
157
161
|
previous_step_uid?: string;
|
|
158
|
-
affordance_type?: string;
|
|
159
|
-
control_type?: string;
|
|
160
162
|
uses_affordance_uids?: string[];
|
|
161
163
|
goal_uid?: string;
|
|
162
164
|
props?: Record<string, unknown>;
|
|
@@ -165,12 +167,10 @@ interface ProcedureRequest {
|
|
|
165
167
|
interface RiskRequest {
|
|
166
168
|
action: "assess" | "get_assessments";
|
|
167
169
|
label?: string;
|
|
168
|
-
|
|
170
|
+
summary?: string;
|
|
171
|
+
confidence?: number;
|
|
172
|
+
salience?: number;
|
|
169
173
|
assessed_uid?: string;
|
|
170
|
-
severity?: string;
|
|
171
|
-
likelihood?: number;
|
|
172
|
-
mitigations?: string[];
|
|
173
|
-
residual_risk?: number;
|
|
174
174
|
filter_uid?: string;
|
|
175
175
|
props?: Record<string, unknown>;
|
|
176
176
|
agent_id?: string;
|
|
@@ -178,43 +178,42 @@ interface RiskRequest {
|
|
|
178
178
|
interface SessionRequest {
|
|
179
179
|
action: "open" | "trace" | "close" | "journal";
|
|
180
180
|
label?: string;
|
|
181
|
-
|
|
181
|
+
summary?: string;
|
|
182
|
+
confidence?: number;
|
|
183
|
+
salience?: number;
|
|
182
184
|
session_uid?: string;
|
|
183
|
-
trace_content?: string;
|
|
184
|
-
trace_type?: string;
|
|
185
185
|
relevant_node_uids?: string[];
|
|
186
|
-
content?: string;
|
|
187
|
-
journal_type?: string;
|
|
188
|
-
tags?: string[];
|
|
189
186
|
props?: Record<string, unknown>;
|
|
190
187
|
agent_id?: string;
|
|
191
188
|
}
|
|
192
189
|
interface DistillRequest {
|
|
193
190
|
label: string;
|
|
194
|
-
|
|
191
|
+
summary?: string;
|
|
192
|
+
confidence?: number;
|
|
193
|
+
salience?: number;
|
|
195
194
|
summarizes_uids?: string[];
|
|
196
195
|
session_uid?: string;
|
|
197
|
-
importance?: number;
|
|
198
196
|
props?: Record<string, unknown>;
|
|
199
197
|
agent_id?: string;
|
|
200
198
|
}
|
|
201
199
|
interface MemoryConfigRequest {
|
|
202
200
|
action: "set_preference" | "get_preferences" | "set_policy" | "get_policies";
|
|
203
201
|
label?: string;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
summary?: string;
|
|
203
|
+
confidence?: number;
|
|
204
|
+
salience?: number;
|
|
207
205
|
props?: Record<string, unknown>;
|
|
208
206
|
agent_id?: string;
|
|
209
207
|
}
|
|
210
208
|
interface PlanRequest {
|
|
211
209
|
action: "create_task" | "create_plan" | "add_step" | "update_status" | "get_plan";
|
|
212
210
|
label?: string;
|
|
213
|
-
|
|
211
|
+
summary?: string;
|
|
212
|
+
confidence?: number;
|
|
213
|
+
salience?: number;
|
|
214
214
|
goal_uid?: string;
|
|
215
215
|
task_uid?: string;
|
|
216
216
|
plan_uid?: string;
|
|
217
|
-
step_order?: number;
|
|
218
217
|
depends_on_uids?: string[];
|
|
219
218
|
target_uid?: string;
|
|
220
219
|
status?: string;
|
|
@@ -225,35 +224,36 @@ interface PlanRequest {
|
|
|
225
224
|
interface GovernanceRequest {
|
|
226
225
|
action: "create_policy" | "set_budget" | "request_approval" | "resolve_approval" | "get_pending";
|
|
227
226
|
label?: string;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
summary?: string;
|
|
228
|
+
confidence?: number;
|
|
229
|
+
salience?: number;
|
|
231
230
|
governed_uid?: string;
|
|
232
231
|
approval_uid?: string;
|
|
233
232
|
approved?: boolean;
|
|
234
|
-
resolution_note?: string;
|
|
235
233
|
requires_plan_uid?: string;
|
|
236
|
-
approval_request?: string;
|
|
237
234
|
props?: Record<string, unknown>;
|
|
238
235
|
agent_id?: string;
|
|
239
236
|
}
|
|
240
237
|
interface ExecutionRequest {
|
|
241
238
|
action: "start" | "complete" | "fail" | "register_agent" | "get_executions";
|
|
242
239
|
label?: string;
|
|
240
|
+
summary?: string;
|
|
241
|
+
confidence?: number;
|
|
242
|
+
salience?: number;
|
|
243
243
|
plan_uid?: string;
|
|
244
244
|
executor_uid?: string;
|
|
245
245
|
execution_uid?: string;
|
|
246
|
-
outcome?: string;
|
|
247
246
|
produces_node_uid?: string;
|
|
248
|
-
error_description?: string;
|
|
249
|
-
agent_name?: string;
|
|
250
|
-
agent_role?: string;
|
|
251
247
|
filter_plan_uid?: string;
|
|
252
248
|
related_uids?: string[];
|
|
253
249
|
props?: Record<string, unknown>;
|
|
254
250
|
agent_id?: string;
|
|
255
251
|
}
|
|
256
252
|
interface RetrieveRequest {
|
|
253
|
+
/**
|
|
254
|
+
* Retrieval action. Note: `"semantic"` requires a configured embedding
|
|
255
|
+
* provider on the server; for semantic search use `retrieveContext()` instead.
|
|
256
|
+
*/
|
|
257
257
|
action: "text" | "semantic" | "hybrid" | "active_goals" | "open_questions" | "weak_claims" | "pending_approvals" | "unresolved_contradictions" | "layer" | "recent";
|
|
258
258
|
query?: string;
|
|
259
259
|
k?: number;
|
|
@@ -290,26 +290,114 @@ interface EvolveRequest {
|
|
|
290
290
|
version?: number;
|
|
291
291
|
agent_id?: string;
|
|
292
292
|
}
|
|
293
|
-
interface
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
interface IngestChunkRequest {
|
|
294
|
+
content: string;
|
|
295
|
+
chunk_type?: string;
|
|
296
|
+
document_uid?: string;
|
|
297
|
+
chunk_index?: number;
|
|
298
|
+
label?: string;
|
|
299
|
+
layers?: string[];
|
|
300
|
+
agent_id?: string;
|
|
301
|
+
}
|
|
302
|
+
interface IngestChunkResponse {
|
|
303
|
+
chunk_uid: string;
|
|
304
|
+
nodes_created: number;
|
|
305
|
+
nodes_deduplicated: number;
|
|
306
|
+
edges_created: number;
|
|
307
|
+
extracted_node_uids: string[];
|
|
308
|
+
errors: string[];
|
|
309
|
+
}
|
|
310
|
+
interface IngestDocumentRequest {
|
|
311
|
+
content: string;
|
|
312
|
+
title?: string;
|
|
313
|
+
document_type?: string;
|
|
314
|
+
/** Semantic content type: "article" (default), "meeting_notes", "journal". Drives default extraction layers. */
|
|
315
|
+
content_type?: string;
|
|
316
|
+
source_uri?: string;
|
|
317
|
+
chunk_size?: number;
|
|
318
|
+
chunk_overlap?: number;
|
|
319
|
+
layers?: string[];
|
|
320
|
+
agent_id?: string;
|
|
296
321
|
}
|
|
297
|
-
interface
|
|
298
|
-
|
|
299
|
-
|
|
322
|
+
interface IngestDocumentResponse {
|
|
323
|
+
job_id: string;
|
|
324
|
+
document_uid: string;
|
|
300
325
|
}
|
|
301
|
-
interface
|
|
302
|
-
|
|
303
|
-
|
|
326
|
+
interface IngestSessionRequest {
|
|
327
|
+
content: string;
|
|
328
|
+
title?: string;
|
|
329
|
+
session_uid?: string;
|
|
330
|
+
chunk_size?: number;
|
|
331
|
+
chunk_overlap?: number;
|
|
332
|
+
layers?: string[];
|
|
333
|
+
agent_id?: string;
|
|
304
334
|
}
|
|
305
|
-
interface
|
|
306
|
-
|
|
335
|
+
interface RetrieveContextRequest {
|
|
336
|
+
query: string;
|
|
337
|
+
k?: number;
|
|
338
|
+
depth?: number;
|
|
339
|
+
node_types?: string[];
|
|
340
|
+
layer?: string;
|
|
341
|
+
include_chunks?: boolean;
|
|
342
|
+
include_graph?: boolean;
|
|
343
|
+
min_similarity?: number;
|
|
344
|
+
}
|
|
345
|
+
interface RetrieveContextResponse {
|
|
346
|
+
chunks: {
|
|
347
|
+
chunk_uid: string;
|
|
348
|
+
content: string;
|
|
349
|
+
score: number;
|
|
350
|
+
document_uid: string | null;
|
|
351
|
+
chunk_index: number | null;
|
|
352
|
+
}[];
|
|
353
|
+
graph: {
|
|
354
|
+
nodes: Record<string, unknown>[];
|
|
355
|
+
edges: Record<string, unknown>[];
|
|
356
|
+
};
|
|
307
357
|
}
|
|
308
|
-
interface
|
|
358
|
+
interface Job {
|
|
309
359
|
id: string;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
360
|
+
title: string;
|
|
361
|
+
status: "pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
362
|
+
progress: {
|
|
363
|
+
total_chunks: number;
|
|
364
|
+
processed_chunks: number;
|
|
365
|
+
nodes_created: number;
|
|
366
|
+
edges_created: number;
|
|
367
|
+
};
|
|
368
|
+
result: Record<string, unknown> | null;
|
|
369
|
+
error: string | null;
|
|
370
|
+
created_at: number;
|
|
371
|
+
queue_position?: number;
|
|
372
|
+
}
|
|
373
|
+
interface ClearResponse {
|
|
374
|
+
cleared: boolean;
|
|
375
|
+
nodes_removed: number;
|
|
376
|
+
edges_removed: number;
|
|
377
|
+
versions_removed: number;
|
|
378
|
+
aliases_removed: number;
|
|
379
|
+
embeddings_removed: number;
|
|
380
|
+
}
|
|
381
|
+
interface BatchRequest {
|
|
382
|
+
nodes?: {
|
|
383
|
+
label: string;
|
|
384
|
+
node_type?: string;
|
|
385
|
+
props?: Record<string, unknown>;
|
|
386
|
+
}[];
|
|
387
|
+
edges?: {
|
|
388
|
+
from_uid: string;
|
|
389
|
+
to_uid: string;
|
|
390
|
+
edge_type: string;
|
|
391
|
+
}[];
|
|
392
|
+
agent_id?: string;
|
|
393
|
+
}
|
|
394
|
+
interface DecayRequest {
|
|
395
|
+
half_life_secs: number;
|
|
396
|
+
min_salience?: number;
|
|
397
|
+
min_age_secs?: number;
|
|
398
|
+
}
|
|
399
|
+
interface PurgeRequest {
|
|
400
|
+
before?: number;
|
|
313
401
|
}
|
|
314
402
|
interface MindGraphConfig {
|
|
315
403
|
baseUrl: string;
|
|
@@ -335,25 +423,64 @@ declare class MindGraph {
|
|
|
335
423
|
status: string;
|
|
336
424
|
}>;
|
|
337
425
|
stats(): Promise<Record<string, unknown>>;
|
|
338
|
-
|
|
426
|
+
capture(req: CaptureRequest): Promise<unknown>;
|
|
339
427
|
entity(req: EntityRequest): Promise<unknown>;
|
|
340
428
|
/** Convenience: create or find an entity by label. */
|
|
341
|
-
findOrCreateEntity(label: string,
|
|
429
|
+
findOrCreateEntity(label: string, props?: Record<string, unknown>, agentId?: string): Promise<GraphNode & {
|
|
342
430
|
created: boolean;
|
|
343
431
|
}>;
|
|
432
|
+
/**
|
|
433
|
+
* Resolve text to an existing entity via alias matching.
|
|
434
|
+
* Returns `{ uid: string | null }`.
|
|
435
|
+
*/
|
|
436
|
+
resolveEntity(text: string, agentId?: string): Promise<{
|
|
437
|
+
uid: string | null;
|
|
438
|
+
}>;
|
|
439
|
+
/**
|
|
440
|
+
* Fuzzy-match text against existing entities.
|
|
441
|
+
* Returns `{ matches: [{ uid, label, score }] }`.
|
|
442
|
+
*/
|
|
443
|
+
fuzzyResolveEntity(text: string, limit?: number, agentId?: string): Promise<{
|
|
444
|
+
matches: {
|
|
445
|
+
uid: string;
|
|
446
|
+
label: string;
|
|
447
|
+
score: number;
|
|
448
|
+
}[];
|
|
449
|
+
}>;
|
|
344
450
|
argue(req: ArgumentRequest): Promise<unknown>;
|
|
345
451
|
inquire(req: InquiryRequest): Promise<unknown>;
|
|
346
452
|
structure(req: StructureRequest): Promise<unknown>;
|
|
347
453
|
commit(req: CommitmentRequest): Promise<unknown>;
|
|
348
454
|
deliberate(req: DeliberationRequest): Promise<unknown>;
|
|
455
|
+
/** Open a new decision for deliberation. Returns the Decision node. */
|
|
456
|
+
openDecision(label: string, opts?: {
|
|
457
|
+
summary?: string;
|
|
458
|
+
props?: Record<string, unknown>;
|
|
459
|
+
agent_id?: string;
|
|
460
|
+
}): Promise<unknown>;
|
|
461
|
+
/** Add an option to an open decision. Returns the Option node. */
|
|
462
|
+
addOption(decisionUid: string, label: string, opts?: {
|
|
463
|
+
summary?: string;
|
|
464
|
+
props?: Record<string, unknown>;
|
|
465
|
+
agent_id?: string;
|
|
466
|
+
}): Promise<unknown>;
|
|
467
|
+
/**
|
|
468
|
+
* Resolve a decision by choosing an option.
|
|
469
|
+
* `chosenOptionUid` must be the uid of an option added via `addOption()`.
|
|
470
|
+
*/
|
|
471
|
+
resolveDecision(decisionUid: string, chosenOptionUid: string, opts?: {
|
|
472
|
+
summary?: string;
|
|
473
|
+
agent_id?: string;
|
|
474
|
+
}): Promise<unknown>;
|
|
349
475
|
procedure(req: ProcedureRequest): Promise<unknown>;
|
|
350
476
|
risk(req: RiskRequest): Promise<unknown>;
|
|
351
477
|
session(req: SessionRequest): Promise<unknown>;
|
|
352
|
-
journal(label: string,
|
|
478
|
+
journal(label: string, props: Record<string, unknown>, options?: {
|
|
479
|
+
summary?: string;
|
|
353
480
|
session_uid?: string;
|
|
354
|
-
journal_type?: string;
|
|
355
|
-
tags?: string[];
|
|
356
481
|
relevant_node_uids?: string[];
|
|
482
|
+
confidence?: number;
|
|
483
|
+
salience?: number;
|
|
357
484
|
agent_id?: string;
|
|
358
485
|
}): Promise<unknown>;
|
|
359
486
|
distill(req: DistillRequest): Promise<unknown>;
|
|
@@ -361,10 +488,18 @@ declare class MindGraph {
|
|
|
361
488
|
plan(req: PlanRequest): Promise<unknown>;
|
|
362
489
|
governance(req: GovernanceRequest): Promise<unknown>;
|
|
363
490
|
execution(req: ExecutionRequest): Promise<unknown>;
|
|
364
|
-
|
|
491
|
+
/** Returns an array of results. Shape varies by action. */
|
|
492
|
+
retrieve(req: RetrieveRequest): Promise<unknown[]>;
|
|
365
493
|
traverse(req: TraverseRequest): Promise<unknown>;
|
|
366
494
|
evolve(req: EvolveRequest): Promise<unknown>;
|
|
367
495
|
getNode(uid: string): Promise<GraphNode>;
|
|
496
|
+
/**
|
|
497
|
+
* Create a node via the low-level CRUD endpoint.
|
|
498
|
+
*
|
|
499
|
+
* The server requires `props._type` to determine the node variant.
|
|
500
|
+
* If `node_type` is provided and `_type` is not already in `props`,
|
|
501
|
+
* it is injected automatically.
|
|
502
|
+
*/
|
|
368
503
|
addNode(body: {
|
|
369
504
|
label: string;
|
|
370
505
|
node_type?: string;
|
|
@@ -379,16 +514,50 @@ declare class MindGraph {
|
|
|
379
514
|
agent_id?: string;
|
|
380
515
|
}): Promise<GraphNode>;
|
|
381
516
|
deleteNode(uid: string): Promise<void>;
|
|
517
|
+
getNodeHistory(uid: string): Promise<unknown[]>;
|
|
518
|
+
getNodeAtVersion(uid: string, version: number): Promise<GraphNode>;
|
|
382
519
|
addLink(body: {
|
|
383
520
|
from_uid: string;
|
|
384
521
|
to_uid: string;
|
|
385
522
|
edge_type: string;
|
|
386
523
|
agent_id?: string;
|
|
387
524
|
}): Promise<unknown>;
|
|
525
|
+
/**
|
|
526
|
+
* Create an edge via the low-level CRUD endpoint.
|
|
527
|
+
*
|
|
528
|
+
* The server requires `props._type` to determine the edge variant.
|
|
529
|
+
* If `edge_type` is provided and `_type` is not already in `props`,
|
|
530
|
+
* it is injected automatically.
|
|
531
|
+
*/
|
|
532
|
+
addEdge(body: {
|
|
533
|
+
from_uid: string;
|
|
534
|
+
to_uid: string;
|
|
535
|
+
edge_type: string;
|
|
536
|
+
weight?: number;
|
|
537
|
+
props?: Record<string, unknown>;
|
|
538
|
+
agent_id?: string;
|
|
539
|
+
}): Promise<unknown>;
|
|
540
|
+
updateEdge(uid: string, body: {
|
|
541
|
+
weight?: number;
|
|
542
|
+
props?: Record<string, unknown>;
|
|
543
|
+
agent_id?: string;
|
|
544
|
+
}): Promise<unknown>;
|
|
545
|
+
deleteEdge(uid: string): Promise<void>;
|
|
546
|
+
getEdgeHistory(uid: string): Promise<unknown[]>;
|
|
547
|
+
/**
|
|
548
|
+
* List edges filtered by source and/or target node.
|
|
549
|
+
* At least one of `from_uid` or `to_uid` is **required** —
|
|
550
|
+
* the server returns 400 if neither is provided.
|
|
551
|
+
*/
|
|
388
552
|
getEdges(params: {
|
|
389
553
|
from_uid?: string;
|
|
390
554
|
to_uid?: string;
|
|
391
555
|
}): Promise<GraphEdge[]>;
|
|
556
|
+
getEdgeBetween(params: {
|
|
557
|
+
from_uid: string;
|
|
558
|
+
to_uid: string;
|
|
559
|
+
edge_type?: string;
|
|
560
|
+
}): Promise<GraphEdge[]>;
|
|
392
561
|
search(query: string, opts?: {
|
|
393
562
|
node_type?: string;
|
|
394
563
|
layer?: string;
|
|
@@ -400,18 +569,79 @@ declare class MindGraph {
|
|
|
400
569
|
node_types?: string[];
|
|
401
570
|
layer?: string;
|
|
402
571
|
}): Promise<SearchResult[]>;
|
|
572
|
+
getNodes(params?: {
|
|
573
|
+
node_type?: string;
|
|
574
|
+
layer?: string;
|
|
575
|
+
limit?: number;
|
|
576
|
+
offset?: number;
|
|
577
|
+
}): Promise<unknown>;
|
|
578
|
+
getAgentNodes(agentId: string): Promise<GraphNode[]>;
|
|
579
|
+
batch(req: BatchRequest): Promise<unknown>;
|
|
580
|
+
configureEmbeddings(body: {
|
|
581
|
+
model: string;
|
|
582
|
+
dimensions: number;
|
|
583
|
+
distance_metric?: string;
|
|
584
|
+
}): Promise<unknown>;
|
|
585
|
+
embeddingSearch(body: {
|
|
586
|
+
vector: number[];
|
|
587
|
+
k?: number;
|
|
588
|
+
node_types?: string[];
|
|
589
|
+
threshold?: number;
|
|
590
|
+
}): Promise<unknown>;
|
|
591
|
+
embeddingSearchText(body: {
|
|
592
|
+
text: string;
|
|
593
|
+
k?: number;
|
|
594
|
+
node_types?: string[];
|
|
595
|
+
threshold?: number;
|
|
596
|
+
}): Promise<unknown>;
|
|
597
|
+
getEmbedding(uid: string): Promise<unknown>;
|
|
598
|
+
setEmbedding(uid: string, vector: number[]): Promise<void>;
|
|
599
|
+
deleteEmbedding(uid: string): Promise<void>;
|
|
600
|
+
mergeEntities(body: {
|
|
601
|
+
keep_uid: string;
|
|
602
|
+
merge_uid: string;
|
|
603
|
+
agent_id?: string;
|
|
604
|
+
}): Promise<unknown>;
|
|
605
|
+
addAlias(body: {
|
|
606
|
+
text: string;
|
|
607
|
+
canonical_uid: string;
|
|
608
|
+
score?: number;
|
|
609
|
+
}): Promise<unknown>;
|
|
610
|
+
getAliases(uid: string): Promise<unknown>;
|
|
611
|
+
resolveAlias(text: string): Promise<unknown>;
|
|
612
|
+
exportGraph(): Promise<unknown>;
|
|
613
|
+
importGraph(data: unknown): Promise<unknown>;
|
|
614
|
+
decay(req: DecayRequest): Promise<unknown>;
|
|
615
|
+
purge(req?: PurgeRequest): Promise<unknown>;
|
|
403
616
|
reasoningChain(uid: string, maxDepth?: number): Promise<PathStep[]>;
|
|
404
617
|
neighborhood(uid: string, maxDepth?: number): Promise<PathStep[]>;
|
|
618
|
+
subgraph(uid: string, opts?: {
|
|
619
|
+
max_depth?: number;
|
|
620
|
+
direction?: "outgoing" | "incoming" | "both";
|
|
621
|
+
edge_types?: string[];
|
|
622
|
+
weight_threshold?: number;
|
|
623
|
+
}): Promise<{
|
|
624
|
+
nodes: GraphNode[];
|
|
625
|
+
edges: GraphEdge[];
|
|
626
|
+
}>;
|
|
405
627
|
tombstone(uid: string, reason?: string, agentId?: string): Promise<unknown>;
|
|
406
628
|
restore(uid: string, agentId?: string): Promise<unknown>;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
629
|
+
getGoals(): Promise<GraphNode[]>;
|
|
630
|
+
getOpenDecisions(): Promise<GraphNode[]>;
|
|
631
|
+
getOpenQuestions(): Promise<GraphNode[]>;
|
|
632
|
+
getWeakClaims(): Promise<GraphNode[]>;
|
|
633
|
+
getContradictions(): Promise<unknown[]>;
|
|
634
|
+
getPendingApprovals(): Promise<GraphNode[]>;
|
|
635
|
+
ingestChunk(req: IngestChunkRequest): Promise<IngestChunkResponse>;
|
|
636
|
+
ingestDocument(req: IngestDocumentRequest): Promise<IngestDocumentResponse>;
|
|
637
|
+
ingestSession(req: IngestSessionRequest): Promise<IngestDocumentResponse>;
|
|
638
|
+
retrieveContext(req: RetrieveContextRequest): Promise<RetrieveContextResponse>;
|
|
639
|
+
listJobs(): Promise<Job[]>;
|
|
640
|
+
getJob(id: string): Promise<Job>;
|
|
641
|
+
cancelJob(id: string): Promise<unknown>;
|
|
642
|
+
cleanupOrphans(): Promise<unknown>;
|
|
643
|
+
embedAll(): Promise<unknown>;
|
|
644
|
+
clearGraph(): Promise<ClearResponse>;
|
|
415
645
|
}
|
|
416
646
|
|
|
417
|
-
export { type
|
|
647
|
+
export { type ArgumentRequest, type BatchRequest, type CaptureRequest, type ClearResponse, type CommitmentRequest, type DecayRequest, type DeliberationRequest, type DistillRequest, type EntityRequest, type EvolveRequest, type ExecutionRequest, type GovernanceRequest, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type MemoryConfigRequest, MindGraph, type MindGraphConfig, MindGraphError, type PathStep, type PlanRequest, type ProcedureRequest, type PurgeRequest, type RetrieveContextRequest, type RetrieveContextResponse, type RetrieveRequest, type RiskRequest, type SearchResult, type SessionRequest, type StructureRequest, type TraverseRequest };
|