datanotes 3.3.1 → 3.4.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 (68) hide show
  1. package/SECURITY.md +5 -3
  2. package/dist/api/extensions.cjs +141 -5
  3. package/dist/api/extensions.js +141 -5
  4. package/dist/api/index.cjs +141 -5
  5. package/dist/api/index.js +141 -5
  6. package/dist/api/mcp.cjs +141 -5
  7. package/dist/api/mcp.js +141 -5
  8. package/dist/datanotes.cjs +1672 -600
  9. package/dist/docs/administration/extensions.md +2 -2
  10. package/dist/docs/api/operations/add_column.md +1 -0
  11. package/dist/docs/api/operations/check_table.md +1 -0
  12. package/dist/docs/api/operations/create_table.md +1 -0
  13. package/dist/docs/api/operations/describe_database.md +2 -0
  14. package/dist/docs/api/operations/describe_history.md +1 -0
  15. package/dist/docs/api/operations/describe_semantic_index.md +1 -0
  16. package/dist/docs/api/operations/describe_table.md +1 -0
  17. package/dist/docs/api/operations/graph_neighbors.md +1 -0
  18. package/dist/docs/api/operations/graph_path.md +1 -0
  19. package/dist/docs/api/operations/graph_traverse.md +1 -0
  20. package/dist/docs/api/operations/infer_table.md +1 -0
  21. package/dist/docs/api/operations/list_changes.md +1 -0
  22. package/dist/docs/api/operations/list_folder.md +1 -0
  23. package/dist/docs/api/operations/list_link_targets.md +1 -0
  24. package/dist/docs/api/operations/list_migrations.md +1 -0
  25. package/dist/docs/api/operations/list_tables.md +2 -0
  26. package/dist/docs/api/operations/list_webhooks.md +1 -0
  27. package/dist/docs/api/operations/read_note.md +1 -0
  28. package/dist/docs/api/operations/search.md +39 -0
  29. package/dist/docs/api/operations/search_notes.md +1 -0
  30. package/dist/docs/api/operations/select_rows.md +1 -0
  31. package/dist/docs/api/operations/semantic_search.md +1 -0
  32. package/dist/docs/api/operations/table_changes.md +1 -0
  33. package/dist/docs/api/operations/tags/queries.md +1 -0
  34. package/dist/docs/api/operations/tags/tokens.md +1 -1
  35. package/dist/docs/api/operations/tokens_create.md +1 -0
  36. package/dist/docs/api/operations/tokens_update.md +2 -1
  37. package/dist/docs/api.md +5 -4
  38. package/dist/docs/develop/build-an-app.md +2 -1
  39. package/dist/docs/develop/change-feed-and-webhooks.md +1 -1
  40. package/dist/docs/develop/http-api.md +1 -1
  41. package/dist/docs/guides/data-quality/check-constraints.md +10 -10
  42. package/dist/docs/guides/data-quality/hand-edits.md +8 -8
  43. package/dist/docs/guides/database-objects/bases.md +11 -11
  44. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +10 -10
  45. package/dist/docs/guides/database-objects/columns.md +241 -38
  46. package/dist/docs/guides/database-objects/relations.md +28 -28
  47. package/dist/docs/guides/database-objects/tables.md +26 -26
  48. package/dist/docs/guides/database-objects/views.md +19 -19
  49. package/dist/docs/guides/history/change-data-feed.md +34 -34
  50. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  51. package/dist/docs/guides/history/restore.md +20 -20
  52. package/dist/docs/guides/history/table-history.md +31 -31
  53. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  54. package/dist/docs/guides/read-and-write/import-notes.md +20 -20
  55. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  56. package/dist/docs/guides/search/hybrid.md +162 -0
  57. package/dist/docs/guides/search/text.md +1 -1
  58. package/dist/docs/guides/security/security-model.md +5 -3
  59. package/dist/docs/guides/security/tokens.md +121 -8
  60. package/dist/docs/reference/cli.md +1 -1
  61. package/dist/docs/reference/glossary.md +1 -1
  62. package/dist/docs/reference/operations/auxiliary.md +2 -2
  63. package/dist/docs/reference/operations/queries.md +16 -0
  64. package/dist/docs/reference/operations/schema.md +2 -2
  65. package/dist/docs/reference/operations.md +2 -1
  66. package/dist/docs/release-notes.md +43 -0
  67. package/dist/docs/start/connect-agents.md +10 -3
  68. package/package.json +1 -1
