datanotes 3.3.0 → 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 (72) hide show
  1. package/SECURITY.md +5 -3
  2. package/dist/api/extensions.cjs +1345 -21
  3. package/dist/api/extensions.js +1345 -21
  4. package/dist/api/index.cjs +1345 -21
  5. package/dist/api/index.js +1345 -21
  6. package/dist/api/mcp.cjs +1345 -21
  7. package/dist/api/mcp.js +1345 -21
  8. package/dist/datanotes.cjs +2927 -609
  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/alter_table.md +4 -3
  12. package/dist/docs/api/operations/check_table.md +1 -0
  13. package/dist/docs/api/operations/create_table.md +1 -0
  14. package/dist/docs/api/operations/describe_database.md +2 -0
  15. package/dist/docs/api/operations/describe_history.md +1 -0
  16. package/dist/docs/api/operations/describe_semantic_index.md +1 -0
  17. package/dist/docs/api/operations/describe_table.md +1 -0
  18. package/dist/docs/api/operations/graph_neighbors.md +1 -0
  19. package/dist/docs/api/operations/graph_path.md +1 -0
  20. package/dist/docs/api/operations/graph_traverse.md +1 -0
  21. package/dist/docs/api/operations/infer_table.md +1 -0
  22. package/dist/docs/api/operations/list_changes.md +1 -0
  23. package/dist/docs/api/operations/list_folder.md +1 -0
  24. package/dist/docs/api/operations/list_link_targets.md +1 -0
  25. package/dist/docs/api/operations/list_migrations.md +1 -0
  26. package/dist/docs/api/operations/list_tables.md +2 -0
  27. package/dist/docs/api/operations/list_webhooks.md +1 -0
  28. package/dist/docs/api/operations/read_note.md +1 -0
  29. package/dist/docs/api/operations/search.md +39 -0
  30. package/dist/docs/api/operations/search_notes.md +1 -0
  31. package/dist/docs/api/operations/select_rows.md +1 -0
  32. package/dist/docs/api/operations/semantic_search.md +1 -0
  33. package/dist/docs/api/operations/table_changes.md +1 -0
  34. package/dist/docs/api/operations/tags/queries.md +1 -0
  35. package/dist/docs/api/operations/tags/tokens.md +1 -1
  36. package/dist/docs/api/operations/tokens_create.md +1 -0
  37. package/dist/docs/api/operations/tokens_update.md +2 -1
  38. package/dist/docs/api.md +5 -4
  39. package/dist/docs/develop/build-an-app.md +2 -1
  40. package/dist/docs/develop/change-feed-and-webhooks.md +1 -1
  41. package/dist/docs/develop/http-api.md +1 -1
  42. package/dist/docs/guides/data-quality/check-constraints.md +10 -10
  43. package/dist/docs/guides/data-quality/hand-edits.md +8 -8
  44. package/dist/docs/guides/database-objects/bases.md +11 -11
  45. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +30 -10
  46. package/dist/docs/guides/database-objects/columns.md +243 -40
  47. package/dist/docs/guides/database-objects/relations.md +28 -28
  48. package/dist/docs/guides/database-objects/tables.md +167 -43
  49. package/dist/docs/guides/database-objects/views.md +44 -44
  50. package/dist/docs/guides/history/change-data-feed.md +34 -34
  51. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  52. package/dist/docs/guides/history/restore.md +20 -20
  53. package/dist/docs/guides/history/table-history.md +31 -31
  54. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  55. package/dist/docs/guides/read-and-write/import-notes.md +20 -20
  56. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
  57. package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
  58. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  59. package/dist/docs/guides/search/hybrid.md +162 -0
  60. package/dist/docs/guides/search/text.md +1 -1
  61. package/dist/docs/guides/security/security-model.md +5 -3
  62. package/dist/docs/guides/security/tokens.md +121 -8
  63. package/dist/docs/reference/cli.md +1 -1
  64. package/dist/docs/reference/glossary.md +1 -1
  65. package/dist/docs/reference/operations/auxiliary.md +3 -3
  66. package/dist/docs/reference/operations/queries.md +16 -0
  67. package/dist/docs/reference/operations/rows.md +1 -1
  68. package/dist/docs/reference/operations/schema.md +5 -5
  69. package/dist/docs/reference/operations.md +6 -5
  70. package/dist/docs/release-notes.md +59 -0
  71. package/dist/docs/start/connect-agents.md +10 -3
  72. package/package.json +1 -1
@@ -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": "20261020T173838-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": "01a15a64-ce9f-7560-9add-1459237106c3",
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": "01a15a64-ce9f-7172-abbb-020e612ede56",
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": "01a15a64-ce9f-7b50-990c-aa26f69b3ab6",
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": "01a15a64-ce9f-7541-8429-fc436df30866",
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": "01a15a64-ce9f-7cf2-8129-a75fb2745cc9",
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": "01a15a64-cea3-7bf1-ada5-aeb2d9dbb4fd",
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": "01a15a64-cea3-777e-b51d-cfb871067faf",
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": "01a15a64-cea3-776e-b81b-389706767aa1",
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": "01a15a64-cea3-7299-a73b-bb2b9eec0177",
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": "01a15a64-cea4-7624-b9be-0e6c6aeb6dfc",
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": "20261020T173838-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: 01a15a64-cea3-7bf1-ada5-aeb2d9dbb4fd
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": "20261020T173838-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": "20261020T173839-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": "20261020T173839-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: 01a15a64-d4a9-7905-af13-90c8506569c9
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: 01a15a64-d731-7eff-804e-4148716ec5c3
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": "20261020T173842-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: 01a15a64-ce85-731f-bfea-eb573328eb39
828
+ id: 01a16ca2-8b02-76f7-8686-40530eaf4e87
829
829
  config:
