abstractnote 0.1.0__py3-none-any.whl

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 (80) hide show
  1. abstractnote/__init__.py +18 -0
  2. abstractnote/cli.py +240 -0
  3. abstractnote/flows/__init__.py +2 -0
  4. abstractnote/flows/build.py +970 -0
  5. abstractnote/flows/bundle.py +62 -0
  6. abstractnote/flows/contract.py +88 -0
  7. abstractnote/flows/graph.py +540 -0
  8. abstractnote/flows/json/note-capture.json +2280 -0
  9. abstractnote/flows/json/note-drain.json +2012 -0
  10. abstractnote/flows/json/note-mine.json +2392 -0
  11. abstractnote/flows/json/note-process.json +1853 -0
  12. abstractnote/flows/json/note-recall.json +1876 -0
  13. abstractnote/flows/json/note-reflect.json +2057 -0
  14. abstractnote/flows/prompts_fallback.py +119 -0
  15. abstractnote/flows/runner.py +320 -0
  16. abstractnote/flows/schemas_fallback.py +175 -0
  17. abstractnote/gateway/__init__.py +24 -0
  18. abstractnote/gateway/appspec.py +10 -0
  19. abstractnote/gateway/router.py +571 -0
  20. abstractnote/gateway/tools.py +74 -0
  21. abstractnote/ids.py +177 -0
  22. abstractnote/importers/__init__.py +142 -0
  23. abstractnote/importers/__main__.py +3 -0
  24. abstractnote/importers/agora.py +203 -0
  25. abstractnote/importers/claude_sessions.py +415 -0
  26. abstractnote/importers/cli.py +113 -0
  27. abstractnote/importers/files.py +72 -0
  28. abstractnote/importers/markdown.py +165 -0
  29. abstractnote/ingest/__init__.py +7 -0
  30. abstractnote/ingest/blobs.py +47 -0
  31. abstractnote/ingest/capture.py +265 -0
  32. abstractnote/ingest/extract.py +118 -0
  33. abstractnote/ingest/normalise.py +95 -0
  34. abstractnote/model.py +229 -0
  35. abstractnote/process/__init__.py +5 -0
  36. abstractnote/process/context.py +218 -0
  37. abstractnote/process/merge.py +60 -0
  38. abstractnote/process/prompts/__init__.py +39 -0
  39. abstractnote/process/prompts/extract.md +30 -0
  40. abstractnote/process/prompts/link.md +32 -0
  41. abstractnote/process/prompts/mine_dossier.md +13 -0
  42. abstractnote/process/prompts/mine_findings.md +13 -0
  43. abstractnote/process/prompts/mine_plan.md +13 -0
  44. abstractnote/process/prompts/quick_filing.md +23 -0
  45. abstractnote/process/prompts/reflect.md +10 -0
  46. abstractnote/process/prompts/synthesize.md +17 -0
  47. abstractnote/process/resolve.py +96 -0
  48. abstractnote/process/revise.py +410 -0
  49. abstractnote/process/schemas.py +377 -0
  50. abstractnote/process/vocabulary.py +68 -0
  51. abstractnote/recall/__init__.py +1 -0
  52. abstractnote/recall/changes.py +191 -0
  53. abstractnote/recall/expand.py +379 -0
  54. abstractnote/recall/insights.py +62 -0
  55. abstractnote/recall/reflect.py +202 -0
  56. abstractnote/recall/review.py +191 -0
  57. abstractnote/recall/search.py +205 -0
  58. abstractnote/recall/shapes.py +52 -0
  59. abstractnote/recall/then_now.py +100 -0
  60. abstractnote/store/__init__.py +12 -0
  61. abstractnote/store/archive.py +166 -0
  62. abstractnote/store/embeddings.py +275 -0
  63. abstractnote/store/kg.py +219 -0
  64. abstractnote/store/notebook.py +829 -0
  65. abstractnote/store/notes.py +1190 -0
  66. abstractnote/store/queue.py +159 -0
  67. abstractnote/store/schema.py +348 -0
  68. abstractnote/store/vector_index.py +88 -0
  69. abstractnote/tools/__init__.py +215 -0
  70. abstractnote/tools/capture.py +121 -0
  71. abstractnote/tools/context.py +19 -0
  72. abstractnote/tools/process.py +22 -0
  73. abstractnote/tools/queue.py +23 -0
  74. abstractnote/tools/recall.py +64 -0
  75. abstractnote-0.1.0.dist-info/METADATA +145 -0
  76. abstractnote-0.1.0.dist-info/RECORD +80 -0
  77. abstractnote-0.1.0.dist-info/WHEEL +5 -0
  78. abstractnote-0.1.0.dist-info/entry_points.txt +2 -0
  79. abstractnote-0.1.0.dist-info/licenses/LICENSE +21 -0
  80. abstractnote-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1853 @@