@@ -98,7 +98,7 @@ Answer:
98
98
  "files_created": 1,
99
99
  "planned_creates": ["datanotes/main/public/film/Charade.md"],
100
100
  "commits": [{ "table": "main.public.film", "version": 2, "operation": "WRITE" }],
101
- "migration_id": "20261024T053829-insert_row-insert-into-film-2",
101
+ "migration_id": "20261024T063913-insert_row-insert-into-film-2",
102
102
  "links_added": [
103
103
  {
104
104
  "path": "datanotes/main/public/film/Charade.md",
@@ -127,7 +127,7 @@ Answer:
127
127
  ```markdown
128
128
  ---
129
129
  table: main.public.film
130
- id: 01a16c6a-ef34-786c-8a16-70940d66ab4d
130
+ id: 01a16ca2-86d8-79ee-89ef-e5a776a8d6b7
131
131
  title: Charade
132
132
  year: 1963
133
133
  ---
@@ -169,7 +169,7 @@ Answer:
169
169
  }
170
170
  ],
171
171
  "commits": [{ "table": "main.public.film", "version": 3, "operation": "UPDATE" }],
172
- "migration_id": "20261024T053829-update_row-update-film",
172
+ "migration_id": "20261024T063913-update_row-update-film",
173
173
  "links_added": [
174
174
  {
175
175
  "path": "datanotes/main/public/film/Charade.md",
@@ -186,7 +186,7 @@ Answer:
186
186
  ```markdown
187
187
  ---
188
188
  table: main.public.film
189
- id: 01a16c6a-ef34-786c-8a16-70940d66ab4d
189
+ id: 01a16ca2-86d8-79ee-89ef-e5a776a8d6b7
190
190
  title: Charade
191
191
  year: 1963
192
192
  ---
@@ -229,7 +229,7 @@ Answer:
229
229
  }
230
230
  ],
231
231
  "commits": [{ "table": "main.public.film", "version": 4, "operation": "UPDATE" }],
232
- "migration_id": "20261024T053830-update_row-update-film",
232
+ "migration_id": "20261024T063913-update_row-update-film-2",
233
233
  "links_added": [
234
234
  {
235
235
  "path": "datanotes/main/public/film/Notorious.md",
@@ -287,7 +287,7 @@ Answer:
287
287
  }
288
288
  ],
289
289
  "commits": [{ "table": "main.public.film", "version": 5, "operation": "UPDATE" }],
290
- "migration_id": "20261024T053830-update_row-update-film-2",
290
+ "migration_id": "20261024T063913-update_row-update-film-3",
291
291
  "links_added": [
292
292
  {
293
293
  "path": "datanotes/main/public/film/Notorious.md",
@@ -310,7 +310,7 @@ Answer:
310
310
  ```markdown
311
311
  ---
312
312
  table: main.public.film
313
- id: 01a16c6a-ee8a-7114-9ab1-7733fe30087c
313
+ id: 01a16ca2-86cb-7322-8189-f01f3c6119a3
314
314
  title: Notorious
315
315
  year: 1946
316
316
  ---
@@ -373,7 +373,7 @@ Answer:
373
373
  "files_created": 1,
374
374
  "planned_creates": ["datanotes/main/public/film/Persona.md"],
375
375
  "commits": [{ "table": "main.public.film", "version": 6, "operation": "WRITE" }],
376
- "migration_id": "20261024T053830-insert_row-insert-into-film",
376
+ "migration_id": "20261024T063913-insert_row-insert-into-film-3",
377
377
  "links_added": [
378
378
  {
379
379
  "path": "datanotes/main/public/film/Persona.md",
@@ -390,7 +390,7 @@ Answer:
390
390
  ```markdown
391
391
  ---
392
392
  table: main.public.film
393
- id: 01a16c6a-f25c-707a-b5aa-8f4b2499198f
393
+ id: 01a16ca2-87b5-7b97-9da8-c6fa7447798b
394
394
  title: Persona
395
395
  year: 1966
396
396
  ---
@@ -472,7 +472,7 @@ Answer:
472
472
  }
473
473
  ],
474
474
  "commits": [{ "table": "main.public.film", "version": 7, "operation": "UPDATE" }],
