htm 0.0.2 → 0.0.10

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/.aigcm_msg +1 -0
  3. data/.architecture/reviews/comprehensive-codebase-review.md +577 -0
  4. data/.claude/settings.local.json +92 -0
  5. data/.irbrc +283 -80
  6. data/.tbls.yml +2 -1
  7. data/CHANGELOG.md +294 -26
  8. data/CLAUDE.md +603 -0
  9. data/README.md +76 -5
  10. data/Rakefile +5 -0
  11. data/db/migrate/{20250101000001_enable_extensions.rb → 00001_enable_extensions.rb} +0 -1
  12. data/db/migrate/00002_create_robots.rb +11 -0
  13. data/db/migrate/00003_create_file_sources.rb +20 -0
  14. data/db/migrate/00004_create_nodes.rb +65 -0
  15. data/db/migrate/00005_create_tags.rb +13 -0
  16. data/db/migrate/00006_create_node_tags.rb +18 -0
  17. data/db/migrate/00007_create_robot_nodes.rb +26 -0
  18. data/db/migrate/00009_add_working_memory_to_robot_nodes.rb +12 -0
  19. data/db/schema.sql +172 -1
  20. data/docs/api/database.md +1 -2
  21. data/docs/api/htm.md +197 -2
  22. data/docs/api/yard/HTM/ActiveRecordConfig.md +23 -0
  23. data/docs/api/yard/HTM/AuthorizationError.md +11 -0
  24. data/docs/api/yard/HTM/CircuitBreaker.md +92 -0
  25. data/docs/api/yard/HTM/CircuitBreakerOpenError.md +34 -0
  26. data/docs/api/yard/HTM/Configuration.md +175 -0
  27. data/docs/api/yard/HTM/Database.md +99 -0
  28. data/docs/api/yard/HTM/DatabaseError.md +14 -0
  29. data/docs/api/yard/HTM/EmbeddingError.md +18 -0
  30. data/docs/api/yard/HTM/EmbeddingService.md +58 -0
  31. data/docs/api/yard/HTM/Error.md +11 -0
  32. data/docs/api/yard/HTM/JobAdapter.md +39 -0
  33. data/docs/api/yard/HTM/LongTermMemory.md +342 -0
  34. data/docs/api/yard/HTM/NotFoundError.md +17 -0
  35. data/docs/api/yard/HTM/Observability.md +107 -0
  36. data/docs/api/yard/HTM/QueryTimeoutError.md +19 -0
  37. data/docs/api/yard/HTM/Railtie.md +27 -0
  38. data/docs/api/yard/HTM/ResourceExhaustedError.md +13 -0
  39. data/docs/api/yard/HTM/TagError.md +18 -0
  40. data/docs/api/yard/HTM/TagService.md +67 -0
  41. data/docs/api/yard/HTM/Timeframe/Result.md +24 -0
  42. data/docs/api/yard/HTM/Timeframe.md +40 -0
  43. data/docs/api/yard/HTM/TimeframeExtractor/Result.md +24 -0
  44. data/docs/api/yard/HTM/TimeframeExtractor.md +45 -0
  45. data/docs/api/yard/HTM/ValidationError.md +20 -0
  46. data/docs/api/yard/HTM/WorkingMemory.md +131 -0
  47. data/docs/api/yard/HTM.md +80 -0
  48. data/docs/api/yard/index.csv +179 -0
  49. data/docs/api/yard-reference.md +51 -0
  50. data/docs/database/README.md +128 -128
  51. data/docs/database/public.file_sources.md +42 -0
  52. data/docs/database/public.file_sources.svg +211 -0
  53. data/docs/database/public.node_tags.md +4 -4
  54. data/docs/database/public.node_tags.svg +212 -79
  55. data/docs/database/public.nodes.md +22 -12
  56. data/docs/database/public.nodes.svg +246 -127
  57. data/docs/database/public.robot_nodes.md +11 -9
  58. data/docs/database/public.robot_nodes.svg +220 -98
  59. data/docs/database/public.robots.md +2 -2
  60. data/docs/database/public.robots.svg +136 -81
  61. data/docs/database/public.tags.md +3 -3
  62. data/docs/database/public.tags.svg +118 -39
  63. data/docs/database/schema.json +850 -771
  64. data/docs/database/schema.svg +256 -197
  65. data/docs/development/schema.md +67 -2
  66. data/docs/guides/adding-memories.md +93 -7
  67. data/docs/guides/recalling-memories.md +36 -1
  68. data/examples/README.md +280 -0
  69. data/examples/cli_app/htm_cli.rb +65 -5
  70. data/examples/cli_app/temp.log +93 -0
  71. data/examples/file_loader_usage.rb +177 -0
  72. data/examples/robot_groups/lib/robot_group.rb +419 -0
  73. data/examples/robot_groups/lib/working_memory_channel.rb +140 -0
  74. data/examples/robot_groups/multi_process.rb +286 -0
  75. data/examples/robot_groups/robot_worker.rb +136 -0
  76. data/examples/robot_groups/same_process.rb +229 -0
  77. data/examples/timeframe_demo.rb +276 -0
  78. data/lib/htm/active_record_config.rb +1 -1
  79. data/lib/htm/circuit_breaker.rb +202 -0
  80. data/lib/htm/configuration.rb +59 -13
  81. data/lib/htm/database.rb +67 -36
  82. data/lib/htm/embedding_service.rb +39 -2
  83. data/lib/htm/errors.rb +131 -11
  84. data/lib/htm/jobs/generate_embedding_job.rb +5 -4
  85. data/lib/htm/jobs/generate_tags_job.rb +4 -0
  86. data/lib/htm/loaders/markdown_loader.rb +263 -0
  87. data/lib/htm/loaders/paragraph_chunker.rb +112 -0
  88. data/lib/htm/long_term_memory.rb +460 -343
  89. data/lib/htm/models/file_source.rb +99 -0
  90. data/lib/htm/models/node.rb +80 -5
  91. data/lib/htm/models/robot.rb +24 -1
  92. data/lib/htm/models/robot_node.rb +1 -0
  93. data/lib/htm/models/tag.rb +254 -4
  94. data/lib/htm/observability.rb +395 -0
  95. data/lib/htm/tag_service.rb +60 -3
  96. data/lib/htm/tasks.rb +26 -1
  97. data/lib/htm/timeframe.rb +194 -0
  98. data/lib/htm/timeframe_extractor.rb +307 -0
  99. data/lib/htm/version.rb +1 -1
  100. data/lib/htm/working_memory.rb +165 -70
  101. data/lib/htm.rb +328 -130
  102. data/lib/tasks/doc.rake +300 -0
  103. data/lib/tasks/files.rake +299 -0
  104. data/lib/tasks/htm.rake +158 -3
  105. data/lib/tasks/jobs.rake +3 -9
  106. data/lib/tasks/tags.rake +166 -6
  107. data/mkdocs.yml +36 -1
  108. data/notes/ARCHITECTURE_REVIEW.md +1167 -0
  109. data/notes/IMPLEMENTATION_SUMMARY.md +606 -0
  110. data/notes/MULTI_FRAMEWORK_IMPLEMENTATION.md +451 -0
  111. data/notes/next_steps.md +100 -0
  112. data/notes/plan.md +627 -0
  113. data/notes/tag_ontology_enhancement_ideas.md +222 -0
  114. data/notes/timescaledb_removal_summary.md +200 -0
  115. metadata +125 -15
  116. data/db/migrate/20250101000002_create_robots.rb +0 -14
  117. data/db/migrate/20250101000003_create_nodes.rb +0 -42
  118. data/db/migrate/20250101000005_create_tags.rb +0 -38
  119. data/db/migrate/20250101000007_add_node_vector_indexes.rb +0 -30
  120. data/db/migrate/20250125000001_add_content_hash_to_nodes.rb +0 -14
  121. data/db/migrate/20250125000002_create_robot_nodes.rb +0 -35
  122. data/db/migrate/20250125000003_remove_source_and_robot_id_from_nodes.rb +0 -28
  123. data/db/migrate/20250126000001_create_working_memories.rb +0 -19
  124. data/db/migrate/20250126000002_remove_unused_columns.rb +0 -12
  125. data/docs/database/public.working_memories.md +0 -40
  126. data/docs/database/public.working_memories.svg +0 -112
  127. data/lib/htm/models/working_memory_entry.rb +0 -88