830
830
  history: true
831
831
 
@@ -100,9 +100,9 @@ Answer:
100
100
  "table": "main.public.watch",
101
101
  "total": 3,
102
102
  "rows": [
103
- { "date(occurred_at)": "2026-10-15", "viewings": 1 },
104
- { "date(occurred_at)": "2026-10-18", "viewings": 1 },
105
- { "date(occurred_at)": "2026-10-19", "viewings": 1 }
103
+ { "date(occurred_at)": "2026-10-19", "viewings": 1 },
104
+ { "date(occurred_at)": "2026-10-22", "viewings": 1 },
105
+ { "date(occurred_at)": "2026-10-23", "viewings": 1 }
106
106
  ]
107
107
  }
108
108
  ```
@@ -138,10 +138,10 @@ Answer:
138
138
  {
139
139
  "path": "datanotes/main/public/film/Night of the Living Dead.md",
140
140
  "title": "Night of the Living Dead",
141
- "watched_on": "2026-10-19",
141
+ "watched_on": "2026-10-23",
142
142
  "viewing": [
143
143
  {
144
- "path": "datanotes/main/public/watch/2026-10-19T2200.md",
144
+ "path": "datanotes/main/public/watch/2026-10-23T2200.md",
145
145
  "where": "cinema",
146
146
  "with": "Oscar"
147
147
  }
@@ -150,10 +150,10 @@ Answer:
150
150
  {
151
151
  "path": "datanotes/main/public/film/The Gold Rush.md",
152
152
  "title": "The Gold Rush",
153
- "watched_on": "2026-10-18",
153
+ "watched_on": "2026-10-22",
154
154
  "viewing": [
155
155
  {
156
- "path": "datanotes/main/public/watch/2026-10-18T2030.md",
156
+ "path": "datanotes/main/public/watch/2026-10-22T2030.md",
157
157
  "where": "home",
158
158
  "with": "my sister"
159
159
  }
@@ -332,23 +332,23 @@ Answer:
332
332
  "total": 3,
333
333
  "rows": [
334
334
  {
335
- "path": "datanotes/main/public/watch/2026-10-15T2115.md",
335
+ "path": "datanotes/main/public/watch/2026-10-19T2115.md",
336
336
  "film": "[[Charade]]",
337
- "occurred_at": "2026-10-15T21:15",
337
+ "occurred_at": "2026-10-19T21:15",
338
338
  "where": "home",
339
339
  "place": "my living room"
340
340
  },
341
341
  {
342
- "path": "datanotes/main/public/watch/2026-10-18T2030.md",
342
+ "path": "datanotes/main/public/watch/2026-10-22T2030.md",
343
343
  "film": "[[The Gold Rush]]",
344
- "occurred_at": "2026-10-18T20:30",
344
+ "occurred_at": "2026-10-22T20:30",
345
345
  "where": "home",
346
346
  "place": "my living room"
347
347
  },
348
348
  {
349
- "path": "datanotes/main/public/watch/2026-10-19T2200.md",
349
+ "path": "datanotes/main/public/watch/2026-10-23T2200.md",
350
350
  "film": "[[Night of the Living Dead]]",
351
- "occurred_at": "2026-10-19T22:00",
351
+ "occurred_at": "2026-10-23T22:00",
352
352
  "where": "cinema",
353
353
  "place": "the film club downtown"
354
354
  }
@@ -459,12 +459,12 @@ Answer:
459
459
  "total": 7,
460
460
  "rows": [
461
461
  {
462
- "path": "datanotes/main/public/watch/2026-10-15T2115.md",
463
- "occurred_at": "2026-10-15T21:15"
462
+ "path": "datanotes/main/public/watch/2026-10-19T2115.md",
463
+ "occurred_at": "2026-10-19T21:15"
464
464
  },
465
465
  {
466
- "path": "datanotes/main/public/watch/2026-10-11T2130.md",
467
- "occurred_at": "2026-10-11T21:30"
466
+ "path": "datanotes/main/public/watch/2026-10-15T2130.md",
467
+ "occurred_at": "2026-10-15T21:30"
468
468
  }
469
469
  ]
470
470
  }
@@ -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": "20261020T173828-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: 01a15a64-a8b5-7df3-aef8-9d133af2ff28
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": "20261020T173832-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": "20261020T173833-update_row-update-film-2",
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: 01a15a64-b97e-7825-b690-1c0bdc44583e
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": "20261020T173833-update_row-update-film-3"
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": "20261020T173833-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": "20261020T173833-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": "20261020T173833-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": "20261020T173833-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": "-ad6c-b8dee1b7285e\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