475
- "migration_id": "20261024T053830-update_row-update-film-3",
475
+ "migration_id": "20261024T063913-update_row-update-film-4",
476
476
  "links_added": [
477
477
  {
478
478
  "path": "datanotes/main/public/film/Persona.md",
@@ -489,7 +489,7 @@ Answer:
489
489
  ```markdown
490
490
  ---
491
491
  table: main.public.film
492
- id: 01a16c6a-f25c-707a-b5aa-8f4b2499198f
492
+ id: 01a16ca2-87b5-7b97-9da8-c6fa7447798b
493
493
  title: Persona
494
494
  year: 1966
495
495
  ---
@@ -505,7 +505,7 @@ We watched it at [[2026-10-09T2100|Swedish night]].
505
505
 
506
506
  ```yaml
507
507
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
508
- id: 01a16c6a-e9ae-7998-8aa6-0918b4ce87d7
508
+ id: 01a16ca2-8469-7992-baf9-477d38fdf2ed
509
509
  config:
510
510
  history: true
511
511
 
@@ -620,7 +620,7 @@ Answer:
620
620
  "files_created": 1,
621
621
  "planned_creates": ["datanotes/main/public/film/His Girl Friday.md"],
622
622
  "commits": [{ "table": "main.public.film", "version": 8, "operation": "WRITE" }],
623
- "migration_id": "20261024T053830-insert_row-insert-into-film-2"
623
+ "migration_id": "20261024T063913-insert_row-insert-into-film-4"
624
624
  }
625
625
  ```
626
626
 
@@ -629,7 +629,7 @@ Answer:
629
629
  ```markdown
630
630
  ---
631
631
  table: main.public.film
632
- id: 01a16c6a-f278-7de9-8d9d-2ea9726437f4
632
+ id: 01a16ca2-880e-7cef-83a8-5888eb8601d0
633
633
  title: His Girl Friday
634
634
  year: 1940
635
635
  ---
@@ -663,7 +663,7 @@ Answer:
663
663
 
664
664
  ```yaml
665
665
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
666
- id: 01a16c6a-e9ae-7998-8aa6-0918b4ce87d7
666
+ id: 01a16ca2-8469-7992-baf9-477d38fdf2ed
667
667
  config:
668
668
  history: true
669
669
  autolink: false
@@ -314,7 +314,7 @@ Answer:
314
314
  "op": "create_table",
315
315
  "planned_texts": ["datanotes/metastore.yaml"],
316
316
  "commits": [{ "table": "main.public.film", "version": 0, "operation": "CREATE TABLE" }],
317
- "migration_id": "20261024T053830-create_table-create-table-main-public-film"
317
+ "migration_id": "20261024T063914-create_table-create-table-main-public-film"
318
318
  }
319
319
  ```
320
320
 
@@ -359,7 +359,7 @@ Answer (70 lines)
359
359
  "path": "Films/Charade.md",
360
360
  "set": {
361
361
  "table": "main.public.film",
362
- "id": "01a16c6a-f3d8-7a71-935b-e3cdd49c2cec",
362
+ "id": "01a16ca2-8b15-7b17-9621-47ebd428dcb2",
363
363
  "director": "Stanley Donen",
364
364
  "title": "Charade"
365
365
  },
@@ -369,7 +369,7 @@ Answer (70 lines)
369
369
  "path": "Films/His Girl Friday.md",
370
370
  "set": {
371
371
  "table": "main.public.film",
372
- "id": "01a16c6a-f3d8-7b3a-a052-76112f5037b7",
372
+ "id": "01a16ca2-8b15-736e-b2e9-b44812311845",
373
373
  "director": "Howard Hawks",
374
374
  "title": "His Girl Friday"
375
375
  },
@@ -379,7 +379,7 @@ Answer (70 lines)
379
379
  "path": "Films/Metropolis.md",
380
380
  "set": {
381
381
  "table": "main.public.film",
382
- "id": "01a16c6a-f3d8-7dda-93e2-1ad75dd46ee2",
382
+ "id": "01a16ca2-8b16-7de3-b3c7-f99fea697aef",
383
383
  "director": "Fritz Lang",
384
384
  "title": "Metropolis"
385
385
  },
@@ -389,7 +389,7 @@ Answer (70 lines)
389
389
  "path": "Films/Nosferatu.md",
390
390
  "set": {
391
391
  "table": "main.public.film",
392
- "id": "01a16c6a-f3d8-7b11-bdee-5230b4678352",
392
+ "id": "01a16ca2-8b16-7f5e-a304-e715a1815b66",
393
393
  "director": "F. W. Murnau",
394
394
  "title": "Nosferatu"
395
395
  },
@@ -399,7 +399,7 @@ Answer (70 lines)
399
399
  "path": "Films/The Gold Rush.md",
400
400
  "set": {
401
401
  "table": "main.public.film",
402
- "id": "01a16c6a-f3d8-71bc-a2b9-70a1be84f56f",
402
+ "id": "01a16ca2-8b16-747f-9e49-aefd3f27fd58",
403
403
  "director": "Charlie Chaplin",
404
404
  "title": "The Gold Rush"
405
405
  },
@@ -458,7 +458,7 @@ Answer (73 lines)
458
458
  "path": "Films/Charade.md",
459
459
  "set": {
460
460
  "table": "main.public.film",
461
- "id": "01a16c6a-f3db-705d-a092-d386d6b8d680",
461
+ "id": "01a16ca2-8b18-7e55-9cbc-a983a43ae96c",
462
462
  "director": "Stanley Donen",
463
463
  "title": "Charade"
464
464
  },
@@ -468,7 +468,7 @@ Answer (73 lines)
468
468
  "path": "Films/His Girl Friday.md",
469
469
  "set": {
470
470
  "table": "main.public.film",
471
- "id": "01a16c6a-f3db-7ce9-9b15-ffdf1d9e94f9",
471
+ "id": "01a16ca2-8b18-739c-9058-e32e9f3a61d4",
472
472
  "director": "Howard Hawks",
473
473
  "title": "His Girl Friday"
474
474
  },
@@ -478,7 +478,7 @@ Answer (73 lines)
478
478
  "path": "Films/Metropolis.md",
479
479
  "set": {
480
480
  "table": "main.public.film",
481
- "id": "01a16c6a-f3db-73dd-9ca7-c1c2c0456765",
481
+ "id": "01a16ca2-8b18-71f0-92e4-4e2492953fa5",
482
482
  "director": "Fritz Lang",
483
483
  "title": "Metropolis"
484
484
  },
@@ -488,7 +488,7 @@ Answer (73 lines)
488
488
  "path": "Films/Nosferatu.md",
489
489
  "set": {
490
490
  "table": "main.public.film",
491
- "id": "01a16c6a-f3db-7a47-8726-24e829d99493",
491
+ "id": "01a16ca2-8b18-78be-9435-87eca4fa962e",
492
492
  "director": "F. W. Murnau",
493
493
  "title": "Nosferatu"
494
494
  },
@@ -498,7 +498,7 @@ Answer (73 lines)
498
498
  "path": "Films/The Gold Rush.md",
499
499
  "set": {
500
500
  "table": "main.public.film",
501
- "id": "01a16c6a-f3db-77f9-a8b3-30bb65a6cc26",
501
+ "id": "01a16ca2-8b18-76bd-b55f-ba6aadec67b1",
502
502
  "director": "Charlie Chaplin",
503
503
  "title": "The Gold Rush"
504
504
  },
@@ -519,7 +519,7 @@ Answer (73 lines)
519
519
  }