1
+ {
2
+ "id": "note-process",
3
+ "name": "Understand a note",
4
+ "description": "Read one note against what the notebook knows, extract, link and revise the graph.",
5
+ "interfaces": [],
6
+ "nodes": [
7
+ {
8
+ "id": "start",
9
+ "type": "on_flow_start",
10
+ "position": {
11
+ "x": 0.0,
12
+ "y": 0.0
13
+ },
14
+ "data": {
15
+ "nodeType": "on_flow_start",
16
+ "label": "Start",
17
+ "inputs": [],
18
+ "outputs": [
19
+ {
20
+ "id": "exec-out",
21
+ "label": "",
22
+ "type": "execution"
23
+ },
24
+ {
25
+ "id": "note_id",
26
+ "label": "note_id",
27
+ "type": "string"
28
+ },
29
+ {
30
+ "id": "provider",
31
+ "label": "provider",
32
+ "type": "provider_text"
33
+ },
34
+ {
35
+ "id": "model",
36
+ "label": "model",
37
+ "type": "model"
38
+ }
39
+ ],
40
+ "pinDefaults": {
41
+ "note_id": "",
42
+ "provider": "",
43
+ "model": ""
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "id": "context_args",
49
+ "type": "code",
50
+ "position": {
51
+ "x": 480.0,
52
+ "y": 0.0
53
+ },
54
+ "data": {
55
+ "nodeType": "code",
56
+ "label": "Look at what is known: arguments",
57
+ "inputs": [
58
+ {
59
+ "id": "exec-in",
60
+ "label": "",
61
+ "type": "execution"
62
+ },
63
+ {
64
+ "id": "note_id",
65
+ "label": "note_id",
66
+ "type": "string"
67
+ },
68
+ {
69
+ "id": "permissions",
70
+ "label": "permissions",
71
+ "type": "string"
72
+ }
73
+ ],
74
+ "outputs": [
75
+ {
76
+ "id": "exec-out",
77
+ "label": "",
78
+ "type": "execution"
79
+ },
80
+ {
81
+ "id": "tool_calls",
82
+ "label": "tool_calls",
83
+ "type": "array"
84
+ }
85
+ ],
86
+ "pinDefaults": {
87
+ "permissions": "sandbox"
88
+ },
89
+ "functionName": "transform",
90
+ "codeBody": "arguments = {}\nif note_id is not None and note_id != \"\":\n arguments[\"note_id\"] = note_id\nreturn {\"tool_calls\": [{\"name\": \"note_context\", \"call_id\": \"context\", \"arguments\": arguments}]}\n"
91
+ }
92
+ },
93
+ {
94
+ "id": "context",
95
+ "type": "tool_calls",
96
+ "position": {
97
+ "x": 960.0,
98
+ "y": 0.0
99
+ },
100
+ "data": {
101
+ "nodeType": "tool_calls",
102
+ "label": "Look at what is known",
103
+ "inputs": [
104
+ {
105
+ "id": "exec-in",
106
+ "label": "",
107
+ "type": "execution"
108
+ },
109
+ {
110
+ "id": "tool_calls",
111
+ "label": "tool_calls",
112
+ "type": "array"
113
+ },
114
+ {
115
+ "id": "allowed_tools",
116
+ "label": "allowed_tools",
117
+ "type": "array"
118
+ }
119
+ ],
120
+ "outputs": [
121
+ {
122
+ "id": "exec-out",
123
+ "label": "",
124
+ "type": "execution"
125
+ },
126
+ {
127
+ "id": "results",
128
+ "label": "results",
129
+ "type": "array"
130
+ },
131
+ {
132
+ "id": "success",
133
+ "label": "success",
134
+ "type": "boolean"
135
+ }
136
+ ],
137
+ "pinDefaults": {
138
+ "allowed_tools": [
139
+ "note_context"
140
+ ]
141
+ },
142
+ "effectConfig": {
143
+ "allowed_tools": [
144
+ "note_context"
145
+ ]
146
+ }
147
+ }
148
+ },
149
+ {
150
+ "id": "context_out",
151
+ "type": "code",
152
+ "position": {
153
+ "x": 1440.0,
154
+ "y": 0.0
155
+ },
156
+ "data": {
157
+ "nodeType": "code",
158
+ "label": "Look at what is known: result",
159
+ "inputs": [
160
+ {
161
+ "id": "exec-in",
162
+ "label": "",
163
+ "type": "execution"
164
+ },
165
+ {
166
+ "id": "results",
167
+ "label": "results",
168
+ "type": "array"
169
+ },
170
+ {
171
+ "id": "permissions",
172
+ "label": "permissions",
173
+ "type": "string"
174
+ }
175
+ ],
176
+ "outputs": [
177
+ {
178
+ "id": "exec-out",
179
+ "label": "",
180
+ "type": "execution"
181
+ },
182
+ {
183
+ "id": "note",
184
+ "label": "note",
185
+ "type": "object"
186
+ },
187
+ {
188
+ "id": "sections",
189
+ "label": "sections",
190
+ "type": "array"
191
+ },
192
+ {
193
+ "id": "similar_notes",
194
+ "label": "similar_notes",
195
+ "type": "array"
196
+ },
197
+ {
198
+ "id": "candidate_entities",
199
+ "label": "candidate_entities",
200
+ "type": "array"
201
+ },
202
+ {
203
+ "id": "open_tasks",
204
+ "label": "open_tasks",
205
+ "type": "array"
206
+ },
207
+ {
208
+ "id": "topics",
209
+ "label": "topics",
210
+ "type": "array"
211
+ },
212
+ {
213
+ "id": "vocabulary",
214
+ "label": "vocabulary",
215
+ "type": "array"
216
+ },
217
+ {
218
+ "id": "tool_output",
219
+ "label": "tool_output",
220
+ "type": "object"
221
+ }
222
+ ],
223
+ "pinDefaults": {
224
+ "permissions": "sandbox"
225
+ },
226
+ "functionName": "transform",
227
+ "codeBody": "r = results[0] if isinstance(results, list) and results else None\nfailure = None\nout = None\nif not isinstance(r, dict):\n failure = \"note_context returned no result.\"\nelif not r.get(\"success\"):\n failure = str(r.get(\"error\") or \"note_context failed.\")\nelse:\n out = r.get(\"output\")\n if not isinstance(out, dict):\n failure = \"note_context returned something other than an object.\"\nif failure is not None:\n raise ValueError(failure)\nreturn dict(out, tool_output=out)\n"
228
+ }
229
+ },
230
+ {
231
+ "id": "sections",
232
+ "type": "code",
233
+ "position": {
234
+ "x": 1920.0,
235
+ "y": 0.0
236
+ },
237
+ "data": {
238
+ "nodeType": "code",
239
+ "label": "Sections to read",
240
+ "inputs": [
241
+ {
242
+ "id": "exec-in",
243
+ "label": "",
244
+ "type": "execution"
245
+ },
246
+ {
247
+ "id": "sections",
248
+ "label": "sections",
249
+ "type": "array"
250
+ },
251
+ {
252
+ "id": "permissions",
253
+ "label": "permissions",
254
+ "type": "string"
255
+ }
256
+ ],
257
+ "outputs": [
258
+ {
259
+ "id": "exec-out",
260
+ "label": "",
261
+ "type": "execution"
262
+ },
263
+ {
264
+ "id": "items",
265
+ "label": "items",
266
+ "type": "array"
267
+ }
268
+ ],
269
+ "pinDefaults": {
270
+ "permissions": "sandbox"
271
+ },
272
+ "functionName": "transform",
273
+ "codeBody": "if not isinstance(sections, list) or not sections:\n raise ValueError(\"The note has no text to read.\")\nreturn {\"items\": sections}\n"
274
+ }
275
+ },
276
+ {
277
+ "id": "each_section",
278
+ "type": "loop",
279
+ "position": {
280
+ "x": 2400.0,
281
+ "y": 0.0
282
+ },
283
+ "data": {
284
+ "nodeType": "loop",
285
+ "label": "For each section",
286
+ "inputs": [
287
+ {
288
+ "id": "exec-in",
289
+ "label": "",
290
+ "type": "execution"
291
+ },
292
+ {
293
+ "id": "items",
294
+ "label": "items",
295
+ "type": "array"
296
+ }
297
+ ],
298
+ "outputs": [
299
+ {
300
+ "id": "loop",
301
+ "label": "loop",
302
+ "type": "execution"
303
+ },
304
+ {
305
+ "id": "done",
306
+ "label": "done",
307
+ "type": "execution"
308
+ },
309
+ {
310
+ "id": "item",
311
+ "label": "item",
312
+ "type": "any"
313
+ },
314
+ {
315
+ "id": "index",
316
+ "label": "index",
317
+ "type": "number"
318
+ }
319
+ ]
320
+ }
321
+ },
322
+ {
323
+ "id": "extract_prompt",
324
+ "type": "string_template",
325
+ "position": {
326
+ "x": 2400.0,
327
+ "y": 320.0
328
+ },
329
+ "data": {
330
+ "nodeType": "string_template",
331
+ "label": "Extraction prompt",
332
+ "inputs": [
333
+ {
334
+ "id": "template",
335
+ "label": "template",
336
+ "type": "string"
337
+ },
338
+ {
339
+ "id": "note",
340
+ "label": "note",
341
+ "type": "any"
342
+ },
343
+ {
344
+ "id": "section",
345
+ "label": "section",
346
+ "type": "any"
347
+ },
348
+ {
349
+ "id": "similar_notes",
350
+ "label": "similar_notes",
351
+ "type": "any"
352
+ },
353
+ {
354
+ "id": "candidate_entities",
355
+ "label": "candidate_entities",
356
+ "type": "any"
357
+ },
358
+ {
359
+ "id": "open_tasks",
360
+ "label": "open_tasks",
361
+ "type": "any"
362
+ },
363
+ {
364
+ "id": "topics",
365
+ "label": "topics",
366
+ "type": "any"
367
+ },
368
+ {
369
+ "id": "vocabulary",
370
+ "label": "vocabulary",
371
+ "type": "any"
372
+ }
373
+ ],
374
+ "outputs": [
375
+ {
376
+ "id": "result",
377
+ "label": "result",
378
+ "type": "string"
379
+ }
380
+ ],
381
+ "pinDefaults": {
382
+ "template": "You read one section of a person's note and write down what it says, so it can be linked to what they already know.\n\nThe note: {{note}}\n\nSection to read:\n{{section}}\n\nWhat the notebook already knows (for orientation only; do not copy it into the output):\n- similar notes: {{similar_notes}}\n- entities that may be mentioned: {{candidate_entities}}\n- open tasks: {{open_tasks}}\n- existing topics: {{topics}}\n\nPredicate vocabulary (use one of these CURIEs when it fits; otherwise write `ex:snake_case`):\n{{vocabulary}}\n\nReturn:\n- `summary`: one to three sentences about this section;\n- `mentions`: every person, organisation, project, concept, place, event, artifact (document, dataset, repository), piece of software or other thing the section talks about, each with a `ref` (m1, m2, ...), the `name` exactly as written, its `kind`, other names used for it in the note (`aliases`), and its `role` in one phrase;\n- `claims`: one per statement, with `subject` a mention ref, a `predicate`, and an `object` that is a mention ref, or a literal value with `object_is_literal: true`; `certainty` (stated, probable, possible, reported, disputed), `stance` (assert; revise when the note corrects earlier knowledge; retract when it says something is no longer true), `evidence` (a verbatim excerpt), and `valid_from` / `valid_until` only when the note gives or implies those dates from its own date;\n Quantities, amounts, dates, deadlines and decisions are facts about their subject: write them as literal-object claims with an explicit `ex:` predicate rather than forcing a vocabulary predicate that does not mean the same thing. For example, \"We capped the LUT budget at 25k; Dana needs the Pareto by 24 October\" gives `{\"subject\": \"m1\", \"predicate\": \"ex:budget_cap\", \"object\": \"25k\", \"object_is_literal\": true}`, `{\"subject\": \"m1\", \"predicate\": \"ex:deadline\", \"object\": \"2026-10-24\", \"object_is_literal\": true}` and `{\"subject\": \"m1\", \"predicate\": \"ex:decided\", \"object\": \"cap the budget at 25k\", \"object_is_literal\": true}` (with m1 = LUT), not `schema:nextItem` or `schema:knowsAbout`;\n- `tasks`: things to do (`open`) and things reported done (`done`), with a due date when one is given;\n- `time_refs`: explicit time references (\"last Tuesday\", \"in 2024\") with their ISO date when the note's own date resolves them;\n- `topics`: the topics the section belongs to, preferring existing ones.\n\nRules:\n- Use only the note and the provided context; never invent entities or dates.\n- Keep names as written by the author; put variants in aliases.\n- Quote evidence verbatim; one claim per statement; no inferred hierarchy.\n- Output JSON only, matching the schema.\n"
383
+ }
384
+ }
385
+ },
386
+ {
387
+ "id": "extract",
388
+ "type": "llm_call",
389
+ "position": {
390
+ "x": 2880.0,
391
+ "y": 0.0
392
+ },
393
+ "data": {
394
+ "nodeType": "llm_call",
395
+ "label": "Extract",
396
+ "inputs": [
397
+ {
398
+ "id": "exec-in",
399
+ "label": "",
400
+ "type": "execution"
401
+ },
402
+ {
403
+ "id": "provider",
404
+ "label": "provider",
405
+ "type": "provider_text"
406
+ },
407
+ {
408
+ "id": "model",
409
+ "label": "model",
410
+ "type": "model"
411
+ },
412
+ {
413
+ "id": "system",
414
+ "label": "system",
415
+ "type": "string"
416
+ },
417
+ {
418
+ "id": "prompt",
419
+ "label": "prompt",
420
+ "type": "string"
421
+ },
422
+ {
423
+ "id": "tools",
424
+ "label": "tools",
425
+ "type": "tools"
426
+ },
427
+ {
428
+ "id": "temperature",
429
+ "label": "temperature",
430
+ "type": "number"
431
+ },
432
+ {
433
+ "id": "resp_schema",
434
+ "label": "resp_schema",
435
+ "type": "json_schema"
436
+ }
437
+ ],
438
+ "outputs": [
439
+ {
440
+ "id": "exec-out",
441
+ "label": "",
442
+ "type": "execution"
443
+ },
444
+ {
445
+ "id": "response",
446
+ "label": "response",
447
+ "type": "string"
448
+ },
449
+ {
450
+ "id": "data",
451
+ "label": "data",
452
+ "type": "object"
453
+ },
454
+ {
455
+ "id": "success",
456
+ "label": "success",
457
+ "type": "boolean"
458
+ },
459
+ {
460
+ "id": "meta",
461
+ "label": "meta",
462
+ "type": "object"
463
+ },
464
+ {
465
+ "id": "tool_calls",
466
+ "label": "tool_calls",
467
+ "type": "array"
468
+ }
469
+ ],
470
+ "pinDefaults": {
471
+ "tools": [],
472
+ "system": "You file and connect a person's notes. Output JSON only, matching the schema.",
473
+ "temperature": 0.2,
474
+ "resp_schema": {
475
+ "type": "object",
476
+ "properties": {
477
+ "summary": {
478
+ "type": "string",
479
+ "description": "1-3 sentences"
480
+ },
481
+ "mentions": {
482
+ "type": "array",
483
+ "items": {
484
+ "type": "object",
485
+ "properties": {
486
+ "ref": {
487
+ "type": "string",
488
+ "description": "m1, m2, ..."
489
+ },
490
+ "name": {
491
+ "type": "string",
492
+ "description": "as written in the note"
493
+ },
494
+ "kind": {
495
+ "type": "string",
496
+ "enum": [
497
+ "person",
498
+ "org",
499
+ "project",
500
+ "concept",
501
+ "place",
502
+ "event",
503
+ "artifact",
504
+ "software",
505
+ "thing"
506
+ ]
507
+ },
508
+ "aliases": {
509
+ "type": "array",
510
+ "items": {
511
+ "type": "string"
512
+ },
513
+ "description": "other names as written in the note"
514
+ },
515
+ "role": {
516
+ "type": "string",
517
+ "description": "what the note says about it, one phrase"
518
+ }
519
+ },
520
+ "required": [
521
+ "ref",
522
+ "name",
523
+ "kind",
524
+ "aliases",
525
+ "role"
526
+ ]
527
+ }
528
+ },
529
+ "claims": {
530
+ "type": "array",
531
+ "items": {
532
+ "type": "object",
533
+ "properties": {
534
+ "subject": {
535
+ "type": "string",
536
+ "description": "a mention ref"
537
+ },
538
+ "predicate": {
539
+ "type": "string",
540
+ "description": "a CURIE from the vocabulary, or ex:snake_case"
541
+ },
542
+ "object": {
543
+ "type": "string",
544
+ "description": "a mention ref, or a literal value"
545
+ },
546
+ "object_is_literal": {
547
+ "type": "boolean"
548
+ },
549
+ "certainty": {
550
+ "type": "string",
551
+ "enum": [
552
+ "stated",
553
+ "probable",
554
+ "possible",
555
+ "reported",
556
+ "disputed"
557
+ ]
558
+ },
559
+ "stance": {
560
+ "type": "string",
561
+ "enum": [
562
+ "assert",
563
+ "revise",
564
+ "retract"
565
+ ]
566
+ },
567
+ "evidence": {
568
+ "type": "string",
569
+ "description": "verbatim excerpt of the note"
570
+ },
571
+ "valid_from": {
572
+ "type": [
573
+ "string",
574
+ "null"
575
+ ],
576
+ "description": "ISO date or null"
577
+ },
578
+ "valid_until": {
579
+ "type": [
580
+ "string",
581
+ "null"
582
+ ],
583
+ "description": "ISO date or null"
584
+ }
585
+ },
586
+ "required": [
587
+ "subject",
588
+ "predicate",
589
+ "object",
590
+ "object_is_literal",
591
+ "certainty",
592
+ "stance",
593
+ "evidence",
594
+ "valid_from",
595
+ "valid_until"
596
+ ]
597
+ }
598
+ },
599
+ "tasks": {
600
+ "type": "array",
601
+ "items": {
602
+ "type": "object",
603
+ "properties": {
604
+ "text": {
605
+ "type": "string"
606
+ },
607
+ "status": {
608
+ "type": "string",
609
+ "enum": [
610
+ "open",
611
+ "done"
612
+ ]
613
+ },
614
+ "due": {
615
+ "type": [
616
+ "string",
617
+ "null"
618
+ ],
619
+ "description": "ISO date or null"
620
+ }
621
+ },
622
+ "required": [
623
+ "text",
624
+ "status",
625
+ "due"
626
+ ]
627
+ }
628
+ },
629
+ "time_refs": {
630
+ "type": "array",
631
+ "items": {
632
+ "type": "object",
633
+ "properties": {
634
+ "text": {
635
+ "type": "string"
636
+ },
637
+ "iso": {
638
+ "type": [
639
+ "string",
640
+ "null"
641
+ ],
642
+ "description": "ISO or null"
643
+ }
644
+ },
645
+ "required": [
646
+ "text",
647
+ "iso"
648
+ ]
649
+ }
650
+ },
651
+ "topics": {
652
+ "type": "array",
653
+ "items": {
654
+ "type": "string"
655
+ }
656
+ }
657
+ },
658
+ "required": [
659
+ "summary",
660
+ "mentions",
661
+ "claims",
662
+ "tasks",
663
+ "time_refs",
664
+ "topics"
665
+ ]
666
+ }
667
+ }
668
+ }
669
+ },
670
+ {
671
+ "id": "keep_extraction",
672
+ "type": "add_to_list",
673
+ "position": {
674
+ "x": 3360.0,
675
+ "y": 0.0
676
+ },
677
+ "data": {
678
+ "nodeType": "add_to_list",
679
+ "label": "Keep the extraction",
680
+ "inputs": [
681
+ {
682
+ "id": "exec-in",
683
+ "label": "",
684
+ "type": "execution"
685
+ },
686
+ {
687
+ "id": "name",
688
+ "label": "name",
689
+ "type": "string"
690
+ },
691
+ {
692
+ "id": "item",
693
+ "label": "item",
694
+ "type": "any"
695
+ },
696
+ {
697
+ "id": "items",
698
+ "label": "items",
699
+ "type": "array"
700
+ }
701
+ ],
702
+ "outputs": [
703
+ {
704
+ "id": "exec-out",
705
+ "label": "",
706
+ "type": "execution"
707
+ },
708
+ {
709
+ "id": "list",
710
+ "label": "list",
711
+ "type": "array"
712
+ }
713
+ ],
714
+ "pinDefaults": {
715
+ "name": "extractions"
716
+ }
717
+ }
718
+ },
719
+ {
720
+ "id": "extractions",
721
+ "type": "get_var",
722
+ "position": {
723
+ "x": 2400.0,
724
+ "y": 718.0
725
+ },
726
+ "data": {
727
+ "nodeType": "get_var",
728
+ "label": "Get extractions",
729
+ "inputs": [
730
+ {
731
+ "id": "name",
732
+ "label": "name",
733
+ "type": "string"
734
+ },
735
+ {
736
+ "id": "default",
737
+ "label": "default",
738
+ "type": "any"
739
+ }
740
+ ],
741
+ "outputs": [
742
+ {
743
+ "id": "value",
744
+ "label": "value",
745
+ "type": "any"
746
+ }
747
+ ],
748
+ "pinDefaults": {
749
+ "name": "extractions",
750
+ "default": []
751
+ }
752
+ }
753
+ },
754
+ {
755
+ "id": "merge",
756
+ "type": "code",
757
+ "position": {
758
+ "x": 2880.0,
759
+ "y": 372.0
760
+ },
761
+ "data": {
762
+ "nodeType": "code",
763
+ "label": "Merge the sections",
764
+ "inputs": [
765
+ {
766
+ "id": "exec-in",
767
+ "label": "",
768
+ "type": "execution"
769
+ },
770
+ {
771
+ "id": "extractions",
772
+ "label": "extractions",
773
+ "type": "array"
774
+ },
775
+ {
776
+ "id": "permissions",
777
+ "label": "permissions",
778
+ "type": "string"
779
+ }
780
+ ],
781
+ "outputs": [
782
+ {
783
+ "id": "exec-out",
784
+ "label": "",
785
+ "type": "execution"
786
+ },
787
+ {
788
+ "id": "extraction",
789
+ "label": "extraction",
790
+ "type": "object"
791
+ },
792
+ {
793
+ "id": "mentions",
794
+ "label": "mentions",
795
+ "type": "array"
796
+ }
797
+ ],
798
+ "pinDefaults": {
799
+ "permissions": "sandbox"
800
+ },
801
+ "functionName": "transform",
802
+ "codeBody": "parts = [e for e in (extractions or []) if isinstance(e, dict)]\nif not parts:\n raise ValueError(\"The note could not be read.\")\nif len(parts) == 1:\n merged = parts[0]\nelse:\n mentions, refmap, by_key = [], {}, {}\n claims, tasks, time_refs, topics, summaries = [], [], [], [], []\n for i, part in enumerate(parts):\n for m in part.get(\"mentions\") or []:\n key = (str(m.get(\"name\") or \"\").casefold(), str(m.get(\"kind\") or \"\"))\n if key in by_key:\n kept = by_key[key]\n for a in m.get(\"aliases\") or []:\n if a not in kept[\"aliases\"]:\n kept[\"aliases\"].append(a)\n else:\n kept = dict(m, ref=\"m\" + str(len(mentions) + 1), aliases=list(m.get(\"aliases\") or []))\n by_key[key] = kept\n mentions.append(kept)\n refmap[(i, m.get(\"ref\"))] = kept[\"ref\"]\n for c in part.get(\"claims\") or []:\n c2 = dict(c)\n c2[\"subject\"] = refmap.get((i, c.get(\"subject\")), c.get(\"subject\"))\n if not c.get(\"object_is_literal\"):\n c2[\"object\"] = refmap.get((i, c.get(\"object\")), c.get(\"object\"))\n claims.append(c2)\n tasks.extend(part.get(\"tasks\") or [])\n time_refs.extend(part.get(\"time_refs\") or [])\n for t in part.get(\"topics\") or []:\n if t not in topics:\n topics.append(t)\n if part.get(\"summary\"):\n summaries.append(str(part.get(\"summary\")))\n merged = {\"summary\": \" \".join(summaries), \"mentions\": mentions, \"claims\": claims,\n \"tasks\": tasks, \"time_refs\": time_refs, \"topics\": topics}\nnames = [{\"ref\": m.get(\"ref\"), \"name\": m.get(\"name\"), \"kind\": m.get(\"kind\"), \"aliases\": m.get(\"aliases\") or []}\n for m in merged.get(\"mentions\") or []]\nreturn {\"extraction\": merged, \"mentions\": names}\n"
803
+ }
804
+ },
805
+ {
806
+ "id": "resolve_args",
807
+ "type": "code",
808
+ "position": {
809
+ "x": 3360.0,
810
+ "y": 320.0
811
+ },
812
+ "data": {
813
+ "nodeType": "code",
814
+ "label": "Find candidate entities: arguments",
815
+ "inputs": [
816
+ {
817
+ "id": "exec-in",
818
+ "label": "",
819
+ "type": "execution"
820
+ },
821
+ {
822
+ "id": "note_id",
823
+ "label": "note_id",
824
+ "type": "string"
825
+ },
826
+ {
827
+ "id": "mentions",
828
+ "label": "mentions",
829
+ "type": "array"
830
+ },
831
+ {
832
+ "id": "permissions",
833
+ "label": "permissions",
834
+ "type": "string"
835
+ }
836
+ ],
837
+ "outputs": [
838
+ {
839
+ "id": "exec-out",
840
+ "label": "",
841
+ "type": "execution"
842
+ },
843
+ {
844
+ "id": "tool_calls",
845
+ "label": "tool_calls",
846
+ "type": "array"
847
+ }
848
+ ],
849
+ "pinDefaults": {
850
+ "permissions": "sandbox"
851
+ },
852
+ "functionName": "transform",
853
+ "codeBody": "arguments = {}\nif note_id is not None and note_id != \"\":\n arguments[\"note_id\"] = note_id\nif mentions is not None and mentions != \"\":\n arguments[\"mentions\"] = mentions\nreturn {\"tool_calls\": [{\"name\": \"note_resolve_candidates\", \"call_id\": \"resolve\", \"arguments\": arguments}]}\n"
854
+ }
855
+ },
856
+ {
857
+ "id": "resolve",
858
+ "type": "tool_calls",
859
+ "position": {
860
+ "x": 3840.0,
861
+ "y": 0.0
862
+ },
863
+ "data": {
864
+ "nodeType": "tool_calls",
865
+ "label": "Find candidate entities",
866
+ "inputs": [
867
+ {
868
+ "id": "exec-in",
869
+ "label": "",
870
+ "type": "execution"
871
+ },
872
+ {
873
+ "id": "tool_calls",
874
+ "label": "tool_calls",
875
+ "type": "array"
876
+ },
877
+ {
878
+ "id": "allowed_tools",
879
+ "label": "allowed_tools",
880
+ "type": "array"
881
+ }
882
+ ],
883
+ "outputs": [
884
+ {
885
+ "id": "exec-out",
886
+ "label": "",
887
+ "type": "execution"
888
+ },
889
+ {
890
+ "id": "results",
891
+ "label": "results",
892
+ "type": "array"
893
+ },
894
+ {
895
+ "id": "success",
896
+ "label": "success",
897
+ "type": "boolean"
898
+ }
899
+ ],
900
+ "pinDefaults": {
901
+ "allowed_tools": [
902
+ "note_resolve_candidates"
903
+ ]
904
+ },
905
+ "effectConfig": {
906
+ "allowed_tools": [
907
+ "note_resolve_candidates"
908
+ ]
909
+ }
910
+ }
911
+ },
912
+ {
913
+ "id": "resolve_out",
914
+ "type": "code",
915
+ "position": {
916
+ "x": 4320.0,
917
+ "y": 0.0
918
+ },
919
+ "data": {
920
+ "nodeType": "code",
921
+ "label": "Find candidate entities: result",
922
+ "inputs": [
923
+ {
924
+ "id": "exec-in",
925
+ "label": "",
926
+ "type": "execution"
927
+ },
928
+ {
929
+ "id": "results",
930
+ "label": "results",
931
+ "type": "array"
932
+ },
933
+ {
934
+ "id": "permissions",
935
+ "label": "permissions",
936
+ "type": "string"
937
+ }
938
+ ],
939
+ "outputs": [
940
+ {
941
+ "id": "exec-out",
942
+ "label": "",
943
+ "type": "execution"
944
+ },
945
+ {
946
+ "id": "mentions",
947
+ "label": "mentions",
948
+ "type": "array"
949
+ },
950
+ {
951
+ "id": "tool_output",
952
+ "label": "tool_output",
953
+ "type": "object"
954
+ }
955
+ ],
956
+ "pinDefaults": {
957
+ "permissions": "sandbox"
958
+ },
959
+ "functionName": "transform",
960
+ "codeBody": "r = results[0] if isinstance(results, list) and results else None\nfailure = None\nout = None\nif not isinstance(r, dict):\n failure = \"note_resolve_candidates returned no result.\"\nelif not r.get(\"success\"):\n failure = str(r.get(\"error\") or \"note_resolve_candidates failed.\")\nelse:\n out = r.get(\"output\")\n if not isinstance(out, dict):\n failure = \"note_resolve_candidates returned something other than an object.\"\nif failure is not None:\n raise ValueError(failure)\nreturn dict(out, tool_output=out)\n"
961
+ }
962
+ },
963
+ {
964
+ "id": "link_prompt",
965
+ "type": "string_template",
966
+ "position": {
967
+ "x": 4320.0,
968
+ "y": 320.0
969
+ },
970
+ "data": {
971
+ "nodeType": "string_template",
972
+ "label": "Linking prompt",
973
+ "inputs": [
974
+ {
975
+ "id": "template",
976
+ "label": "template",
977
+ "type": "string"
978
+ },
979
+ {
980
+ "id": "note",
981
+ "label": "note",
982
+ "type": "any"
983
+ },
984
+ {
985
+ "id": "extraction",
986
+ "label": "extraction",
987
+ "type": "any"
988
+ },
989
+ {
990
+ "id": "candidates",
991
+ "label": "candidates",
992
+ "type": "any"
993
+ },
994
+ {
995
+ "id": "packet",
996
+ "label": "packet",
997
+ "type": "any"
998
+ }
999
+ ],
1000
+ "outputs": [
1001
+ {
1002
+ "id": "result",
1003
+ "label": "result",
1004
+ "type": "string"
1005
+ }
1006
+ ],
1007
+ "pinDefaults": {
1008
+ "template": "You decide how one note changes what a person's notebook knows. Deterministic lookups found the candidates; you judge.\n\nThe note: {{note}}\n\nWhat the note says (merged extraction; claims and tasks are numbered from 0 in order):\n{{extraction}}\n\nCandidate existing entities for each mention (refer to a candidate by its index in that mention's list):\n{{candidates}}\n\nContext packet (existing claims and open tasks carry an `index`; refer to them by that index only):\n{{packet}}\n\nFor each mention give a `decision`:\n- `reuse` with `candidate` = the index of the entity it is;\n- `create` when no candidate is the same thing;\n- `merge` with `merge_candidates` = two candidate indexes that are the same entity (the first one stays), when the note shows that two existing records are one;\n- `unsure` when you cannot tell; it is kept apart and marked as a close match for later consolidation.\nGive the preferred `name` (as the author writes it), its `kind`, other `aliases`, a short `reason`, and a `summary`: one sentence saying what the notebook now knows about the entity. The summary is required when you `create` it (or answer `unsure`), and when this note tells something new about a reused or merged entity (rewrite the current summary into one updated sentence). Use null only for a reused entity this note adds nothing to.\n\nFor each extracted claim (by `index`) give `relation_to_existing`: `new`, `restates` (the same statement seen again), `refines` (adds detail; the old one stays true), `supersedes` (the old one is no longer true) or `contradicts` (both are kept and marked disputed), with `existing` = the index of the existing claim, and a short `reason`.\n\nFor each extracted task (by `index`) give `closes_open_task` = the index of the open task it reports done, or null.\n\nEnd with `revision_summary`: one sentence saying what this note changed.\n\nRules:\n- Use only the note and the provided context; never invent entities, ids or dates.\n- Prefer reusing an existing entity when the candidate list contains it; create sparingly.\n- Keep names as written by the author; put variants in aliases.\n- When unsure whether two things are the same, say `unsure` rather than guessing.\n- Output JSON only, matching the schema.\n"
1009
+ }
1010
+ }
1011
+ },
1012
+ {
1013
+ "id": "link",
1014
+ "type": "llm_call",
1015
+ "position": {
1016
+ "x": 4800.0,
1017
+ "y": 0.0
1018
+ },
1019
+ "data": {
1020
+ "nodeType": "llm_call",
1021
+ "label": "Link",
1022
+ "inputs": [
1023
+ {
1024
+ "id": "exec-in",
1025
+ "label": "",
1026
+ "type": "execution"
1027
+ },
1028
+ {
1029
+ "id": "provider",
1030
+ "label": "provider",
1031
+ "type": "provider_text"
1032
+ },
1033
+ {
1034
+ "id": "model",
1035
+ "label": "model",
1036
+ "type": "model"
1037
+ },
1038
+ {
1039
+ "id": "system",
1040
+ "label": "system",
1041
+ "type": "string"
1042
+ },
1043
+ {
1044
+ "id": "prompt",
1045
+ "label": "prompt",
1046
+ "type": "string"
1047
+ },
1048
+ {
1049
+ "id": "tools",
1050
+ "label": "tools",
1051
+ "type": "tools"
1052
+ },
1053
+ {
1054
+ "id": "temperature",
1055
+ "label": "temperature",
1056
+ "type": "number"
1057
+ },
1058
+ {
1059
+ "id": "resp_schema",
1060
+ "label": "resp_schema",
1061
+ "type": "json_schema"
1062
+ }
1063
+ ],
1064
+ "outputs": [
1065
+ {
1066
+ "id": "exec-out",
1067
+ "label": "",
1068
+ "type": "execution"
1069
+ },
1070
+ {
1071
+ "id": "response",
1072
+ "label": "response",
1073
+ "type": "string"
1074
+ },
1075
+ {
1076
+ "id": "data",
1077
+ "label": "data",
1078
+ "type": "object"
1079
+ },
1080
+ {
1081
+ "id": "success",
1082
+ "label": "success",
1083
+ "type": "boolean"
1084
+ },
1085
+ {
1086
+ "id": "meta",
1087
+ "label": "meta",
1088
+ "type": "object"
1089
+ },
1090
+ {
1091
+ "id": "tool_calls",
1092
+ "label": "tool_calls",
1093
+ "type": "array"
1094
+ }
1095
+ ],
1096
+ "pinDefaults": {
1097
+ "tools": [],
1098
+ "system": "You file and connect a person's notes. Output JSON only, matching the schema.",
1099
+ "temperature": 0.2,
1100
+ "resp_schema": {
1101
+ "type": "object",
1102
+ "properties": {
1103
+ "mentions": {
1104
+ "type": "array",
1105
+ "items": {
1106
+ "type": "object",
1107
+ "properties": {
1108
+ "ref": {
1109
+ "type": "string",
1110
+ "description": "the mention ref from the extraction"
1111
+ },
1112
+ "decision": {
1113
+ "type": "string",
1114
+ "enum": [
1115
+ "reuse",
1116
+ "create",
1117
+ "merge",
1118
+ "unsure"
1119
+ ]
1120
+ },
1121
+ "candidate": {
1122
+ "type": [
1123
+ "integer",
1124
+ "null"
1125
+ ],
1126
+ "description": "index in this mention's candidate list"
1127
+ },
1128
+ "merge_candidates": {
1129
+ "type": "array",
1130
+ "items": {
1131
+ "type": "integer"
1132
+ },
1133
+ "description": "two candidate indexes that are the same entity"
1134
+ },
1135
+ "name": {
1136
+ "type": "string",
1137
+ "description": "preferred name"
1138
+ },
1139
+ "kind": {
1140
+ "type": "string",
1141
+ "enum": [
1142
+ "person",
1143
+ "org",
1144
+ "project",
1145
+ "concept",
1146
+ "place",
1147
+ "event",
1148
+ "artifact",
1149
+ "software",
1150
+ "thing"
1151
+ ]
1152
+ },
1153
+ "aliases": {
1154
+ "type": "array",
1155
+ "items": {
1156
+ "type": "string"
1157
+ }
1158
+ },
1159
+ "summary": {
1160
+ "type": [
1161
+ "string",
1162
+ "null"
1163
+ ],
1164
+ "minLength": 1,
1165
+ "description": "one sentence about the entity: required for create and unsure, and for a reused or merged entity this note tells something new about; null only for a reused entity the note adds nothing to"
1166
+ },
1167
+ "reason": {
1168
+ "type": "string",
1169
+ "description": "short"
1170
+ }
1171
+ },
1172
+ "required": [
1173
+ "ref",
1174
+ "decision",
1175
+ "candidate",
1176
+ "merge_candidates",
1177
+ "name",
1178
+ "kind",
1179
+ "aliases",
1180
+ "summary",
1181
+ "reason"
1182
+ ]
1183
+ }
1184
+ },
1185
+ "claims": {
1186
+ "type": "array",
1187
+ "items": {
1188
+ "type": "object",
1189
+ "properties": {
1190
+ "index": {
1191
+ "type": "integer",
1192
+ "description": "index of the claim in the extraction"
1193
+ },
1194
+ "relation_to_existing": {
1195
+ "type": "string",
1196
+ "enum": [
1197
+ "new",
1198
+ "restates",
1199
+ "refines",
1200
+ "supersedes",
1201
+ "contradicts"
1202
+ ]
1203
+ },
1204
+ "existing": {
1205
+ "type": [
1206
+ "integer",
1207
+ "null"
1208
+ ],
1209
+ "description": "index of the existing claim in the packet"
1210
+ },
1211
+ "reason": {
1212
+ "type": "string",
1213
+ "description": "short"
1214
+ }
1215
+ },
1216
+ "required": [
1217
+ "index",
1218
+ "relation_to_existing",
1219
+ "existing",
1220
+ "reason"
1221
+ ]
1222
+ }
1223
+ },
1224
+ "tasks": {
1225
+ "type": "array",
1226
+ "items": {
1227
+ "type": "object",
1228
+ "properties": {
1229
+ "index": {
1230
+ "type": "integer",
1231
+ "description": "index of the task in the extraction"
1232
+ },
1233
+ "closes_open_task": {
1234
+ "type": [
1235
+ "integer",
1236
+ "null"
1237
+ ],
1238
+ "description": "index of the open task it closes"
1239
+ }
1240
+ },
1241
+ "required": [
1242
+ "index",
1243
+ "closes_open_task"
1244
+ ]
1245
+ }
1246
+ },
1247
+ "revision_summary": {
1248
+ "type": "string",
1249
+ "description": "one sentence"
1250
+ }
1251
+ },
1252
+ "required": [
1253
+ "mentions",
1254
+ "claims",
1255
+ "tasks",
1256
+ "revision_summary"
1257
+ ]
1258
+ }
1259
+ }
1260
+ }
1261
+ },
1262
+ {
1263
+ "id": "apply_args",
1264
+ "type": "code",
1265
+ "position": {
1266
+ "x": 5280.0,
1267
+ "y": 0.0
1268
+ },
1269
+ "data": {
1270
+ "nodeType": "code",
1271
+ "label": "Revise the graph: arguments",
1272
+ "inputs": [
1273
+ {
1274
+ "id": "exec-in",
1275
+ "label": "",
1276
+ "type": "execution"
1277
+ },
1278
+ {
1279
+ "id": "note_id",
1280
+ "label": "note_id",
1281
+ "type": "string"
1282
+ },
1283
+ {
1284
+ "id": "extraction",
1285
+ "label": "extraction",
1286
+ "type": "object"
1287
+ },
1288
+ {
1289
+ "id": "linking",
1290
+ "label": "linking",
1291
+ "type": "object"
1292
+ },
1293
+ {
1294
+ "id": "permissions",
1295
+ "label": "permissions",
1296
+ "type": "string"
1297
+ }
1298
+ ],
1299
+ "outputs": [
1300
+ {
1301
+ "id": "exec-out",
1302
+ "label": "",
1303
+ "type": "execution"
1304
+ },
1305
+ {
1306
+ "id": "tool_calls",
1307
+ "label": "tool_calls",
1308
+ "type": "array"
1309
+ }
1310
+ ],
1311
+ "pinDefaults": {
1312
+ "permissions": "sandbox"
1313
+ },
1314
+ "functionName": "transform",
1315
+ "codeBody": "arguments = {}\nif note_id is not None and note_id != \"\":\n arguments[\"note_id\"] = note_id\nif extraction is not None and extraction != \"\":\n arguments[\"extraction\"] = extraction\nif linking is not None and linking != \"\":\n arguments[\"linking\"] = linking\nreturn {\"tool_calls\": [{\"name\": \"note_apply_revision\", \"call_id\": \"apply\", \"arguments\": arguments}]}\n"
1316
+ }
1317
+ },
1318
+ {
1319
+ "id": "apply",
1320
+ "type": "tool_calls",
1321
+ "position": {
1322
+ "x": 5760.0,
1323
+ "y": 0.0
1324
+ },
1325
+ "data": {
1326
+ "nodeType": "tool_calls",
1327
+ "label": "Revise the graph",
1328
+ "inputs": [
1329
+ {
1330
+ "id": "exec-in",
1331
+ "label": "",
1332
+ "type": "execution"
1333
+ },
1334
+ {
1335
+ "id": "tool_calls",
1336
+ "label": "tool_calls",
1337
+ "type": "array"
1338
+ },
1339
+ {
1340
+ "id": "allowed_tools",
1341
+ "label": "allowed_tools",
1342
+ "type": "array"
1343
+ }
1344
+ ],
1345
+ "outputs": [
1346
+ {
1347
+ "id": "exec-out",
1348
+ "label": "",
1349
+ "type": "execution"
1350
+ },
1351
+ {
1352
+ "id": "results",
1353
+ "label": "results",
1354
+ "type": "array"
1355
+ },
1356
+ {
1357
+ "id": "success",
1358
+ "label": "success",
1359
+ "type": "boolean"
1360
+ }
1361
+ ],
1362
+ "pinDefaults": {
1363
+ "allowed_tools": [
1364
+ "note_apply_revision"
1365
+ ]
1366
+ },
1367
+ "effectConfig": {
1368
+ "allowed_tools": [
1369
+ "note_apply_revision"
1370
+ ]
1371
+ }
1372
+ }
1373
+ },
1374
+ {
1375
+ "id": "apply_out",
1376
+ "type": "code",
1377
+ "position": {
1378
+ "x": 6240.0,
1379
+ "y": 0.0
1380
+ },
1381
+ "data": {
1382
+ "nodeType": "code",
1383
+ "label": "Revise the graph: result",
1384
+ "inputs": [
1385
+ {
1386
+ "id": "exec-in",
1387
+ "label": "",
1388
+ "type": "execution"
1389
+ },
1390
+ {
1391
+ "id": "results",
1392
+ "label": "results",
1393
+ "type": "array"
1394
+ },
1395
+ {
1396
+ "id": "permissions",
1397
+ "label": "permissions",
1398
+ "type": "string"
1399
+ }
1400
+ ],
1401
+ "outputs": [
1402
+ {
1403
+ "id": "exec-out",
1404
+ "label": "",
1405
+ "type": "execution"
1406
+ },
1407
+ {
1408
+ "id": "revision_id",
1409
+ "label": "revision_id",
1410
+ "type": "string"
1411
+ },
1412
+ {
1413
+ "id": "summary",
1414
+ "label": "summary",
1415
+ "type": "string"
1416
+ },
1417
+ {
1418
+ "id": "tool_output",
1419
+ "label": "tool_output",
1420
+ "type": "object"
1421
+ }
1422
+ ],
1423
+ "pinDefaults": {
1424
+ "permissions": "sandbox"
1425
+ },
1426
+ "functionName": "transform",
1427
+ "codeBody": "r = results[0] if isinstance(results, list) and results else None\nfailure = None\nout = None\nif not isinstance(r, dict):\n failure = \"note_apply_revision returned no result.\"\nelif not r.get(\"success\"):\n failure = str(r.get(\"error\") or \"note_apply_revision failed.\")\nelse:\n out = r.get(\"output\")\n if not isinstance(out, dict):\n failure = \"note_apply_revision returned something other than an object.\"\nif failure is not None:\n raise ValueError(failure)\nreturn dict(out, tool_output=out)\n"
1428
+ }
1429
+ },
1430
+ {
1431
+ "id": "end",
1432
+ "type": "on_flow_end",
1433
+ "position": {
1434
+ "x": 6720.0,
1435
+ "y": 0.0
1436
+ },
1437
+ "data": {
1438
+ "nodeType": "on_flow_end",
1439
+ "label": "Done",
1440
+ "inputs": [
1441
+ {
1442
+ "id": "exec-in",
1443
+ "label": "",
1444
+ "type": "execution"
1445
+ },
1446
+ {
1447
+ "id": "response",
1448
+ "label": "response",
1449
+ "type": "string"
1450
+ },
1451
+ {
1452
+ "id": "note_id",
1453
+ "label": "note_id",
1454
+ "type": "string"
1455
+ },
1456
+ {
1457
+ "id": "revision_id",
1458
+ "label": "revision_id",
1459
+ "type": "string"
1460
+ },
1461
+ {
1462
+ "id": "revision",
1463
+ "label": "revision",
1464
+ "type": "object"
1465
+ },
1466
+ {
1467
+ "id": "status",
1468
+ "label": "status",
1469
+ "type": "string"
1470
+ }
1471
+ ],
1472
+ "outputs": [],
1473
+ "pinDefaults": {
1474
+ "status": "processed"
1475
+ }
1476
+ }
1477
+ }
1478
+ ],
1479
+ "edges": [
1480
+ {
1481
+ "id": "e-start-note_id-context_args-note_id",
1482
+ "source": "start",
1483
+ "sourceHandle": "note_id",
1484
+ "target": "context_args",
1485
+ "targetHandle": "note_id"
1486
+ },
1487
+ {
1488
+ "id": "e-start-exec-out-context_args-exec-in",
1489
+ "source": "start",
1490
+ "sourceHandle": "exec-out",
1491
+ "target": "context_args",
1492
+ "targetHandle": "exec-in"
1493
+ },
1494
+ {
1495
+ "id": "e-context_args-tool_calls-context-tool_calls",
1496
+ "source": "context_args",
1497
+ "sourceHandle": "tool_calls",
1498
+ "target": "context",
1499
+ "targetHandle": "tool_calls"
1500
+ },
1501
+ {
1502
+ "id": "e-context_args-exec-out-context-exec-in",
1503
+ "source": "context_args",
1504
+ "sourceHandle": "exec-out",
1505
+ "target": "context",
1506
+ "targetHandle": "exec-in"
1507
+ },
1508
+ {
1509
+ "id": "e-context-results-context_out-results",
1510
+ "source": "context",
1511
+ "sourceHandle": "results",
1512
+ "target": "context_out",
1513
+ "targetHandle": "results"
1514
+ },
1515
+ {
1516
+ "id": "e-context-exec-out-context_out-exec-in",
1517
+ "source": "context",
1518
+ "sourceHandle": "exec-out",
1519
+ "target": "context_out",
1520
+ "targetHandle": "exec-in"
1521
+ },
1522
+ {
1523
+ "id": "e-context_out-sections-sections-sections",
1524
+ "source": "context_out",
1525
+ "sourceHandle": "sections",
1526
+ "target": "sections",
1527
+ "targetHandle": "sections"
1528
+ },
1529
+ {
1530
+ "id": "e-context_out-exec-out-sections-exec-in",
1531
+ "source": "context_out",
1532
+ "sourceHandle": "exec-out",
1533
+ "target": "sections",
1534
+ "targetHandle": "exec-in"
1535
+ },
1536
+ {
1537
+ "id": "e-sections-items-each_section-items",
1538
+ "source": "sections",
1539
+ "sourceHandle": "items",
1540
+ "target": "each_section",
1541
+ "targetHandle": "items"
1542
+ },
1543
+ {
1544
+ "id": "e-sections-exec-out-each_section-exec-in",
1545
+ "source": "sections",
1546
+ "sourceHandle": "exec-out",
1547
+ "target": "each_section",
1548
+ "targetHandle": "exec-in"
1549
+ },
1550
+ {
1551
+ "id": "e-context_out-note-extract_prompt-note",
1552
+ "source": "context_out",
1553
+ "sourceHandle": "note",
1554
+ "target": "extract_prompt",
1555
+ "targetHandle": "note"
1556
+ },
1557
+ {
1558
+ "id": "e-each_section-item-extract_prompt-section",
1559
+ "source": "each_section",
1560
+ "sourceHandle": "item",
1561
+ "target": "extract_prompt",
1562
+ "targetHandle": "section"
1563
+ },
1564
+ {
1565
+ "id": "e-context_out-similar_notes-extract_prompt-similar_notes",
1566
+ "source": "context_out",
1567
+ "sourceHandle": "similar_notes",
1568
+ "target": "extract_prompt",
1569
+ "targetHandle": "similar_notes"
1570
+ },
1571
+ {
1572
+ "id": "e-context_out-candidate_entities-extract_prompt-candidate_entities",
1573
+ "source": "context_out",
1574
+ "sourceHandle": "candidate_entities",
1575
+ "target": "extract_prompt",
1576
+ "targetHandle": "candidate_entities"
1577
+ },
1578
+ {
1579
+ "id": "e-context_out-open_tasks-extract_prompt-open_tasks",
1580
+ "source": "context_out",
1581
+ "sourceHandle": "open_tasks",
1582
+ "target": "extract_prompt",
1583
+ "targetHandle": "open_tasks"
1584
+ },
1585
+ {
1586
+ "id": "e-context_out-topics-extract_prompt-topics",
1587
+ "source": "context_out",
1588
+ "sourceHandle": "topics",
1589
+ "target": "extract_prompt",
1590
+ "targetHandle": "topics"
1591
+ },
1592
+ {
1593
+ "id": "e-context_out-vocabulary-extract_prompt-vocabulary",
1594
+ "source": "context_out",
1595
+ "sourceHandle": "vocabulary",
1596
+ "target": "extract_prompt",
1597
+ "targetHandle": "vocabulary"
1598
+ },
1599
+ {
1600
+ "id": "e-extract_prompt-result-extract-prompt",
1601
+ "source": "extract_prompt",
1602
+ "sourceHandle": "result",
1603
+ "target": "extract",
1604
+ "targetHandle": "prompt"
1605
+ },
1606
+ {
1607
+ "id": "e-start-provider-extract-provider",
1608
+ "source": "start",
1609
+ "sourceHandle": "provider",
1610
+ "target": "extract",
1611
+ "targetHandle": "provider"
1612
+ },
1613
+ {
1614
+ "id": "e-start-model-extract-model",
1615
+ "source": "start",
1616
+ "sourceHandle": "model",
1617
+ "target": "extract",
1618
+ "targetHandle": "model"
1619
+ },
1620
+ {
1621
+ "id": "e-each_section-loop-extract-exec-in",
1622
+ "source": "each_section",
1623
+ "sourceHandle": "loop",
1624
+ "target": "extract",
1625
+ "targetHandle": "exec-in"
1626
+ },
1627
+ {
1628
+ "id": "e-extract-data-keep_extraction-item",
1629
+ "source": "extract",
1630
+ "sourceHandle": "data",
1631
+ "target": "keep_extraction",
1632
+ "targetHandle": "item"
1633
+ },
1634
+ {
1635
+ "id": "e-extract-exec-out-keep_extraction-exec-in",
1636
+ "source": "extract",
1637
+ "sourceHandle": "exec-out",
1638
+ "target": "keep_extraction",
1639
+ "targetHandle": "exec-in"
1640
+ },
1641
+ {
1642
+ "id": "e-extractions-value-merge-extractions",
1643
+ "source": "extractions",
1644
+ "sourceHandle": "value",
1645
+ "target": "merge",
1646
+ "targetHandle": "extractions"
1647
+ },
1648
+ {
1649
+ "id": "e-each_section-done-merge-exec-in",
1650
+ "source": "each_section",
1651
+ "sourceHandle": "done",
1652
+ "target": "merge",
1653
+ "targetHandle": "exec-in"
1654
+ },
1655
+ {
1656
+ "id": "e-start-note_id-resolve_args-note_id",
1657
+ "source": "start",
1658
+ "sourceHandle": "note_id",
1659
+ "target": "resolve_args",
1660
+ "targetHandle": "note_id"
1661
+ },
1662
+ {
1663
+ "id": "e-merge-mentions-resolve_args-mentions",
1664
+ "source": "merge",
1665
+ "sourceHandle": "mentions",
1666
+ "target": "resolve_args",
1667
+ "targetHandle": "mentions"
1668
+ },
1669
+ {
1670
+ "id": "e-merge-exec-out-resolve_args-exec-in",
1671
+ "source": "merge",
1672
+ "sourceHandle": "exec-out",
1673
+ "target": "resolve_args",
1674
+ "targetHandle": "exec-in"
1675
+ },
1676
+ {
1677
+ "id": "e-resolve_args-tool_calls-resolve-tool_calls",
1678
+ "source": "resolve_args",
1679
+ "sourceHandle": "tool_calls",
1680
+ "target": "resolve",
1681
+ "targetHandle": "tool_calls"
1682
+ },
1683
+ {
1684
+ "id": "e-resolve_args-exec-out-resolve-exec-in",
1685
+ "source": "resolve_args",
1686
+ "sourceHandle": "exec-out",
1687
+ "target": "resolve",
1688
+ "targetHandle": "exec-in"
1689
+ },
1690
+ {
1691
+ "id": "e-resolve-results-resolve_out-results",
1692
+ "source": "resolve",
1693
+ "sourceHandle": "results",
1694
+ "target": "resolve_out",
1695
+ "targetHandle": "results"
1696
+ },
1697
+ {
1698
+ "id": "e-resolve-exec-out-resolve_out-exec-in",
1699
+ "source": "resolve",
1700
+ "sourceHandle": "exec-out",
1701
+ "target": "resolve_out",
1702
+ "targetHandle": "exec-in"
1703
+ },
1704
+ {
1705
+ "id": "e-context_out-note-link_prompt-note",
1706
+ "source": "context_out",
1707
+ "sourceHandle": "note",
1708
+ "target": "link_prompt",
1709
+ "targetHandle": "note"
1710
+ },
1711
+ {
1712
+ "id": "e-merge-extraction-link_prompt-extraction",
1713
+ "source": "merge",
1714
+ "sourceHandle": "extraction",
1715
+ "target": "link_prompt",
1716
+ "targetHandle": "extraction"
1717
+ },
1718
+ {
1719
+ "id": "e-resolve_out-mentions-link_prompt-candidates",
1720
+ "source": "resolve_out",
1721
+ "sourceHandle": "mentions",
1722
+ "target": "link_prompt",
1723
+ "targetHandle": "candidates"
1724
+ },
1725
+ {
1726
+ "id": "e-context_out-tool_output-link_prompt-packet",
1727
+ "source": "context_out",
1728
+ "sourceHandle": "tool_output",
1729
+ "target": "link_prompt",
1730
+ "targetHandle": "packet"
1731
+ },
1732
+ {
1733
+ "id": "e-link_prompt-result-link-prompt",
1734
+ "source": "link_prompt",
1735
+ "sourceHandle": "result",
1736
+ "target": "link",
1737
+ "targetHandle": "prompt"
1738
+ },
1739
+ {
1740
+ "id": "e-start-provider-link-provider",
1741
+ "source": "start",
1742
+ "sourceHandle": "provider",
1743
+ "target": "link",
1744
+ "targetHandle": "provider"
1745
+ },
1746
+ {
1747
+ "id": "e-start-model-link-model",
1748
+ "source": "start",
1749
+ "sourceHandle": "model",
1750
+ "target": "link",
1751
+ "targetHandle": "model"
1752
+ },
1753
+ {
1754
+ "id": "e-resolve_out-exec-out-link-exec-in",
1755
+ "source": "resolve_out",
1756
+ "sourceHandle": "exec-out",
1757
+ "target": "link",
1758
+ "targetHandle": "exec-in"
1759
+ },
1760
+ {
1761
+ "id": "e-start-note_id-apply_args-note_id",
1762
+ "source": "start",
1763
+ "sourceHandle": "note_id",
1764
+ "target": "apply_args",
1765
+ "targetHandle": "note_id"
1766
+ },
1767
+ {
1768
+ "id": "e-merge-extraction-apply_args-extraction",
1769
+ "source": "merge",
1770
+ "sourceHandle": "extraction",
1771
+ "target": "apply_args",
1772
+ "targetHandle": "extraction"
1773
+ },
1774
+ {
1775
+ "id": "e-link-data-apply_args-linking",
1776
+ "source": "link",
1777
+ "sourceHandle": "data",
1778
+ "target": "apply_args",
1779
+ "targetHandle": "linking"
1780
+ },
1781
+ {
1782
+ "id": "e-link-exec-out-apply_args-exec-in",
1783
+ "source": "link",
1784
+ "sourceHandle": "exec-out",
1785
+ "target": "apply_args",
1786
+ "targetHandle": "exec-in"
1787
+ },
1788
+ {
1789
+ "id": "e-apply_args-tool_calls-apply-tool_calls",
1790
+ "source": "apply_args",
1791
+ "sourceHandle": "tool_calls",
1792
+ "target": "apply",
1793
+ "targetHandle": "tool_calls"
1794
+ },
1795
+ {
1796
+ "id": "e-apply_args-exec-out-apply-exec-in",
1797
+ "source": "apply_args",
1798
+ "sourceHandle": "exec-out",
1799
+ "target": "apply",
1800
+ "targetHandle": "exec-in"
1801
+ },
1802
+ {
1803
+ "id": "e-apply-results-apply_out-results",
1804
+ "source": "apply",
1805
+ "sourceHandle": "results",
1806
+ "target": "apply_out",
1807
+ "targetHandle": "results"
1808
+ },
1809
+ {
1810
+ "id": "e-apply-exec-out-apply_out-exec-in",
1811
+ "source": "apply",
1812
+ "sourceHandle": "exec-out",
1813
+ "target": "apply_out",
1814
+ "targetHandle": "exec-in"
1815
+ },
1816
+ {
1817
+ "id": "e-apply_out-summary-end-response",
1818
+ "source": "apply_out",
1819
+ "sourceHandle": "summary",
1820
+ "target": "end",
1821
+ "targetHandle": "response"
1822
+ },
1823
+ {
1824
+ "id": "e-start-note_id-end-note_id",
1825
+ "source": "start",
1826
+ "sourceHandle": "note_id",
1827
+ "target": "end",
1828
+ "targetHandle": "note_id"
1829
+ },
1830
+ {
1831
+ "id": "e-apply_out-revision_id-end-revision_id",
1832
+ "source": "apply_out",
1833
+ "sourceHandle": "revision_id",
1834
+ "target": "end",
1835
+ "targetHandle": "revision_id"
1836
+ },
1837
+ {
1838
+ "id": "e-apply_out-tool_output-end-revision",
1839
+ "source": "apply_out",
1840
+ "sourceHandle": "tool_output",
1841
+ "target": "end",
1842
+ "targetHandle": "revision"
1843
+ },
1844
+ {
1845
+ "id": "e-apply_out-exec-out-end-exec-in",
1846
+ "source": "apply_out",
1847
+ "sourceHandle": "exec-out",
1848
+ "target": "end",
1849
+ "targetHandle": "exec-in"
1850
+ }
1851
+ ],
1852
+ "entryNode": "start"
1853
+ }