@@ -4,149 +4,268 @@
4
4
  <!-- Generated by graphviz version 12.1.2 (20240928.0832)
5
5
  -->
6
6
  <!-- Title: public.nodes Pages: 1 -->
7
- <svg width="1205pt" height="848pt"
8
- viewBox="0.00 0.00 1204.77 848.40" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
- <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 844.4)">
7
+ <svg width="2106pt" height="1469pt"
8
+ viewBox="0.00 0.00 2105.90 1468.80" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
+ <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1464.8)">
10
10
  <title>public.nodes</title>
11
- <polygon fill="white" stroke="none" points="-4,4 -4,-844.4 1200.77,-844.4 1200.77,4 -4,4"/>
11
+ <polygon fill="white" stroke="none" points="-4,4 -4,-1464.8 2101.9,-1464.8 2101.9,4 -4,4"/>
12
12
  <!-- public.nodes -->
13
13
  <g id="node1" class="node">
14
14
  <title>public.nodes</title>
15
- <polygon fill="#efefef" stroke="none" points="454.42,-354.2 454.42,-389.8 726.75,-389.8 726.75,-354.2 454.42,-354.2"/>
16
- <polygon fill="none" stroke="black" points="454.42,-354.2 454.42,-389.8 726.75,-389.8 726.75,-354.2 454.42,-354.2"/>
17
- <text text-anchor="start" x="482.6" y="-367.6" font-family="Arial Bold" font-size="18.00">public.nodes</text>
18
- <text text-anchor="start" x="574.09" y="-367.6" font-family="Arial" font-size="14.00">    </text>
19
- <text text-anchor="start" x="605.2" y="-367.6" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
20
- <polygon fill="none" stroke="black" points="454.42,-323.4 454.42,-354.2 726.75,-354.2 726.75,-323.4 454.42,-323.4"/>
21
- <text text-anchor="start" x="461.42" y="-335.6" font-family="Arial" font-size="14.00">id </text>
22
- <text text-anchor="start" x="476.21" y="-335.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
23
- <polygon fill="none" stroke="black" points="454.42,-292.6 454.42,-323.4 726.75,-323.4 726.75,-292.6 454.42,-292.6"/>
24
- <text text-anchor="start" x="461.42" y="-304.8" font-family="Arial" font-size="14.00">content </text>
25
- <text text-anchor="start" x="511.24" y="-304.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
26
- <polygon fill="none" stroke="black" points="454.42,-261.8 454.42,-292.6 726.75,-292.6 726.75,-261.8 454.42,-261.8"/>
27
- <text text-anchor="start" x="461.42" y="-274" font-family="Arial" font-size="14.00">access_count </text>
28
- <text text-anchor="start" x="550.92" y="-274" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
29
- <polygon fill="none" stroke="black" points="454.42,-231 454.42,-261.8 726.75,-261.8 726.75,-231 454.42,-231"/>
30
- <text text-anchor="start" x="461.42" y="-243.2" font-family="Arial" font-size="14.00">created_at </text>
31
- <text text-anchor="start" x="531.47" y="-243.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
32
- <polygon fill="none" stroke="black" points="454.42,-200.2 454.42,-231 726.75,-231 726.75,-200.2 454.42,-200.2"/>
33
- <text text-anchor="start" x="461.42" y="-212.4" font-family="Arial" font-size="14.00">updated_at </text>
34
- <text text-anchor="start" x="535.38" y="-212.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
35
- <polygon fill="none" stroke="black" points="454.42,-169.4 454.42,-200.2 726.75,-200.2 726.75,-169.4 454.42,-169.4"/>
36
- <text text-anchor="start" x="461.42" y="-181.6" font-family="Arial" font-size="14.00">last_accessed </text>
37
- <text text-anchor="start" x="554.03" y="-181.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
38
- <polygon fill="none" stroke="black" points="454.42,-138.6 454.42,-169.4 726.75,-169.4 726.75,-138.6 454.42,-138.6"/>
39
- <text text-anchor="start" x="461.42" y="-150.8" font-family="Arial" font-size="14.00">token_count </text>
40
- <text text-anchor="start" x="541.6" y="-150.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
41
- <polygon fill="none" stroke="black" points="454.42,-107.8 454.42,-138.6 726.75,-138.6 726.75,-107.8 454.42,-107.8"/>
42
- <text text-anchor="start" x="461.42" y="-120" font-family="Arial" font-size="14.00">embedding </text>
43
- <text text-anchor="start" x="534.59" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
44
- <polygon fill="none" stroke="black" points="454.42,-77 454.42,-107.8 726.75,-107.8 726.75,-77 454.42,-77"/>
45
- <text text-anchor="start" x="461.42" y="-89.2" font-family="Arial" font-size="14.00">embedding_dimension </text>
46
- <text text-anchor="start" x="606.19" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
47
- <polygon fill="none" stroke="black" points="454.42,-46.2 454.42,-77 726.75,-77 726.75,-46.2 454.42,-46.2"/>
48
- <text text-anchor="start" x="461.42" y="-58.4" font-family="Arial" font-size="14.00">content_hash </text>
49
- <text text-anchor="start" x="549.38" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
50
- <polygon fill="none" stroke="black" stroke-width="3" points="452.92,-44.7 452.92,-391.3 728.25,-391.3 728.25,-44.7 452.92,-44.7"/>
15
+ <polygon fill="#efefef" stroke="none" points="755.49,-923 755.49,-969 1411.53,-969 1411.53,-923 755.49,-923"/>
16
+ <polygon fill="none" stroke="black" points="755.49,-923 755.49,-969 1411.53,-969 1411.53,-923 755.49,-923"/>
17
+ <text text-anchor="start" x="975.53" y="-946.8" font-family="Arial Bold" font-size="18.00">public.nodes</text>
18
+ <text text-anchor="start" x="1067.01" y="-946.8" font-family="Arial" font-size="14.00">    </text>
19
+ <text text-anchor="start" x="1098.13" y="-946.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
20
+ <text text-anchor="start" x="892.09" y="-932.4" font-family="Arial" font-size="14.00" fill="#333333">Core memory storage for conversation messages and context</text>
21
+ <polygon fill="none" stroke="black" points="755.49,-892.2 755.49,-923 1411.53,-923 1411.53,-892.2 755.49,-892.2"/>
22
+ <text text-anchor="start" x="762.49" y="-904.4" font-family="Arial" font-size="14.00">access_count </text>
23
+ <text text-anchor="start" x="851.99" y="-904.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
24
+ <text text-anchor="start" x="902.58" y="-904.4" font-family="Arial" font-size="14.00"> Number of times this node has been accessed/retrieved</text>
25
+ <polygon fill="none" stroke="black" points="755.49,-861.4 755.49,-892.2 1411.53,-892.2 1411.53,-861.4 755.49,-861.4"/>
26
+ <text text-anchor="start" x="762.49" y="-873.6" font-family="Arial" font-size="14.00">chunk_position </text>
27
+ <text text-anchor="start" x="859.78" y="-873.6" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
28
+ <text text-anchor="start" x="910.37" y="-873.6" font-family="Arial" font-size="14.00"> Position within source file (0&#45;indexed)</text>
29
+ <polygon fill="none" stroke="black" points="755.49,-830.6 755.49,-861.4 1411.53,-861.4 1411.53,-830.6 755.49,-830.6"/>
30
+ <text text-anchor="start" x="762.49" y="-842.8" font-family="Arial" font-size="14.00">content </text>
31
+ <text text-anchor="start" x="812.31" y="-842.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
32
+ <text text-anchor="start" x="842.65" y="-842.8" font-family="Arial" font-size="14.00"> The conversation message/utterance content</text>
33
+ <polygon fill="none" stroke="black" points="755.49,-799.8 755.49,-830.6 1411.53,-830.6 1411.53,-799.8 755.49,-799.8"/>
34
+ <text text-anchor="start" x="762.49" y="-812" font-family="Arial" font-size="14.00">content_hash </text>
35
+ <text text-anchor="start" x="850.45" y="-812" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
36
+ <text text-anchor="start" x="929.81" y="-812" font-family="Arial" font-size="14.00"> SHA&#45;256 hash of content for deduplication</text>
37
+ <polygon fill="none" stroke="black" points="755.49,-769 755.49,-799.8 1411.53,-799.8 1411.53,-769 755.49,-769"/>
38
+ <text text-anchor="start" x="762.49" y="-781.2" font-family="Arial" font-size="14.00">created_at </text>
39
+ <text text-anchor="start" x="832.54" y="-781.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
40
+ <text text-anchor="start" x="998.26" y="-781.2" font-family="Arial" font-size="14.00"> When this memory was created</text>
41
+ <polygon fill="none" stroke="black" points="755.49,-738.2 755.49,-769 1411.53,-769 1411.53,-738.2 755.49,-738.2"/>
42
+ <text text-anchor="start" x="762.49" y="-750.4" font-family="Arial" font-size="14.00">deleted_at </text>
43
+ <text text-anchor="start" x="831.78" y="-750.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
44
+ <text text-anchor="start" x="997.5" y="-750.4" font-family="Arial" font-size="14.00"> Soft delete timestamp &#45; node is considered deleted when set</text>
45
+ <polygon fill="none" stroke="black" points="755.49,-707.4 755.49,-738.2 1411.53,-738.2 1411.53,-707.4 755.49,-707.4"/>
46
+ <text text-anchor="start" x="762.49" y="-719.6" font-family="Arial" font-size="14.00">embedding </text>
47
+ <text text-anchor="start" x="835.66" y="-719.6" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
48
+ <text text-anchor="start" x="922.03" y="-719.6" font-family="Arial" font-size="14.00"> Vector embedding (max 2000 dimensions) for semantic search</text>
49
+ <polygon fill="none" stroke="black" points="755.49,-676.6 755.49,-707.4 1411.53,-707.4 1411.53,-676.6 755.49,-676.6"/>
50
+ <text text-anchor="start" x="762.49" y="-688.8" font-family="Arial" font-size="14.00">embedding_dimension </text>
51
+ <text text-anchor="start" x="907.26" y="-688.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
52
+ <text text-anchor="start" x="957.84" y="-688.8" font-family="Arial" font-size="14.00"> Actual number of dimensions used in the embedding vector (max 2000)</text>
53
+ <polygon fill="none" stroke="black" points="755.49,-645.8 755.49,-676.6 1411.53,-676.6 1411.53,-645.8 755.49,-645.8"/>
54
+ <text text-anchor="start" x="762.49" y="-658" font-family="Arial" font-size="14.00">id </text>
55
+ <text text-anchor="start" x="777.28" y="-658" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
56
+ <polygon fill="none" stroke="black" points="755.49,-615 755.49,-645.8 1411.53,-645.8 1411.53,-615 755.49,-615"/>
57
+ <text text-anchor="start" x="762.49" y="-627.2" font-family="Arial" font-size="14.00">last_accessed </text>
58
+ <text text-anchor="start" x="855.1" y="-627.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
59
+ <text text-anchor="start" x="1020.82" y="-627.2" font-family="Arial" font-size="14.00"> When this memory was last accessed</text>
60
+ <polygon fill="none" stroke="black" points="755.49,-584.2 755.49,-615 1411.53,-615 1411.53,-584.2 755.49,-584.2"/>
61
+ <text text-anchor="start" x="762.49" y="-596.4" font-family="Arial" font-size="14.00">metadata </text>
62
+ <text text-anchor="start" x="824.76" y="-596.4" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
63
+ <text text-anchor="start" x="866" y="-596.4" font-family="Arial" font-size="14.00"> Flexible metadata storage (memory_type, importance, source, etc.)</text>
64
+ <polygon fill="none" stroke="black" points="755.49,-553.4 755.49,-584.2 1411.53,-584.2 1411.53,-553.4 755.49,-553.4"/>
65
+ <text text-anchor="start" x="762.49" y="-565.6" font-family="Arial" font-size="14.00">source_id </text>
66
+ <text text-anchor="start" x="827.09" y="-565.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
67
+ <text text-anchor="start" x="868.33" y="-565.6" font-family="Arial" font-size="14.00"> Reference to source file (for file&#45;loaded nodes)</text>
68
+ <polygon fill="none" stroke="black" points="755.49,-522.6 755.49,-553.4 1411.53,-553.4 1411.53,-522.6 755.49,-522.6"/>
69
+ <text text-anchor="start" x="762.49" y="-534.8" font-family="Arial" font-size="14.00">token_count </text>
70
+ <text text-anchor="start" x="842.67" y="-534.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
71
+ <text text-anchor="start" x="893.25" y="-534.8" font-family="Arial" font-size="14.00"> Number of tokens in the content (for context budget management)</text>
72
+ <polygon fill="none" stroke="black" points="755.49,-491.8 755.49,-522.6 1411.53,-522.6 1411.53,-491.8 755.49,-491.8"/>
73
+ <text text-anchor="start" x="762.49" y="-504" font-family="Arial" font-size="14.00">updated_at </text>
74
+ <text text-anchor="start" x="836.45" y="-504" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
75
+ <text text-anchor="start" x="1002.18" y="-504" font-family="Arial" font-size="14.00"> When this memory was last modified</text>
76
+ <polygon fill="none" stroke="black" stroke-width="3" points="753.99,-490.3 753.99,-970.5 1413.03,-970.5 1413.03,-490.3 753.99,-490.3"/>
51
77
  </g>
52
- <!-- public.robot_nodes -->
53
- <g id="node2" class="node">
54
- <title>public.robot_nodes</title>
55
- <polygon fill="#efefef" stroke="none" points="43.2,-761.6 43.2,-797.2 355.98,-797.2 355.98,-761.6 43.2,-761.6"/>
56
- <polygon fill="none" stroke="black" points="43.2,-761.6 43.2,-797.2 355.98,-797.2 355.98,-761.6 43.2,-761.6"/>
57
- <text text-anchor="start" x="68.1" y="-775" font-family="Arial Bold" font-size="18.00">public.robot_nodes</text>
58
- <text text-anchor="start" x="206.58" y="-775" font-family="Arial" font-size="14.00">    </text>
59
- <text text-anchor="start" x="237.7" y="-775" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
60
- <polygon fill="none" stroke="black" points="43.2,-730.8 43.2,-761.6 355.98,-761.6 355.98,-730.8 43.2,-730.8"/>
61
- <text text-anchor="start" x="50.2" y="-743" font-family="Arial" font-size="14.00">id </text>
62
- <text text-anchor="start" x="64.99" y="-743" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
63
- <polygon fill="none" stroke="black" points="43.2,-700 43.2,-730.8 355.98,-730.8 355.98,-700 43.2,-700"/>
64
- <text text-anchor="start" x="50.2" y="-712.2" font-family="Arial" font-size="14.00">robot_id </text>
65
- <text text-anchor="start" x="104.68" y="-712.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
66
- <polygon fill="none" stroke="black" points="43.2,-669.2 43.2,-700 355.98,-700 355.98,-669.2 43.2,-669.2"/>
67
- <text text-anchor="start" x="50.2" y="-681.4" font-family="Arial" font-size="14.00">node_id </text>
68
- <text text-anchor="start" x="103.92" y="-681.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
69
- <polygon fill="none" stroke="black" points="43.2,-638.4 43.2,-669.2 355.98,-669.2 355.98,-638.4 43.2,-638.4"/>
70
- <text text-anchor="start" x="50.2" y="-650.6" font-family="Arial" font-size="14.00">first_remembered_at </text>
71
- <text text-anchor="start" x="183.25" y="-650.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
72
- <polygon fill="none" stroke="black" points="43.2,-607.6 43.2,-638.4 355.98,-638.4 355.98,-607.6 43.2,-607.6"/>
73
- <text text-anchor="start" x="50.2" y="-619.8" font-family="Arial" font-size="14.00">last_remembered_at </text>
74
- <text text-anchor="start" x="182.49" y="-619.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
75
- <polygon fill="none" stroke="black" points="43.2,-576.8 43.2,-607.6 355.98,-607.6 355.98,-576.8 43.2,-576.8"/>
76
- <text text-anchor="start" x="50.2" y="-589" font-family="Arial" font-size="14.00">remember_count </text>
77
- <text text-anchor="start" x="159.92" y="-589" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
78
- <polygon fill="none" stroke="black" points="43.2,-546 43.2,-576.8 355.98,-576.8 355.98,-546 43.2,-546"/>
79
- <text text-anchor="start" x="50.2" y="-558.2" font-family="Arial" font-size="14.00">created_at </text>
80
- <text text-anchor="start" x="120.25" y="-558.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
81
- <polygon fill="none" stroke="black" points="43.2,-515.2 43.2,-546 355.98,-546 355.98,-515.2 43.2,-515.2"/>
82
- <text text-anchor="start" x="50.2" y="-527.4" font-family="Arial" font-size="14.00">updated_at </text>
83
- <text text-anchor="start" x="124.16" y="-527.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
78
+ <!-- public.file_sources -->
79
+ <g id="node6" class="node">
80
+ <title>public.file_sources</title>
81
+ <polygon fill="#efefef" stroke="none" points="837.64,-320.4 837.64,-366.4 1329.38,-366.4 1329.38,-320.4 837.64,-320.4"/>
82
+ <polygon fill="none" stroke="black" points="837.64,-320.4 837.64,-366.4 1329.38,-366.4 1329.38,-320.4 837.64,-320.4"/>
83
+ <text text-anchor="start" x="953.04" y="-344.2" font-family="Arial Bold" font-size="18.00">public.file_sources</text>
84
+ <text text-anchor="start" x="1089.5" y="-344.2" font-family="Arial" font-size="14.00">    </text>
85
+ <text text-anchor="start" x="1120.61" y="-344.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
86
+ <text text-anchor="start" x="950.04" y="-329.8" font-family="Arial" font-size="14.00" fill="#333333">Source file metadata for loaded documents</text>
87
+ <polygon fill="none" stroke="black" points="837.64,-289.6 837.64,-320.4 1329.38,-320.4 1329.38,-289.6 837.64,-289.6"/>
88
+ <text text-anchor="start" x="844.64" y="-301.8" font-family="Arial" font-size="14.00">created_at </text>
89
+ <text text-anchor="start" x="914.69" y="-301.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
90
+ <polygon fill="none" stroke="black" points="837.64,-258.8 837.64,-289.6 1329.38,-289.6 1329.38,-258.8 837.64,-258.8"/>
91
+ <text text-anchor="start" x="844.64" y="-271" font-family="Arial" font-size="14.00">file_hash </text>
92
+ <text text-anchor="start" x="904.57" y="-271" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
93
+ <text text-anchor="start" x="983.93" y="-271" font-family="Arial" font-size="14.00"> SHA&#45;256 hash of file content</text>
94
+ <polygon fill="none" stroke="black" points="837.64,-228 837.64,-258.8 1329.38,-258.8 1329.38,-228 837.64,-228"/>
95
+ <text text-anchor="start" x="844.64" y="-240.2" font-family="Arial" font-size="14.00">file_path </text>
96
+ <text text-anchor="start" x="901.46" y="-240.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
97
+ <text text-anchor="start" x="931.81" y="-240.2" font-family="Arial" font-size="14.00"> Absolute path to source file</text>
98
+ <polygon fill="none" stroke="black" points="837.64,-197.2 837.64,-228 1329.38,-228 1329.38,-197.2 837.64,-197.2"/>
99
+ <text text-anchor="start" x="844.64" y="-209.4" font-family="Arial" font-size="14.00">file_size </text>
100
+ <text text-anchor="start" x="899.11" y="-209.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
101
+ <text text-anchor="start" x="949.7" y="-209.4" font-family="Arial" font-size="14.00"> File size in bytes</text>
102
+ <polygon fill="none" stroke="black" points="837.64,-166.4 837.64,-197.2 1329.38,-197.2 1329.38,-166.4 837.64,-166.4"/>
103
+ <text text-anchor="start" x="844.64" y="-178.6" font-family="Arial" font-size="14.00">frontmatter </text>
104
+ <text text-anchor="start" x="916.22" y="-178.6" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
105
+ <text text-anchor="start" x="957.47" y="-178.6" font-family="Arial" font-size="14.00"> Parsed YAML frontmatter</text>
106
+ <polygon fill="none" stroke="black" points="837.64,-135.6 837.64,-166.4 1329.38,-166.4 1329.38,-135.6 837.64,-135.6"/>
107
+ <text text-anchor="start" x="844.64" y="-147.8" font-family="Arial" font-size="14.00">id </text>
108
+ <text text-anchor="start" x="859.43" y="-147.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
109
+ <polygon fill="none" stroke="black" points="837.64,-104.8 837.64,-135.6 1329.38,-135.6 1329.38,-104.8 837.64,-104.8"/>
110
+ <text text-anchor="start" x="844.64" y="-117" font-family="Arial" font-size="14.00">last_synced_at </text>
111
+ <text text-anchor="start" x="941.92" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
112
+ <text text-anchor="start" x="1107.65" y="-117" font-family="Arial" font-size="14.00"> When file was last synced to HTM</text>
113
+ <polygon fill="none" stroke="black" points="837.64,-74 837.64,-104.8 1329.38,-104.8 1329.38,-74 837.64,-74"/>
114
+ <text text-anchor="start" x="844.64" y="-86.2" font-family="Arial" font-size="14.00">mtime </text>
115
+ <text text-anchor="start" x="886.64" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
116
+ <text text-anchor="start" x="1052.36" y="-86.2" font-family="Arial" font-size="14.00"> File modification time</text>
117
+ <polygon fill="none" stroke="black" points="837.64,-43.2 837.64,-74 1329.38,-74 1329.38,-43.2 837.64,-43.2"/>
118
+ <text text-anchor="start" x="844.64" y="-55.4" font-family="Arial" font-size="14.00">updated_at </text>
119
+ <text text-anchor="start" x="918.6" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
84
120
  </g>
85
- <!-- public.robot_nodes&#45;&gt;public.nodes -->
86
- <g id="edge1" class="edge">
87
- <title>public.robot_nodes:node_id&#45;&gt;public.nodes:id</title>
88
- <path fill="none" stroke="black" d="M366.89,-682.57C431.37,-654.23 377.23,-338.8 453.42,-338.8"/>
89
- <polygon fill="black" stroke="black" points="367.1,-682.53 356.4,-680.12 361.88,-683.6 357.63,-684.47 357.63,-684.47 357.63,-684.47 361.88,-683.6 358.21,-688.94 367.1,-682.53"/>
90
- <text text-anchor="start" x="363.98" y="-694.6" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
121
+ <!-- public.nodes&#45;&gt;public.file_sources -->
122
+ <g id="edge5" class="edge">
123
+ <title>public.nodes:source_id&#45;&gt;public.file_sources:id</title>
124
+ <path fill="none" stroke="black" d="M1422.34,-567.12C1501.04,-538.37 1421.49,-151 1330.38,-151"/>
125
+ <polygon fill="black" stroke="black" points="1422.72,-567.05 1412.1,-564.31 1417.46,-567.95 1413.19,-568.69 1413.19,-568.69 1413.19,-568.69 1417.46,-567.95 1413.62,-573.18 1422.72,-567.05"/>
126
+ <text text-anchor="start" x="1419.53" y="-578.8" font-family="Arial" font-size="10.00">FOREIGN KEY (source_id) REFERENCES file_sources(id) ON DELETE SET NULL</text>
91
127
  </g>
92
128
  <!-- public.node_tags -->
93
- <g id="node3" class="node">
129
+ <g id="node2" class="node">
94
130
  <title>public.node_tags</title>
95
- <polygon fill="#efefef" stroke="none" points="460.11,-700 460.11,-735.6 721.07,-735.6 721.07,-700 460.11,-700"/>
96
- <polygon fill="none" stroke="black" points="460.11,-700 460.11,-735.6 721.07,-735.6 721.07,-700 460.11,-700"/>
97
- <text text-anchor="start" x="467.11" y="-713.4" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
98
- <text text-anchor="start" x="589.58" y="-713.4" font-family="Arial" font-size="14.00">    </text>
99
- <text text-anchor="start" x="620.7" y="-713.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
100
- <polygon fill="none" stroke="black" points="460.11,-669.2 460.11,-700 721.07,-700 721.07,-669.2 460.11,-669.2"/>
101
- <text text-anchor="start" x="467.11" y="-681.4" font-family="Arial" font-size="14.00">id </text>
102
- <text text-anchor="start" x="481.89" y="-681.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
103
- <polygon fill="none" stroke="black" points="460.11,-638.4 460.11,-669.2 721.07,-669.2 721.07,-638.4 460.11,-638.4"/>
104
- <text text-anchor="start" x="467.11" y="-650.6" font-family="Arial" font-size="14.00">node_id </text>
105
- <text text-anchor="start" x="520.82" y="-650.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
106
- <polygon fill="none" stroke="black" points="460.11,-607.6 460.11,-638.4 721.07,-638.4 721.07,-607.6 460.11,-607.6"/>
107
- <text text-anchor="start" x="467.11" y="-619.8" font-family="Arial" font-size="14.00">tag_id </text>
108
- <text text-anchor="start" x="509.14" y="-619.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
109
- <polygon fill="none" stroke="black" points="460.11,-576.8 460.11,-607.6 721.07,-607.6 721.07,-576.8 460.11,-576.8"/>
110
- <text text-anchor="start" x="467.11" y="-589" font-family="Arial" font-size="14.00">created_at </text>
111
- <text text-anchor="start" x="537.15" y="-589" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
131
+ <polygon fill="#efefef" stroke="none" points="496.91,-1294.6 496.91,-1340.6 966.12,-1340.6 966.12,-1294.6 496.91,-1294.6"/>
132
+ <polygon fill="none" stroke="black" points="496.91,-1294.6 496.91,-1340.6 966.12,-1340.6 966.12,-1294.6 496.91,-1294.6"/>
133
+ <text text-anchor="start" x="608.03" y="-1318.4" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
134
+ <text text-anchor="start" x="730.51" y="-1318.4" font-family="Arial" font-size="14.00">    </text>
135
+ <text text-anchor="start" x="761.62" y="-1318.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
136
+ <text text-anchor="start" x="570.43" y="-1304" font-family="Arial" font-size="14.00" fill="#333333">Join table connecting nodes to tags (many&#45;to&#45;many)</text>
137
+ <polygon fill="none" stroke="black" points="496.91,-1263.8 496.91,-1294.6 966.12,-1294.6 966.12,-1263.8 496.91,-1263.8"/>
138
+ <text text-anchor="start" x="503.91" y="-1276" font-family="Arial" font-size="14.00">created_at </text>
139
+ <text text-anchor="start" x="573.95" y="-1276" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
140
+ <text text-anchor="start" x="739.68" y="-1276" font-family="Arial" font-size="14.00"> When this association was created</text>
141
+ <polygon fill="none" stroke="black" points="496.91,-1233 496.91,-1263.8 966.12,-1263.8 966.12,-1233 496.91,-1233"/>
142
+ <text text-anchor="start" x="503.91" y="-1245.2" font-family="Arial" font-size="14.00">id </text>
143
+ <text text-anchor="start" x="518.69" y="-1245.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
144
+ <polygon fill="none" stroke="black" points="496.91,-1202.2 496.91,-1233 966.12,-1233 966.12,-1202.2 496.91,-1202.2"/>
145
+ <text text-anchor="start" x="503.91" y="-1214.4" font-family="Arial" font-size="14.00">node_id </text>
146
+ <text text-anchor="start" x="557.62" y="-1214.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
147
+ <text text-anchor="start" x="598.87" y="-1214.4" font-family="Arial" font-size="14.00"> ID of the node being tagged</text>
148
+ <polygon fill="none" stroke="black" points="496.91,-1171.4 496.91,-1202.2 966.12,-1202.2 966.12,-1171.4 496.91,-1171.4"/>
149
+ <text text-anchor="start" x="503.91" y="-1183.6" font-family="Arial" font-size="14.00">tag_id </text>
150
+ <text text-anchor="start" x="545.94" y="-1183.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
151
+ <text text-anchor="start" x="587.19" y="-1183.6" font-family="Arial" font-size="14.00"> ID of the tag being applied</text>
112
152
  </g>
113
153
  <!-- public.node_tags&#45;&gt;public.nodes -->
114
- <g id="edge2" class="edge">
154
+ <g id="edge1" class="edge">
115
155
  <title>public.node_tags:node_id&#45;&gt;public.nodes:id</title>
116
- <path fill="none" stroke="black" d="M730.26,-647.51C757.74,-603.11 759.82,-338.8 727.75,-338.8"/>
117
- <polygon fill="black" stroke="black" points="730.27,-647.51 719.6,-650.03 726.04,-650.75 722.6,-653.39 722.6,-653.39 722.6,-653.39 726.04,-650.75 725.08,-657.17 730.27,-647.51"/>
118
- <text text-anchor="start" x="375.53" y="-663.8" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
156
+ <path fill="none" stroke="black" d="M977.1,-1216.09C1002.92,-1206.98 984.7,-1158.86 966.12,-1128.2 911.07,-1037.35 810.17,-1106.28 755.49,-1015.2 715.01,-947.75 675.83,-661.2 754.49,-661.2"/>
157
+ <polygon fill="black" stroke="black" points="977.34,-1216.05 966.77,-1213.1 972.06,-1216.85 967.78,-1217.5 967.78,-1217.5 967.78,-1217.5 972.06,-1216.85 968.12,-1222 977.34,-1216.05"/>
158
+ <text text-anchor="start" x="974.12" y="-1227.6" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
119
159
  </g>
120
- <!-- public.working_memories -->
160
+ <!-- public.tags -->
161
+ <g id="node3" class="node">
162
+ <title>public.tags</title>
163
+ <polygon fill="#efefef" stroke="none" points="43.2,-753.6 43.2,-799.6 647.83,-799.6 647.83,-753.6 43.2,-753.6"/>
164
+ <polygon fill="none" stroke="black" points="43.2,-753.6 43.2,-799.6 647.83,-799.6 647.83,-753.6 43.2,-753.6"/>
165
+ <text text-anchor="start" x="244.02" y="-777.4" font-family="Arial Bold" font-size="18.00">public.tags</text>
166
+ <text text-anchor="start" x="322.51" y="-777.4" font-family="Arial" font-size="14.00">    </text>
167
+ <text text-anchor="start" x="353.63" y="-777.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
168
+ <text text-anchor="start" x="233.06" y="-763" font-family="Arial" font-size="14.00" fill="#333333">Unique tag names for categorization</text>
169
+ <polygon fill="none" stroke="black" points="43.2,-722.8 43.2,-753.6 647.83,-753.6 647.83,-722.8 43.2,-722.8"/>
170
+ <text text-anchor="start" x="50.2" y="-735" font-family="Arial" font-size="14.00">created_at </text>
171
+ <text text-anchor="start" x="120.25" y="-735" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
172
+ <text text-anchor="start" x="285.97" y="-735" font-family="Arial" font-size="14.00"> When this tag was created</text>
173
+ <polygon fill="none" stroke="black" points="43.2,-692 43.2,-722.8 647.83,-722.8 647.83,-692 43.2,-692"/>
174
+ <text text-anchor="start" x="50.2" y="-704.2" font-family="Arial" font-size="14.00">id </text>
175
+ <text text-anchor="start" x="64.99" y="-704.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
176
+ <polygon fill="none" stroke="black" points="43.2,-661.2 43.2,-692 647.83,-692 647.83,-661.2 43.2,-661.2"/>
177
+ <text text-anchor="start" x="50.2" y="-673.4" font-family="Arial" font-size="14.00">name </text>
178
+ <text text-anchor="start" x="89.11" y="-673.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
179
+ <text text-anchor="start" x="119.45" y="-673.4" font-family="Arial" font-size="14.00"> Hierarchical tag in format: root:level1:level2 (e.g., database:postgresql:timescaledb)</text>
180
+ </g>
181
+ <!-- public.node_tags&#45;&gt;public.tags -->
182
+ <g id="edge2" class="edge">
183
+ <title>public.node_tags:tag_id&#45;&gt;public.tags:id</title>
184
+ <path fill="none" stroke="black" d="M485.73,-1186.43C291.39,-1171.48 868.87,-707.4 648.83,-707.4"/>
185
+ <polygon fill="black" stroke="black" points="485.58,-1186.42 495.41,-1191.28 490.91,-1186.62 495.24,-1186.78 495.24,-1186.78 495.24,-1186.78 490.91,-1186.62 495.74,-1182.29 485.58,-1186.42"/>
186
+ <text text-anchor="start" x="166.05" y="-1196.8" font-family="Arial" font-size="10.00">FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE</text>
187
+ </g>
188
+ <!-- public.robot_nodes -->
121
189
  <g id="node4" class="node">
122
- <title>public.working_memories</title>
123
- <polygon fill="#efefef" stroke="none" points="825.61,-715.4 825.61,-751 1153.57,-751 1153.57,-715.4 825.61,-715.4"/>
124
- <polygon fill="none" stroke="black" points="825.61,-715.4 825.61,-751 1153.57,-751 1153.57,-715.4 825.61,-715.4"/>
125
- <text text-anchor="start" x="832.61" y="-728.8" font-family="Arial Bold" font-size="18.00">public.working_memories</text>
126
- <text text-anchor="start" x="1022.08" y="-728.8" font-family="Arial" font-size="14.00">    </text>
127
- <text text-anchor="start" x="1053.19" y="-728.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
128
- <polygon fill="none" stroke="black" points="825.61,-684.6 825.61,-715.4 1153.57,-715.4 1153.57,-684.6 825.61,-684.6"/>
129
- <text text-anchor="start" x="832.61" y="-696.8" font-family="Arial" font-size="14.00">id </text>
130
- <text text-anchor="start" x="847.4" y="-696.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
131
- <polygon fill="none" stroke="black" points="825.61,-653.8 825.61,-684.6 1153.57,-684.6 1153.57,-653.8 825.61,-653.8"/>
132
- <text text-anchor="start" x="832.61" y="-666" font-family="Arial" font-size="14.00">robot_id </text>
133
- <text text-anchor="start" x="887.09" y="-666" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
134
- <polygon fill="none" stroke="black" points="825.61,-623 825.61,-653.8 1153.57,-653.8 1153.57,-623 825.61,-623"/>
135
- <text text-anchor="start" x="832.61" y="-635.2" font-family="Arial" font-size="14.00">node_id </text>
136
- <text text-anchor="start" x="886.33" y="-635.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
137
- <polygon fill="none" stroke="black" points="825.61,-592.2 825.61,-623 1153.57,-623 1153.57,-592.2 825.61,-592.2"/>
138
- <text text-anchor="start" x="832.61" y="-604.4" font-family="Arial" font-size="14.00">added_at </text>
139
- <text text-anchor="start" x="894.89" y="-604.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
140
- <polygon fill="none" stroke="black" points="825.61,-561.4 825.61,-592.2 1153.57,-592.2 1153.57,-561.4 825.61,-561.4"/>
141
- <text text-anchor="start" x="832.61" y="-573.6" font-family="Arial" font-size="14.00">token_count </text>
142
- <text text-anchor="start" x="912.78" y="-573.6" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
190
+ <title>public.robot_nodes</title>
191
+ <polygon fill="#efefef" stroke="none" points="1112.77,-1371.6 1112.77,-1417.6 1742.26,-1417.6 1742.26,-1371.6 1112.77,-1371.6"/>
192
+ <polygon fill="none" stroke="black" points="1112.77,-1371.6 1112.77,-1417.6 1742.26,-1417.6 1742.26,-1371.6 1112.77,-1371.6"/>
193
+ <text text-anchor="start" x="1296.03" y="-1395.4" font-family="Arial Bold" font-size="18.00">public.robot_nodes</text>
194
+ <text text-anchor="start" x="1434.51" y="-1395.4" font-family="Arial" font-size="14.00">    </text>
195
+ <text text-anchor="start" x="1465.63" y="-1395.4" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
196
+ <text text-anchor="start" x="1260.2" y="-1381" font-family="Arial" font-size="14.00" fill="#333333">Join table connecting robots to nodes (many&#45;to&#45;many)</text>
197
+ <polygon fill="none" stroke="black" points="1112.77,-1340.8 1112.77,-1371.6 1742.26,-1371.6 1742.26,-1340.8 1112.77,-1340.8"/>
198
+ <text text-anchor="start" x="1119.77" y="-1353" font-family="Arial" font-size="14.00">created_at </text>
199
+ <text text-anchor="start" x="1189.82" y="-1353" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
200
+ <polygon fill="none" stroke="black" points="1112.77,-1310 1112.77,-1340.8 1742.26,-1340.8 1742.26,-1310 1112.77,-1310"/>
201
+ <text text-anchor="start" x="1119.77" y="-1322.2" font-family="Arial" font-size="14.00">first_remembered_at </text>
202
+ <text text-anchor="start" x="1252.82" y="-1322.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
203
+ <text text-anchor="start" x="1418.55" y="-1322.2" font-family="Arial" font-size="14.00"> When this robot first remembered this content</text>
204
+ <polygon fill="none" stroke="black" points="1112.77,-1279.2 1112.77,-1310 1742.26,-1310 1742.26,-1279.2 1112.77,-1279.2"/>
205
+ <text text-anchor="start" x="1119.77" y="-1291.4" font-family="Arial" font-size="14.00">id </text>
206
+ <text text-anchor="start" x="1134.55" y="-1291.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
207
+ <polygon fill="none" stroke="black" points="1112.77,-1248.4 1112.77,-1279.2 1742.26,-1279.2 1742.26,-1248.4 1112.77,-1248.4"/>
208
+ <text text-anchor="start" x="1119.77" y="-1260.6" font-family="Arial" font-size="14.00">last_remembered_at </text>
209
+ <text text-anchor="start" x="1252.06" y="-1260.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
210
+ <text text-anchor="start" x="1417.78" y="-1260.6" font-family="Arial" font-size="14.00"> When this robot last tried to remember this content</text>
211
+ <polygon fill="none" stroke="black" points="1112.77,-1217.6 1112.77,-1248.4 1742.26,-1248.4 1742.26,-1217.6 1112.77,-1217.6"/>
212
+ <text text-anchor="start" x="1119.77" y="-1229.8" font-family="Arial" font-size="14.00">node_id </text>
213
+ <text text-anchor="start" x="1173.49" y="-1229.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
214
+ <text text-anchor="start" x="1214.73" y="-1229.8" font-family="Arial" font-size="14.00"> ID of the node being remembered</text>
215
+ <polygon fill="none" stroke="black" points="1112.77,-1186.8 1112.77,-1217.6 1742.26,-1217.6 1742.26,-1186.8 1112.77,-1186.8"/>
216
+ <text text-anchor="start" x="1119.77" y="-1199" font-family="Arial" font-size="14.00">remember_count </text>
217
+ <text text-anchor="start" x="1229.49" y="-1199" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
218
+ <text text-anchor="start" x="1280.07" y="-1199" font-family="Arial" font-size="14.00"> Number of times this robot has tried to remember this content</text>
219
+ <polygon fill="none" stroke="black" points="1112.77,-1156 1112.77,-1186.8 1742.26,-1186.8 1742.26,-1156 1112.77,-1156"/>
220
+ <text text-anchor="start" x="1119.77" y="-1168.2" font-family="Arial" font-size="14.00">robot_id </text>
221
+ <text text-anchor="start" x="1174.25" y="-1168.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
222
+ <text text-anchor="start" x="1215.5" y="-1168.2" font-family="Arial" font-size="14.00"> ID of the robot that remembered this node</text>
223
+ <polygon fill="none" stroke="black" points="1112.77,-1125.2 1112.77,-1156 1742.26,-1156 1742.26,-1125.2 1112.77,-1125.2"/>
224
+ <text text-anchor="start" x="1119.77" y="-1137.4" font-family="Arial" font-size="14.00">updated_at </text>
225
+ <text text-anchor="start" x="1193.73" y="-1137.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
226
+ <polygon fill="none" stroke="black" points="1112.77,-1094.4 1112.77,-1125.2 1742.26,-1125.2 1742.26,-1094.4 1112.77,-1094.4"/>
227
+ <text text-anchor="start" x="1119.77" y="-1106.6" font-family="Arial" font-size="14.00">working_memory </text>
228
+ <text text-anchor="start" x="1230.24" y="-1106.6" font-family="Arial" font-size="14.00" fill="#666666">[boolean]</text>
229
+ <text text-anchor="start" x="1287.85" y="-1106.6" font-family="Arial" font-size="14.00"> True if this node is currently in the robot working memory</text>
143
230
  </g>
144
- <!-- public.working_memories&#45;&gt;public.nodes -->
231
+ <!-- public.robot_nodes&#45;&gt;public.nodes -->
145
232
  <g id="edge3" class="edge">
146
- <title>public.working_memories:node_id&#45;&gt;public.nodes:id</title>
147
- <path fill="none" stroke="black" d="M814.8,-636.16C758.73,-608.74 794.17,-338.8 727.75,-338.8"/>
148
- <polygon fill="black" stroke="black" points="814.54,-636.1 823.28,-642.71 819.74,-637.29 823.96,-638.25 823.96,-638.25 823.96,-638.25 819.74,-637.29 825.29,-633.94 814.54,-636.1"/>
149
- <text text-anchor="start" x="566.45" y="-622.4" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
233
+ <title>public.robot_nodes:node_id&#45;&gt;public.nodes:id</title>
234
+ <path fill="none" stroke="black" d="M1101.53,-1232.28C1033.54,-1222.21 1061.41,-1108.8 1112.77,-1051.2 1201.78,-951.38 1322.66,-1115.14 1411.53,-1015.2 1463.81,-956.41 1491.2,-661.2 1412.53,-661.2"/>
235
+ <polygon fill="black" stroke="black" points="1101.46,-1232.28 1111.12,-1237.47 1106.78,-1232.65 1111.1,-1232.95 1111.1,-1232.95 1111.1,-1232.95 1106.78,-1232.65 1111.75,-1228.49 1101.46,-1232.28"/>
236
+ <text text-anchor="start" x="853.61" y="-1217" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
237
+ </g>
238
+ <!-- public.robots -->
239
+ <g id="node5" class="node">
240
+ <title>public.robots</title>
241
+ <polygon fill="#efefef" stroke="none" points="1519.41,-769 1519.41,-815 2023.62,-815 2023.62,-769 1519.41,-769"/>
242
+ <polygon fill="none" stroke="black" points="1519.41,-769 1519.41,-815 2023.62,-815 2023.62,-769 1519.41,-769"/>
243
+ <text text-anchor="start" x="1662.02" y="-792.8" font-family="Arial Bold" font-size="18.00">public.robots</text>
244
+ <text text-anchor="start" x="1756.51" y="-792.8" font-family="Arial" font-size="14.00">    </text>
245
+ <text text-anchor="start" x="1787.63" y="-792.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
246
+ <text text-anchor="start" x="1620.57" y="-778.4" font-family="Arial" font-size="14.00" fill="#333333">Registry of all LLM robots using the HTM system</text>
247
+ <polygon fill="none" stroke="black" points="1519.41,-738.2 1519.41,-769 2023.62,-769 2023.62,-738.2 1519.41,-738.2"/>
248
+ <text text-anchor="start" x="1526.41" y="-750.4" font-family="Arial" font-size="14.00">created_at </text>
249
+ <text text-anchor="start" x="1596.45" y="-750.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
250
+ <text text-anchor="start" x="1762.18" y="-750.4" font-family="Arial" font-size="14.00"> When the robot was first registered</text>
251
+ <polygon fill="none" stroke="black" points="1519.41,-707.4 1519.41,-738.2 2023.62,-738.2 2023.62,-707.4 1519.41,-707.4"/>
252
+ <text text-anchor="start" x="1526.41" y="-719.6" font-family="Arial" font-size="14.00">id </text>
253
+ <text text-anchor="start" x="1541.19" y="-719.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
254
+ <polygon fill="none" stroke="black" points="1519.41,-676.6 1519.41,-707.4 2023.62,-707.4 2023.62,-676.6 1519.41,-676.6"/>
255
+ <text text-anchor="start" x="1526.41" y="-688.8" font-family="Arial" font-size="14.00">last_active </text>
256
+ <text text-anchor="start" x="1596.44" y="-688.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
257
+ <text text-anchor="start" x="1762.16" y="-688.8" font-family="Arial" font-size="14.00"> Last time the robot accessed the system</text>
258
+ <polygon fill="none" stroke="black" points="1519.41,-645.8 1519.41,-676.6 2023.62,-676.6 2023.62,-645.8 1519.41,-645.8"/>
259
+ <text text-anchor="start" x="1526.41" y="-658" font-family="Arial" font-size="14.00">name </text>
260
+ <text text-anchor="start" x="1565.32" y="-658" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
261
+ <text text-anchor="start" x="1595.66" y="-658" font-family="Arial" font-size="14.00"> Human&#45;readable name for the robot</text>
262
+ </g>
263
+ <!-- public.robot_nodes&#45;&gt;public.robots -->
264
+ <g id="edge4" class="edge">
265
+ <title>public.robot_nodes:robot_id&#45;&gt;public.robots:id</title>
266
+ <path fill="none" stroke="black" d="M1753.29,-1170.37C1792.22,-1161.43 1763.08,-1096.29 1742.26,-1051.2 1687.32,-932.25 1574.29,-977.18 1519.41,-858.2 1494.2,-803.55 1458.23,-722.8 1518.41,-722.8"/>
267
+ <polygon fill="black" stroke="black" points="1753.54,-1170.34 1743.13,-1166.89 1748.23,-1170.89 1743.92,-1171.33 1743.92,-1171.33 1743.92,-1171.33 1748.23,-1170.89 1744.05,-1175.84 1753.54,-1170.34"/>
268
+ <text text-anchor="start" x="1750.26" y="-1181.4" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
150
269
  </g>
151
270
  </g>
152
271
  </svg>
@@ -8,32 +8,34 @@ Join table connecting robots to nodes (many-to-many)
8
8
 
9
9
  | Name | Type | Default | Nullable | Children | Parents | Comment |
10
10
  | ---- | ---- | ------- | -------- | -------- | ------- | ------- |
11
- | id | bigint | nextval('robot_nodes_id_seq'::regclass) | false | | | |
12
- | robot_id | bigint | | false | | [public.robots](public.robots.md) | ID of the robot that remembered this node |
13
- | node_id | bigint | | false | | [public.nodes](public.nodes.md) | ID of the node being remembered |
11
+ | created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
14
12
  | first_remembered_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this robot first remembered this content |
13
+ | id | bigint | nextval('robot_nodes_id_seq'::regclass) | false | | | |
15
14
  | last_remembered_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this robot last tried to remember this content |
15
+ | node_id | bigint | | false | | [public.nodes](public.nodes.md) | ID of the node being remembered |
16
16
  | remember_count | integer | 1 | false | | | Number of times this robot has tried to remember this content |
17
- | created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
17
+ | robot_id | bigint | | false | | [public.robots](public.robots.md) | ID of the robot that remembered this node |
18
18
  | updated_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | |
19
+ | working_memory | boolean | false | false | | | True if this node is currently in the robot working memory |
19
20
 
20
21
  ## Constraints
21
22
 
22
23
  | Name | Type | Definition |
23
24
  | ---- | ---- | ---------- |
24
- | robot_nodes_pkey | PRIMARY KEY | PRIMARY KEY (id) |
25
25
  | fk_rails_9b003078a8 | FOREIGN KEY | FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE |
26
26
  | fk_rails_f2fc98d49e | FOREIGN KEY | FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE |
27
+ | robot_nodes_pkey | PRIMARY KEY | PRIMARY KEY (id) |
27
28
 
28
29
  ## Indexes
29
30
 
30
31
  | Name | Definition |
31
32
  | ---- | ---------- |
32
- | robot_nodes_pkey | CREATE UNIQUE INDEX robot_nodes_pkey ON public.robot_nodes USING btree (id) |
33
- | idx_robot_nodes_unique | CREATE UNIQUE INDEX idx_robot_nodes_unique ON public.robot_nodes USING btree (robot_id, node_id) |
34
- | idx_robot_nodes_robot_id | CREATE INDEX idx_robot_nodes_robot_id ON public.robot_nodes USING btree (robot_id) |
35
- | idx_robot_nodes_node_id | CREATE INDEX idx_robot_nodes_node_id ON public.robot_nodes USING btree (node_id) |
36
33
  | idx_robot_nodes_last_remembered_at | CREATE INDEX idx_robot_nodes_last_remembered_at ON public.robot_nodes USING btree (last_remembered_at) |
34
+ | idx_robot_nodes_node_id | CREATE INDEX idx_robot_nodes_node_id ON public.robot_nodes USING btree (node_id) |
35
+ | idx_robot_nodes_robot_id | CREATE INDEX idx_robot_nodes_robot_id ON public.robot_nodes USING btree (robot_id) |
36
+ | idx_robot_nodes_unique | CREATE UNIQUE INDEX idx_robot_nodes_unique ON public.robot_nodes USING btree (robot_id, node_id) |
37
+ | idx_robot_nodes_working_memory | CREATE INDEX idx_robot_nodes_working_memory ON public.robot_nodes USING btree (robot_id, working_memory) WHERE (working_memory = true) |
38
+ | robot_nodes_pkey | CREATE UNIQUE INDEX robot_nodes_pkey ON public.robot_nodes USING btree (id) |
37
39
 
38
40
  ## Relations
39
41