520
520
  ],
521
521
  "commits": [{ "table": "main.public.film", "version": 1, "operation": "ADOPT ROWS" }],
522
- "migration_id": "20261024T053831-adopt_rows-adopt-5-notes-into-film"
522
+ "migration_id": "20261024T063914-adopt_rows-adopt-5-notes-into-film"
523
523
  }
524
524
  ```
525
525
 
@@ -536,7 +536,7 @@ Answer:
536
536
  ```markdown
537
537
  ---
538
538
  table: main.public.film
539
- id: 01a16c6a-f3db-705d-a092-d386d6b8d680
539
+ id: 01a16ca2-8b18-7e55-9cbc-a983a43ae96c
540
540
  year: 1963
541
541
  minutes: 113
542
542
  status: watched
@@ -623,7 +623,7 @@ Answer:
623
623
  "files_created": 1,
624
624
  "planned_creates": ["datanotes/main/public/film/Battleship Potemkin.md"],
625
625
  "commits": [{ "table": "main.public.film", "version": 2, "operation": "WRITE" }],
626
- "migration_id": "20261024T053831-insert_row-insert-into-film"
626
+ "migration_id": "20261024T063914-insert_row-insert-into-film"
627
627
  }
628
628
  ```
629
629
 
@@ -655,7 +655,7 @@ Answer:
655
655
  "op": "add_column",
656
656
  "planned_texts": ["datanotes/metastore.yaml"],
657
657
  "commits": [{ "table": "main.public.film", "version": 4, "operation": "ADD COLUMNS" }],
658
- "migration_id": "20261024T053832-add_column-add-column-added_by-to-film"
658
+ "migration_id": "20261024T063915-add_column-add-column-added_by-to-film"
659
659
  }
660
660
  ```
661
661
 
@@ -683,7 +683,7 @@ Answer:
683
683
  "files_created": 1,
684
684
  "planned_creates": ["datanotes/main/public/film/Night of the Living Dead.md"],
685
685
  "commits": [{ "table": "main.public.film", "version": 5, "operation": "WRITE" }],
686
- "migration_id": "20261024T053832-insert_row-insert-into-film"
686
+ "migration_id": "20261024T063915-insert_row-insert-into-film"
687
687
  }
688
688
  ```
689
689
 
@@ -692,7 +692,7 @@ Answer:
692
692
  ```markdown
693
693
  ---
694
694
  table: main.public.film
695
- id: 01a16c6a-f9d0-7e20-8311-52386a251707
695
+ id: 01a16ca2-915b-736c-a394-c98699327151
696
696
  director: George A. Romero
697
697
  minutes: 96
698
698
  status: to watch
@@ -734,7 +734,7 @@ Answer:
734
734
  ```markdown
735
735
  ---
736
736
  table: main.public.film
737
- id: 01a16c6a-fc6c-7872-89fb-d51beace835e
737
+ id: 01a16ca2-943a-7248-9a53-5c7f7532b5af
738
738
  year: 1924
739
739
  minutes: 45
740
740
  status: to watch
@@ -762,7 +762,7 @@ Answer:
762
762
  "op": "alter_table",
763
763
  "planned_texts": ["datanotes/metastore.yaml"],
764
764
  "commits": [{ "table": "main.public.film", "version": 7, "operation": "ALTER TABLE" }],
765
- "migration_id": "20261024T053835-alter_table-alter-table-main-public-film"
765
+ "migration_id": "20261024T063918-alter_table-alter-table-main-public-film"
766
766
  }
767
767
  ```
768
768
 
@@ -825,7 +825,7 @@ This is the table as you inferred, corrected and extended it on this page. Its d
825
825
 
826
826
  ```yaml
827
827
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
828
- id: 01a16c6a-f3c8-7bd8-8ca7-e31ab9cbc5a7
828
+ id: 01a16ca2-8b02-76f7-8686-40530eaf4e87
829
829
  config:
830
830
  history: true
831
831
 
@@ -31,7 +31,7 @@ Answer:
31
31
  "files_created": 1,
32
32
  "planned_creates": ["datanotes/main/public/film/Metropolis.md"],
33
33
  "commits": [{ "table": "main.public.film", "version": 1, "operation": "WRITE" }],
34
- "migration_id": "20261024T053819-insert_row-insert-into-film"
34
+ "migration_id": "20261024T063903-insert_row-insert-into-film"
35
35
  }
36
36
  ```
37
37
 
@@ -40,7 +40,7 @@ Answer:
40
40
  ```markdown
41
41
  ---
42
42
  table: main.public.film
43
- id: 01a16c6a-c7b1-7337-8349-70046fead6ac
43
+ id: 01a16ca2-615c-78e9-af82-5d7ee065ac91
44
44
  title: Metropolis
45
45
  year: 1927
46
46
  minutes: 153
@@ -103,7 +103,7 @@ Answer:
103
103
  }
104
104
  ],
105
105
  "commits": [{ "table": "main.public.film", "version": 6, "operation": "UPDATE" }],
106
- "migration_id": "20261024T053823-update_row-update-film"
106
+ "migration_id": "20261024T063907-update_row-update-film"
107
107
  }
108
108
  ```
109
109
 
@@ -174,7 +174,7 @@ Answer:
174
174
  }
175
175
  ],
176
176
  "commits": [{ "table": "main.public.film", "version": 8, "operation": "UPDATE" }],
177
- "migration_id": "20261024T053823-update_row-update-film-3",
177
+ "migration_id": "20261024T063907-update_row-update-film-3",
178
178
  "ambiguous_mentions": [
179
179
  {
180
180
  "path": "datanotes/main/public/film/Nosferatu.md",
@@ -193,7 +193,7 @@ Answer:
193
193
  ```markdown
194
194
  ---
195
195
  table: main.public.film
196
- id: 01a16c6a-d656-749e-960a-7aa338a198ae
196
+ id: 01a16ca2-718e-7219-9638-3d26346a9a88
197
197
  title: Nosferatu
198
198
  year: 1922
199
199
  status: watched
@@ -246,7 +246,7 @@ Answer:
246
246
  }
247
247
  ],
248
248
  "commits": [{ "table": "main.public.film", "version": 9, "operation": "UPDATE" }],
249
- "migration_id": "20261024T053823-update_row-update-film-4"
249
+ "migration_id": "20261024T063907-update_row-update-film-4"
250
250
  }
251
251
  ```
252
252
 
@@ -332,7 +332,7 @@ Answer:
332
332
  }
333
333
  ],
334
334
  "commits": [{ "table": "main.public.film", "version": 10, "operation": "UPDATE" }],
335
- "migration_id": "20261024T053823-update_rows-update-film"
335
+ "migration_id": "20261024T063907-update_rows-update-film"
336
336
  }
337
337
  ```
338
338
 
@@ -370,7 +370,7 @@ Answer:
370
370
  ],
371
371
  "planned_creates": ["datanotes/main/public/film/Battleship Potemkin.md"],
372
372
  "commits": [{ "table": "main.public.film", "version": 11, "operation": "MERGE" }],
373
- "migration_id": "20261024T053823-merge_rows-merge-2-rows-into-film"
373
+ "migration_id": "20261024T063907-merge_rows-merge-2-rows-into-film"
374
374
  }
375
375
  ```
376
376
 
@@ -431,7 +431,7 @@ Answer:
431
431
  }
432
432
  ],
433
433
  "commits": [{ "table": "main.public.film", "version": 12, "operation": "DELETE" }],
434
- "migration_id": "20261024T053823-delete_rows-archive-1-rows-of-film"
434
+ "migration_id": "20261024T063907-delete_rows-archive-1-rows-of-film"
435
435
  }
436
436
  ```
437
437
 
@@ -568,6 +568,6 @@ Answer (51 lines)
568
568
  { "table": "main.public.film", "version": 22, "operation": "MOVE ROWS" },
569
569
  { "table": "main.public.watchlist", "version": 1, "operation": "MOVE ROWS" }
570
570
  ],
571
- "migration_id": "20261024T053823-move_rows-move-4-rows-from-film-to-watch"
571
+ "migration_id": "20261024T063907-move_rows-move-4-rows-from-film-to-watch"
572
572
  }
573
573
  ```
@@ -0,0 +1,162 @@
1
+ # Search notes by words and meaning
2
+
3
+ > Search every note by its words, and by its meaning too when semantic search is on, in one call.
4
+
5
+ The [`search`](https://datanotes.dev/reference/operations/queries/#search) operation always works. It ranks the notes by their words, and by their meaning too when [semantic search](https://datanotes.dev/guides/search/semantic/) is on. A note found only one way is still in the answer. The vault has three actors, two classic films, a viewing and two plain notes.
6
+
7
+ ## Choose the search to use
8
+
9
+ The engine has three ways to search the notes:
10
+
11
+ | Operation | Finds | Use it for |
12
+ | ----------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------- |
13
+ | `search` | Notes with any word of the query, ranked; with semantic search on, notes that mean the same too | Most searches, by agents and programs |
14
+ | `search_notes` | Notes with every word of the query, as text | Exact passages, such as a code or a name |
15
+ | `semantic_search` | Notes by meaning only | Vague questions, when semantic search is on |
16
+
17
+ ## How the words rank the notes
18
+
19
+ `search` scores each note with BM25, the ranking of most search engines:
20
+
21
+ * **Rare words count more.** A word that few notes have says more than a word that every note has.
22
+ * **The name and the properties count more.** A word in the note’s name, or in a value of its front matter, adds to its score. Property names, `id` and `table` don’t count.
23
+ * **Every word counts.** A note with every word of the query ranks above a note with some of them.
24
+ * **Words in a row count more.** Two words next to each other, as in the query, add a little.
25
+
26
+ The engine ignores case and accents, so `Uovo` finds `uovo` and `perche` finds `perché`. It doesn’t reduce words to a stem, because notes are in many languages: `uova` doesn’t find `uovo`. Semantic search finds those other forms. A single letter is never searched, but a single digit is, so `6 mesi` works.
27
+
28
+ ## Write a query
29
+
30
+ A query takes the syntax of `search_docs`:
31
+
32
+ * `"6 mesi"`: the words must appear in a row.
33
+ * `+uovo`: the word must appear.
34
+ * `-latte`: no note with the word is returned.
35
+ * Any other word only ranks the notes.
36
+
37
+ `tables` keeps the rows of some tables, by full or short name. `folder` keeps the notes of one folder. `limit` sets how many notes come back: 10 by default, at most 100.
38
+
39
+ ## Fuse the words with the meaning
40
+
41
+ When semantic search is on, `search` also ranks the notes by meaning. It then fuses the two rankings with Reciprocal Rank Fusion. A note scores more for each ranking it is in, and more near the top of each.
42
+
43
+ Each hit says how the engine found it in `matched_by`: `words`, `meaning` or both. The answer’s `meaning` field says what ran:
44
+
45
+ * `on`: both rankings, fused.
46
+ * `off`: semantic search is off, so only the words ranked.
47
+ * `failed`: the embedding provider failed, so only the words ranked. `meaning_error` says why.
48
+
49
+ The required and excluded words filter both rankings. `min_score` drops the passages of the meaning ranking below that similarity, from 0 to 1.
50
+
51
+ ## What a token may search
52
+
53
+ A named token with [`read` patterns](https://datanotes.dev/guides/security/tokens/#limit-what-a-token-can-read) searches only the notes it may read. A table it may not read, named exactly in `tables`, answers 403.
54
+
55
+ ## Search by words and meaning
56
+
57
+ `search` ranks every note that has a word of the query. A rare word counts more than a common one. A word in the note’s name or properties counts more than one in its text. Here semantic search is off, so `meaning` is `off` and every hit has `matched_by: ["words"]`.
58
+
59
+ **`search`**
60
+
61
+ ```json
62
+ { "query": "cary grant film" }
63
+ ```
64
+
65
+ Answer (52 lines)
66
+
67
+ ```json
68
+ {
69
+ "query": "cary grant film",
70
+ "results": [
71
+ {
72
+ "path": "Notes/Film night.md",
73
+ "score": 4.57,
74
+ "heading": "",
75
+ "snippet": "…ry other Friday. Next up: [[Charade]]. October’s theme is [[Cary Grant]].",
76
+ "matched_by": ["words"]
77
+ },
78
+ {
79
+ "path": "Notes/Rewatch ideas.md",
80
+ "score": 1.95,
81
+ "heading": "",
82
+ "snippet": "A Cary Grant weekend: every film with him, in release order.",
83
+ "matched_by": ["words"]
84
+ },
85
+ {
86
+ "path": "datanotes/main/public/actor/Cary Grant.md",
87
+ "table": "main.public.actor",
88
+ "score": 1.92,
89
+ "heading": "",
90
+ "snippet": "Cary Grant",
91
+ "matched_by": ["words"]
92
+ },
93
+ {
94
+ "path": "datanotes/main/public/film/Charade.md",
95
+ "table": "main.public.film",
96
+ "score": 0.9,
97
+ "heading": "",
98
+ "snippet": "[[Cary Grant]] again, 23 years after [[His Girl Friday]]. Watch them back to back.",
99
+ "matched_by": ["words"]
100
+ },
101
+ {
102
+ "path": "datanotes/main/public/film/His Girl Friday.md",
103
+ "table": "main.public.film",
104
+ "score": 0.6,
105
+ "heading": "",
106
+ "snippet": "\"Cary Grant\"",
107
+ "matched_by": ["words"]
108
+ },
109
+ {
110
+ "path": "datanotes/main/public/watch/2026-09-25T2100.md",
111
+ "table": "main.public.watch",
112
+ "score": 0.07,
113
+ "heading": "",
114
+ "snippet": "Part of [[Film night]]. Four of us on the sofa, and nobody guessed the ending.",
115
+ "matched_by": ["words"]
116
+ }
117
+ ],
118
+ "meaning": "off"
119
+ }
120
+ ```
121
+
122
+ Quotes keep words together, and a minus sign leaves notes out. This query wants the two words in a row, and no note that names Charade:
123
+
124
+ **`search`**
125
+
126
+ ```json
127
+ { "query": "\"cary grant\" -charade" }
128
+ ```
129
+
130
+ Answer:
131
+
132
+ ```json
133
+ {
134
+ "query": "\"cary grant\" -charade",
135
+ "results": [
136
+ {
137
+ "path": "datanotes/main/public/actor/Cary Grant.md",
138
+ "table": "main.public.actor",
139
+ "score": 4.31,
140
+ "heading": "",
141
+ "snippet": "Cary Grant",
142
+ "matched_by": ["words"]
143
+ },
144
+ {
145
+ "path": "datanotes/main/public/film/His Girl Friday.md",
146
+ "table": "main.public.film",
147
+ "score": 1.35,
148
+ "heading": "",
149
+ "snippet": "\"Cary Grant\"",
150
+ "matched_by": ["words"]
151
+ },
152
+ {
153
+ "path": "Notes/Rewatch ideas.md",
154
+ "score": 1.18,
155
+ "heading": "",
156
+ "snippet": "A Cary Grant weekend: every film with him, in release order.",
157
+ "matched_by": ["words"]
158
+ }
159
+ ],
160
+ "meaning": "off"
161
+ }
162
+ ```
@@ -87,7 +87,7 @@ Answer (62 lines)
87
87
  {
88
88
  "start": 81,
89
89
  "end": 86,
90
- "context": "-9421-e41365b64268\nname: Cary Grant\n---\n\n"
90
+ "context": "-9707-5a03c150e424\nname: Cary Grant\n---\n\n"
91
91
  }
92
92
  ]
93
93
  },
@@ -60,13 +60,15 @@ The owner token is `httpServerToken` in the settings file. It can do everything:
60
60
 
61
61
  The owner creates a named token with `POST /datanotes/tokens/create/`, and the engine stores only its hash, in `tokens.json` in its store, outside the vault. A named token has these permissions:
62
62
 
63
- * **Read**: everything
63
+ * **Read**: only the tables in its `read` patterns; without `read`, every table
64
64
  * **Write rows**: only the tables in its `write` patterns
65
65
  * **Change the schema**: only with `ddl`
66
66
  * **Maintain**: with `maintain`, it may also undo, restore, vacuum, configure the database and rebuild the semantic index; use it for an agent’s own token
67
67
 
68
68
  A named token can’t create webhooks, manage tokens or read the engine’s status, and without `maintain` it can’t undo.
69
69
 
70
+ With `read` patterns, a token reads only the tables they match. It never reads the notes outside tables. Listings, search, the graph and the change feed leave out the rest. A query that names another table gets 403. A token always reads what it writes, and a token with `ddl` or `maintain` reads every table. Listings hide the other tables’ names. A refusal repeats a name the caller gave, so a guessed name isn’t secret. [Limit what a token can read](https://datanotes.dev/guides/security/tokens/#limit-what-a-token-can-read) lists the rules and the known gaps.
71
+
70
72
  ### Extensions
71
73
 
72
74
  An extension adds tables and Model Context Protocol (MCP) tools from a git repository. Its code is trusted code that runs inside the MCP server’s process, not in a sandbox. Install only extensions you trust, and read the plan first.
@@ -77,7 +79,7 @@ An extension adds tables and Model Context Protocol (MCP) tools from a git repos
77
79
  * **An invoker check**: before a tool that writes runs, the server checks the calling agent’s token. That token must be able to write the tool’s tables. A read-only client cannot write through an extension.
78
80
  * **The secret stays on one machine**: the token file sits under the data home with mode 0600. The registry in the engine’s store holds no secret.
79
81
 
80
- Known limits: extension code is not isolated from the MCP server’s process. Its token reads every table until read patterns ship. Migrations are declarative and run no code. [Install extensions](https://datanotes.dev/administration/extensions/) has the details.
82
+ Known limits: extension code is not isolated from the MCP server’s process. The installer gives its token no `read`, so it reads every table. The owner may limit it with `read` patterns that cover the tables it writes. Migrations are declarative and run no code. [Install extensions](https://datanotes.dev/administration/extensions/) has the details.
81
83
 
82
84
  ### Who made each write
83
85
 
@@ -105,7 +107,7 @@ An agent reads your notes, and a note can hold text written to manipulate it: a
105
107
 
106
108
  Limit what each agent can do:
107
109
 
108
- * **Give it a named token**: grant only the tables it writes, and leave out `ddl` and `maintain` unless it needs them
110
+ * **Give it a named token**: grant only the tables it reads and writes, and leave out `ddl` and `maintain` unless it needs them
109
111
  * **Give it only the tools it needs**: start the MCP server with `datanotes mcp --profile`, `--tools` or `--except`
110
112
  * **Keep the webhook tools off**: they’re off by default, because a webhook sends change events to any URL
111
113