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,103 +4,158 @@
4
4
  <!-- Generated by graphviz version 12.1.2 (20240928.0832)
5
5
  -->
6
6
  <!-- Title: public.robots Pages: 1 -->
7
- <svg width="840pt" height="664pt"
8
- viewBox="0.00 0.00 839.77 663.60" 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 659.6)">
7
+ <svg width="1394pt" height="1017pt"
8
+ viewBox="0.00 0.00 1393.60 1017.20" 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 1013.2)">
10
10
  <title>public.robots</title>
11
- <polygon fill="white" stroke="none" points="-4,4 -4,-659.6 835.77,-659.6 835.77,4 -4,4"/>
11
+ <polygon fill="white" stroke="none" points="-4,4 -4,-1013.2 1389.6,-1013.2 1389.6,4 -4,4"/>
12
12
  <!-- public.robots -->
13
13
  <g id="node1" class="node">
14
14
  <title>public.robots</title>
15
- <polygon fill="#efefef" stroke="none" points="286.7,-169.4 286.7,-205 536.47,-205 536.47,-169.4 286.7,-169.4"/>
16
- <polygon fill="none" stroke="black" points="286.7,-169.4 286.7,-205 536.47,-205 536.47,-169.4 286.7,-169.4"/>
17
- <text text-anchor="start" x="302.1" y="-182.8" font-family="Arial Bold" font-size="18.00">public.robots</text>
18
- <text text-anchor="start" x="396.59" y="-182.8" font-family="Arial" font-size="14.00">    </text>
19
- <text text-anchor="start" x="427.71" y="-182.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
20
- <polygon fill="none" stroke="black" points="286.7,-138.6 286.7,-169.4 536.47,-169.4 536.47,-138.6 286.7,-138.6"/>
21
- <text text-anchor="start" x="293.7" y="-150.8" font-family="Arial" font-size="14.00">id </text>
22
- <text text-anchor="start" x="308.49" y="-150.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
23
- <polygon fill="none" stroke="black" points="286.7,-107.8 286.7,-138.6 536.47,-138.6 536.47,-107.8 286.7,-107.8"/>
24
- <text text-anchor="start" x="293.7" y="-120" font-family="Arial" font-size="14.00">name </text>
25
- <text text-anchor="start" x="332.61" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
26
- <polygon fill="none" stroke="black" points="286.7,-77 286.7,-107.8 536.47,-107.8 536.47,-77 286.7,-77"/>
27
- <text text-anchor="start" x="293.7" y="-89.2" font-family="Arial" font-size="14.00">created_at </text>
28
- <text text-anchor="start" x="363.75" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
29
- <polygon fill="none" stroke="black" points="286.7,-46.2 286.7,-77 536.47,-77 536.47,-46.2 286.7,-46.2"/>
30
- <text text-anchor="start" x="293.7" y="-58.4" font-family="Arial" font-size="14.00">last_active </text>
31
- <text text-anchor="start" x="363.74" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
32
- <polygon fill="none" stroke="black" stroke-width="3" points="285.2,-44.7 285.2,-206.5 537.97,-206.5 537.97,-44.7 285.2,-44.7"/>
15
+ <polygon fill="#efefef" stroke="none" points="74.28,-320.4 74.28,-366.4 578.49,-366.4 578.49,-320.4 74.28,-320.4"/>
16
+ <polygon fill="none" stroke="black" points="74.28,-320.4 74.28,-366.4 578.49,-366.4 578.49,-320.4 74.28,-320.4"/>
17
+ <text text-anchor="start" x="216.89" y="-344.2" font-family="Arial Bold" font-size="18.00">public.robots</text>
18
+ <text text-anchor="start" x="311.38" y="-344.2" font-family="Arial" font-size="14.00">    </text>
19
+ <text text-anchor="start" x="342.5" y="-344.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
20
+ <text text-anchor="start" x="175.44" y="-329.8" font-family="Arial" font-size="14.00" fill="#333333">Registry of all LLM robots using the HTM system</text>
21
+ <polygon fill="none" stroke="black" points="74.28,-289.6 74.28,-320.4 578.49,-320.4 578.49,-289.6 74.28,-289.6"/>
22
+ <text text-anchor="start" x="81.28" y="-301.8" font-family="Arial" font-size="14.00">created_at </text>
23
+ <text text-anchor="start" x="151.33" y="-301.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
24
+ <text text-anchor="start" x="317.05" y="-301.8" font-family="Arial" font-size="14.00"> When the robot was first registered</text>
25
+ <polygon fill="none" stroke="black" points="74.28,-258.8 74.28,-289.6 578.49,-289.6 578.49,-258.8 74.28,-258.8"/>
26
+ <text text-anchor="start" x="81.28" y="-271" font-family="Arial" font-size="14.00">id </text>
27
+ <text text-anchor="start" x="96.06" y="-271" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
28
+ <polygon fill="none" stroke="black" points="74.28,-228 74.28,-258.8 578.49,-258.8 578.49,-228 74.28,-228"/>
29
+ <text text-anchor="start" x="81.28" y="-240.2" font-family="Arial" font-size="14.00">last_active </text>
30
+ <text text-anchor="start" x="151.31" y="-240.2" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
31
+ <text text-anchor="start" x="317.04" y="-240.2" font-family="Arial" font-size="14.00"> Last time the robot accessed the system</text>
32
+ <polygon fill="none" stroke="black" points="74.28,-197.2 74.28,-228 578.49,-228 578.49,-197.2 74.28,-197.2"/>
33
+ <text text-anchor="start" x="81.28" y="-209.4" font-family="Arial" font-size="14.00">name </text>
34
+ <text text-anchor="start" x="120.19" y="-209.4" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
35
+ <text text-anchor="start" x="150.53" y="-209.4" font-family="Arial" font-size="14.00"> Human&#45;readable name for the robot</text>
36
+ <polygon fill="none" stroke="black" stroke-width="3" points="72.78,-195.7 72.78,-367.9 579.99,-367.9 579.99,-195.7 72.78,-195.7"/>
33
37
  </g>
34
38
  <!-- public.robot_nodes -->
35
39
  <g id="node2" class="node">
36
40
  <title>public.robot_nodes</title>
37
- <polygon fill="#efefef" stroke="none" points="43.2,-576.8 43.2,-612.4 355.98,-612.4 355.98,-576.8 43.2,-576.8"/>
38
- <polygon fill="none" stroke="black" points="43.2,-576.8 43.2,-612.4 355.98,-612.4 355.98,-576.8 43.2,-576.8"/>
39
- <text text-anchor="start" x="68.1" y="-590.2" font-family="Arial Bold" font-size="18.00">public.robot_nodes</text>
40
- <text text-anchor="start" x="206.58" y="-590.2" font-family="Arial" font-size="14.00">    </text>
41
- <text text-anchor="start" x="237.7" y="-590.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
42
- <polygon fill="none" stroke="black" points="43.2,-546 43.2,-576.8 355.98,-576.8 355.98,-546 43.2,-546"/>
43
- <text text-anchor="start" x="50.2" y="-558.2" font-family="Arial" font-size="14.00">id </text>
44
- <text text-anchor="start" x="64.99" y="-558.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
45
- <polygon fill="none" stroke="black" points="43.2,-515.2 43.2,-546 355.98,-546 355.98,-515.2 43.2,-515.2"/>
46
- <text text-anchor="start" x="50.2" y="-527.4" font-family="Arial" font-size="14.00">robot_id </text>
47
- <text text-anchor="start" x="104.68" y="-527.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
48
- <polygon fill="none" stroke="black" points="43.2,-484.4 43.2,-515.2 355.98,-515.2 355.98,-484.4 43.2,-484.4"/>
49
- <text text-anchor="start" x="50.2" y="-496.6" font-family="Arial" font-size="14.00">node_id </text>
50
- <text text-anchor="start" x="103.92" y="-496.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
51
- <polygon fill="none" stroke="black" points="43.2,-453.6 43.2,-484.4 355.98,-484.4 355.98,-453.6 43.2,-453.6"/>
52
- <text text-anchor="start" x="50.2" y="-465.8" font-family="Arial" font-size="14.00">first_remembered_at </text>
53
- <text text-anchor="start" x="183.25" y="-465.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
54
- <polygon fill="none" stroke="black" points="43.2,-422.8 43.2,-453.6 355.98,-453.6 355.98,-422.8 43.2,-422.8"/>
55
- <text text-anchor="start" x="50.2" y="-435" font-family="Arial" font-size="14.00">last_remembered_at </text>
56
- <text text-anchor="start" x="182.49" y="-435" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
57
- <polygon fill="none" stroke="black" points="43.2,-392 43.2,-422.8 355.98,-422.8 355.98,-392 43.2,-392"/>
58
- <text text-anchor="start" x="50.2" y="-404.2" font-family="Arial" font-size="14.00">remember_count </text>
59
- <text text-anchor="start" x="159.92" y="-404.2" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
60
- <polygon fill="none" stroke="black" points="43.2,-361.2 43.2,-392 355.98,-392 355.98,-361.2 43.2,-361.2"/>
61
- <text text-anchor="start" x="50.2" y="-373.4" font-family="Arial" font-size="14.00">created_at </text>
62
- <text text-anchor="start" x="120.25" y="-373.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
63
- <polygon fill="none" stroke="black" points="43.2,-330.4 43.2,-361.2 355.98,-361.2 355.98,-330.4 43.2,-330.4"/>
64
- <text text-anchor="start" x="50.2" y="-342.6" font-family="Arial" font-size="14.00">updated_at </text>
65
- <text text-anchor="start" x="124.16" y="-342.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
41
+ <polygon fill="#efefef" stroke="none" points="355.64,-920 355.64,-966 985.13,-966 985.13,-920 355.64,-920"/>
42
+ <polygon fill="none" stroke="black" points="355.64,-920 355.64,-966 985.13,-966 985.13,-920 355.64,-920"/>
43
+ <text text-anchor="start" x="538.9" y="-943.8" font-family="Arial Bold" font-size="18.00">public.robot_nodes</text>
44
+ <text text-anchor="start" x="677.38" y="-943.8" font-family="Arial" font-size="14.00">    </text>
45
+ <text text-anchor="start" x="708.5" y="-943.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
46
+ <text text-anchor="start" x="503.07" y="-929.4" font-family="Arial" font-size="14.00" fill="#333333">Join table connecting robots to nodes (many&#45;to&#45;many)</text>
47
+ <polygon fill="none" stroke="black" points="355.64,-889.2 355.64,-920 985.13,-920 985.13,-889.2 355.64,-889.2"/>
48
+ <text text-anchor="start" x="362.64" y="-901.4" font-family="Arial" font-size="14.00">created_at </text>
49
+ <text text-anchor="start" x="432.69" y="-901.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
50
+ <polygon fill="none" stroke="black" points="355.64,-858.4 355.64,-889.2 985.13,-889.2 985.13,-858.4 355.64,-858.4"/>
51
+ <text text-anchor="start" x="362.64" y="-870.6" font-family="Arial" font-size="14.00">first_remembered_at </text>
52
+ <text text-anchor="start" x="495.69" y="-870.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
53
+ <text text-anchor="start" x="661.42" y="-870.6" font-family="Arial" font-size="14.00"> When this robot first remembered this content</text>
54
+ <polygon fill="none" stroke="black" points="355.64,-827.6 355.64,-858.4 985.13,-858.4 985.13,-827.6 355.64,-827.6"/>
55
+ <text text-anchor="start" x="362.64" y="-839.8" font-family="Arial" font-size="14.00">id </text>
56
+ <text text-anchor="start" x="377.43" y="-839.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
57
+ <polygon fill="none" stroke="black" points="355.64,-796.8 355.64,-827.6 985.13,-827.6 985.13,-796.8 355.64,-796.8"/>
58
+ <text text-anchor="start" x="362.64" y="-809" font-family="Arial" font-size="14.00">last_remembered_at </text>
59
+ <text text-anchor="start" x="494.93" y="-809" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
60
+ <text text-anchor="start" x="660.65" y="-809" font-family="Arial" font-size="14.00"> When this robot last tried to remember this content</text>
61
+ <polygon fill="none" stroke="black" points="355.64,-766 355.64,-796.8 985.13,-796.8 985.13,-766 355.64,-766"/>
62
+ <text text-anchor="start" x="362.64" y="-778.2" font-family="Arial" font-size="14.00">node_id </text>
63
+ <text text-anchor="start" x="416.36" y="-778.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
64
+ <text text-anchor="start" x="457.6" y="-778.2" font-family="Arial" font-size="14.00"> ID of the node being remembered</text>
65
+ <polygon fill="none" stroke="black" points="355.64,-735.2 355.64,-766 985.13,-766 985.13,-735.2 355.64,-735.2"/>
66
+ <text text-anchor="start" x="362.64" y="-747.4" font-family="Arial" font-size="14.00">remember_count </text>
67
+ <text text-anchor="start" x="472.36" y="-747.4" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
68
+ <text text-anchor="start" x="522.94" y="-747.4" font-family="Arial" font-size="14.00"> Number of times this robot has tried to remember this content</text>
69
+ <polygon fill="none" stroke="black" points="355.64,-704.4 355.64,-735.2 985.13,-735.2 985.13,-704.4 355.64,-704.4"/>
70
+ <text text-anchor="start" x="362.64" y="-716.6" font-family="Arial" font-size="14.00">robot_id </text>
71
+ <text text-anchor="start" x="417.12" y="-716.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
72
+ <text text-anchor="start" x="458.37" y="-716.6" font-family="Arial" font-size="14.00"> ID of the robot that remembered this node</text>
73
+ <polygon fill="none" stroke="black" points="355.64,-673.6 355.64,-704.4 985.13,-704.4 985.13,-673.6 355.64,-673.6"/>
74
+ <text text-anchor="start" x="362.64" y="-685.8" font-family="Arial" font-size="14.00">updated_at </text>
75
+ <text text-anchor="start" x="436.6" y="-685.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
76
+ <polygon fill="none" stroke="black" points="355.64,-642.8 355.64,-673.6 985.13,-673.6 985.13,-642.8 355.64,-642.8"/>
77
+ <text text-anchor="start" x="362.64" y="-655" font-family="Arial" font-size="14.00">working_memory </text>
78
+ <text text-anchor="start" x="473.12" y="-655" font-family="Arial" font-size="14.00" fill="#666666">[boolean]</text>
79
+ <text text-anchor="start" x="530.72" y="-655" font-family="Arial" font-size="14.00"> True if this node is currently in the robot working memory</text>
66
80
  </g>
67
81
  <!-- public.robot_nodes&#45;&gt;public.robots -->
68
82
  <g id="edge1" class="edge">
69
83
  <title>public.robot_nodes:robot_id&#45;&gt;public.robots:id</title>
70
- <path fill="none" stroke="black" d="M366.96,-527.95C407.38,-504.34 382.22,-330.22 355.98,-287.2 337.91,-257.58 304.87,-280.76 286.7,-251.2 264.09,-214.39 242.5,-154 285.7,-154"/>
71
- <polygon fill="black" stroke="black" points="366.97,-527.94 356.15,-526.17 361.81,-529.32 357.62,-530.43 357.62,-530.43 357.62,-530.43 361.81,-529.32 358.46,-534.86 366.97,-527.94"/>
72
- <text text-anchor="start" x="363.98" y="-540.6" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
84
+ <path fill="none" stroke="black" d="M344.6,-718.77C305.62,-709.81 334.46,-644.53 355.64,-599.6 410.77,-482.65 523.42,-529.58 578.49,-412.6 604.69,-356.94 641,-274.2 579.49,-274.2"/>
85
+ <polygon fill="black" stroke="black" points="344.36,-718.74 353.85,-724.24 349.67,-719.29 353.97,-719.73 353.97,-719.73 353.97,-719.73 349.67,-719.29 354.77,-715.29 344.36,-718.74"/>
86
+ <text text-anchor="start" x="7" y="-729.8" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
73
87
  </g>
74
- <!-- public.working_memories -->
88
+ <!-- public.nodes -->
75
89
  <g id="node3" class="node">
76
- <title>public.working_memories</title>
77
- <polygon fill="#efefef" stroke="none" points="460.61,-530.6 460.61,-566.2 788.57,-566.2 788.57,-530.6 460.61,-530.6"/>
78
- <polygon fill="none" stroke="black" points="460.61,-530.6 460.61,-566.2 788.57,-566.2 788.57,-530.6 460.61,-530.6"/>
79
- <text text-anchor="start" x="467.61" y="-544" font-family="Arial Bold" font-size="18.00">public.working_memories</text>
80
- <text text-anchor="start" x="657.08" y="-544" font-family="Arial" font-size="14.00">    </text>
81
- <text text-anchor="start" x="688.19" y="-544" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
82
- <polygon fill="none" stroke="black" points="460.61,-499.8 460.61,-530.6 788.57,-530.6 788.57,-499.8 460.61,-499.8"/>
83
- <text text-anchor="start" x="467.61" y="-512" font-family="Arial" font-size="14.00">id </text>
84
- <text text-anchor="start" x="482.4" y="-512" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
85
- <polygon fill="none" stroke="black" points="460.61,-469 460.61,-499.8 788.57,-499.8 788.57,-469 460.61,-469"/>
86
- <text text-anchor="start" x="467.61" y="-481.2" font-family="Arial" font-size="14.00">robot_id </text>
87
- <text text-anchor="start" x="522.09" y="-481.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
88
- <polygon fill="none" stroke="black" points="460.61,-438.2 460.61,-469 788.57,-469 788.57,-438.2 460.61,-438.2"/>
89
- <text text-anchor="start" x="467.61" y="-450.4" font-family="Arial" font-size="14.00">node_id </text>
90
- <text text-anchor="start" x="521.33" y="-450.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
91
- <polygon fill="none" stroke="black" points="460.61,-407.4 460.61,-438.2 788.57,-438.2 788.57,-407.4 460.61,-407.4"/>
92
- <text text-anchor="start" x="467.61" y="-419.6" font-family="Arial" font-size="14.00">added_at </text>
93
- <text text-anchor="start" x="529.89" y="-419.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
94
- <polygon fill="none" stroke="black" points="460.61,-376.6 460.61,-407.4 788.57,-407.4 788.57,-376.6 460.61,-376.6"/>
95
- <text text-anchor="start" x="467.61" y="-388.8" font-family="Arial" font-size="14.00">token_count </text>
96
- <text text-anchor="start" x="547.78" y="-388.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
90
+ <title>public.nodes</title>
91
+ <polygon fill="#efefef" stroke="none" points="686.36,-474.4 686.36,-520.4 1342.4,-520.4 1342.4,-474.4 686.36,-474.4"/>
92
+ <polygon fill="none" stroke="black" points="686.36,-474.4 686.36,-520.4 1342.4,-520.4 1342.4,-474.4 686.36,-474.4"/>
93
+ <text text-anchor="start" x="906.4" y="-498.2" font-family="Arial Bold" font-size="18.00">public.nodes</text>
94
+ <text text-anchor="start" x="997.88" y="-498.2" font-family="Arial" font-size="14.00">    </text>
95
+ <text text-anchor="start" x="1029" y="-498.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
96
+ <text text-anchor="start" x="822.96" y="-483.8" font-family="Arial" font-size="14.00" fill="#333333">Core memory storage for conversation messages and context</text>
97
+ <polygon fill="none" stroke="black" points="686.36,-443.6 686.36,-474.4 1342.4,-474.4 1342.4,-443.6 686.36,-443.6"/>
98
+ <text text-anchor="start" x="693.36" y="-455.8" font-family="Arial" font-size="14.00">access_count </text>
99
+ <text text-anchor="start" x="782.86" y="-455.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
100
+ <text text-anchor="start" x="833.45" y="-455.8" font-family="Arial" font-size="14.00"> Number of times this node has been accessed/retrieved</text>
101
+ <polygon fill="none" stroke="black" points="686.36,-412.8 686.36,-443.6 1342.4,-443.6 1342.4,-412.8 686.36,-412.8"/>
102
+ <text text-anchor="start" x="693.36" y="-425" font-family="Arial" font-size="14.00">chunk_position </text>
103
+ <text text-anchor="start" x="790.65" y="-425" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
104
+ <text text-anchor="start" x="841.24" y="-425" font-family="Arial" font-size="14.00"> Position within source file (0&#45;indexed)</text>
105
+ <polygon fill="none" stroke="black" points="686.36,-382 686.36,-412.8 1342.4,-412.8 1342.4,-382 686.36,-382"/>
106
+ <text text-anchor="start" x="693.36" y="-394.2" font-family="Arial" font-size="14.00">content </text>
107
+ <text text-anchor="start" x="743.18" y="-394.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
108
+ <text text-anchor="start" x="773.52" y="-394.2" font-family="Arial" font-size="14.00"> The conversation message/utterance content</text>
109
+ <polygon fill="none" stroke="black" points="686.36,-351.2 686.36,-382 1342.4,-382 1342.4,-351.2 686.36,-351.2"/>
110
+ <text text-anchor="start" x="693.36" y="-363.4" font-family="Arial" font-size="14.00">content_hash </text>
111
+ <text text-anchor="start" x="781.32" y="-363.4" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
112
+ <text text-anchor="start" x="860.68" y="-363.4" font-family="Arial" font-size="14.00"> SHA&#45;256 hash of content for deduplication</text>
113
+ <polygon fill="none" stroke="black" points="686.36,-320.4 686.36,-351.2 1342.4,-351.2 1342.4,-320.4 686.36,-320.4"/>
114
+ <text text-anchor="start" x="693.36" y="-332.6" font-family="Arial" font-size="14.00">created_at </text>
115
+ <text text-anchor="start" x="763.41" y="-332.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
116
+ <text text-anchor="start" x="929.14" y="-332.6" font-family="Arial" font-size="14.00"> When this memory was created</text>
117
+ <polygon fill="none" stroke="black" points="686.36,-289.6 686.36,-320.4 1342.4,-320.4 1342.4,-289.6 686.36,-289.6"/>
118
+ <text text-anchor="start" x="693.36" y="-301.8" font-family="Arial" font-size="14.00">deleted_at </text>
119
+ <text text-anchor="start" x="762.65" y="-301.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
120
+ <text text-anchor="start" x="928.37" y="-301.8" font-family="Arial" font-size="14.00"> Soft delete timestamp &#45; node is considered deleted when set</text>
121
+ <polygon fill="none" stroke="black" points="686.36,-258.8 686.36,-289.6 1342.4,-289.6 1342.4,-258.8 686.36,-258.8"/>
122
+ <text text-anchor="start" x="693.36" y="-271" font-family="Arial" font-size="14.00">embedding </text>
123
+ <text text-anchor="start" x="766.53" y="-271" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
124
+ <text text-anchor="start" x="852.9" y="-271" font-family="Arial" font-size="14.00"> Vector embedding (max 2000 dimensions) for semantic search</text>
125
+ <polygon fill="none" stroke="black" points="686.36,-228 686.36,-258.8 1342.4,-258.8 1342.4,-228 686.36,-228"/>
126
+ <text text-anchor="start" x="693.36" y="-240.2" font-family="Arial" font-size="14.00">embedding_dimension </text>
127
+ <text text-anchor="start" x="838.13" y="-240.2" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
128
+ <text text-anchor="start" x="888.71" y="-240.2" font-family="Arial" font-size="14.00"> Actual number of dimensions used in the embedding vector (max 2000)</text>
129
+ <polygon fill="none" stroke="black" points="686.36,-197.2 686.36,-228 1342.4,-228 1342.4,-197.2 686.36,-197.2"/>
130
+ <text text-anchor="start" x="693.36" y="-209.4" font-family="Arial" font-size="14.00">id </text>
131
+ <text text-anchor="start" x="708.15" y="-209.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
132
+ <polygon fill="none" stroke="black" points="686.36,-166.4 686.36,-197.2 1342.4,-197.2 1342.4,-166.4 686.36,-166.4"/>
133
+ <text text-anchor="start" x="693.36" y="-178.6" font-family="Arial" font-size="14.00">last_accessed </text>
134
+ <text text-anchor="start" x="785.97" y="-178.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
135
+ <text text-anchor="start" x="951.69" y="-178.6" font-family="Arial" font-size="14.00"> When this memory was last accessed</text>
136
+ <polygon fill="none" stroke="black" points="686.36,-135.6 686.36,-166.4 1342.4,-166.4 1342.4,-135.6 686.36,-135.6"/>
137
+ <text text-anchor="start" x="693.36" y="-147.8" font-family="Arial" font-size="14.00">metadata </text>
138
+ <text text-anchor="start" x="755.63" y="-147.8" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
139
+ <text text-anchor="start" x="796.87" y="-147.8" font-family="Arial" font-size="14.00"> Flexible metadata storage (memory_type, importance, source, etc.)</text>
140
+ <polygon fill="none" stroke="black" points="686.36,-104.8 686.36,-135.6 1342.4,-135.6 1342.4,-104.8 686.36,-104.8"/>
141
+ <text text-anchor="start" x="693.36" y="-117" font-family="Arial" font-size="14.00">source_id </text>
142
+ <text text-anchor="start" x="757.96" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
143
+ <text text-anchor="start" x="799.21" y="-117" font-family="Arial" font-size="14.00"> Reference to source file (for file&#45;loaded nodes)</text>
144
+ <polygon fill="none" stroke="black" points="686.36,-74 686.36,-104.8 1342.4,-104.8 1342.4,-74 686.36,-74"/>
145
+ <text text-anchor="start" x="693.36" y="-86.2" font-family="Arial" font-size="14.00">token_count </text>
146
+ <text text-anchor="start" x="773.54" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
147
+ <text text-anchor="start" x="824.12" y="-86.2" font-family="Arial" font-size="14.00"> Number of tokens in the content (for context budget management)</text>
148
+ <polygon fill="none" stroke="black" points="686.36,-43.2 686.36,-74 1342.4,-74 1342.4,-43.2 686.36,-43.2"/>
149
+ <text text-anchor="start" x="693.36" y="-55.4" font-family="Arial" font-size="14.00">updated_at </text>
150
+ <text text-anchor="start" x="767.32" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
151
+ <text text-anchor="start" x="933.05" y="-55.4" font-family="Arial" font-size="14.00"> When this memory was last modified</text>
97
152
  </g>
98
- <!-- public.working_memories&#45;&gt;public.robots -->
153
+ <!-- public.robot_nodes&#45;&gt;public.nodes -->
99
154
  <g id="edge2" class="edge">
100
- <title>public.working_memories:robot_id&#45;&gt;public.robots:id</title>
101
- <path fill="none" stroke="black" d="M449.25,-483.57C397.36,-474.45 437.36,-392.29 460.61,-333.4 478.87,-287.16 518.14,-297.41 536.47,-251.2 552.41,-211.04 580.68,-154 537.47,-154"/>
102
- <polygon fill="black" stroke="black" points="449.31,-483.57 458.92,-488.86 454.63,-484 458.94,-484.35 458.94,-484.35 458.94,-484.35 454.63,-484 459.64,-479.89 449.31,-483.57"/>
103
- <text text-anchor="start" x="466.61" y="-494.4" font-family="Arial" font-size="10.00">FOREIGN KEY (robot_id) REFERENCES robots(id) ON DELETE CASCADE</text>
155
+ <title>public.robot_nodes:node_id&#45;&gt;public.nodes:id</title>
156
+ <path fill="none" stroke="black" d="M996.36,-780.68C1064.36,-770.61 1036.49,-657.2 985.13,-599.6 896.12,-499.78 775.24,-663.54 686.36,-563.6 634.53,-505.31 607.36,-212.6 685.36,-212.6"/>
157
+ <polygon fill="black" stroke="black" points="996.44,-780.68 986.15,-776.89 991.11,-781.05 986.79,-781.35 986.79,-781.35 986.79,-781.35 991.11,-781.05 986.78,-785.87 996.44,-780.68"/>
158
+ <text text-anchor="start" x="993.13" y="-791.4" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
104
159
  </g>
105
160
  </g>
106
161
  </svg>
@@ -8,9 +8,9 @@ Unique tag names for categorization
8
8
 
9
9
  | Name | Type | Default | Nullable | Children | Parents | Comment |
10
10
  | ---- | ---- | ------- | -------- | -------- | ------- | ------- |
11
+ | created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this tag was created |
11
12
  | id | bigint | nextval('tags_id_seq'::regclass) | false | [public.node_tags](public.node_tags.md) | | |
12
13
  | name | text | | false | | | Hierarchical tag in format: root:level1:level2 (e.g., database:postgresql:timescaledb) |
13
- | created_at | timestamp with time zone | CURRENT_TIMESTAMP | true | | | When this tag was created |
14
14
 
15
15
  ## Constraints
16
16
 
@@ -22,9 +22,9 @@ Unique tag names for categorization
22
22
 
23
23
  | Name | Definition |
24
24
  | ---- | ---------- |
25
- | tags_pkey | CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id) |
26
- | idx_tags_name_unique | CREATE UNIQUE INDEX idx_tags_name_unique ON public.tags USING btree (name) |
27
25
  | idx_tags_name_pattern | CREATE INDEX idx_tags_name_pattern ON public.tags USING btree (name text_pattern_ops) |
26
+ | idx_tags_name_unique | CREATE UNIQUE INDEX idx_tags_name_unique ON public.tags USING btree (name) |
27
+ | tags_pkey | CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id) |
28
28
 
29
29
  ## Relations
30
30
 
@@ -4,57 +4,136 @@
4
4
  <!-- Generated by graphviz version 12.1.2 (20240928.0832)
5
5
  -->
6
6
  <!-- Title: public.tags Pages: 1 -->
7
- <svg width="650pt" height="510pt"
8
- viewBox="0.00 0.00 650.02 509.60" 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 505.6)">
7
+ <svg width="1466pt" height="863pt"
8
+ viewBox="0.00 0.00 1465.73 863.20" 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 859.2)">
10
10
  <title>public.tags</title>
11
- <polygon fill="white" stroke="none" points="-4,4 -4,-505.6 646.02,-505.6 646.02,4 -4,4"/>
11
+ <polygon fill="white" stroke="none" points="-4,4 -4,-859.2 1461.73,-859.2 1461.73,4 -4,4"/>
12
12
  <!-- public.tags -->
13
13
  <g id="node1" class="node">
14
14
  <title>public.tags</title>
15
- <polygon fill="#efefef" stroke="none" points="48.8,-138.6 48.8,-174.2 298.57,-174.2 298.57,-138.6 48.8,-138.6"/>
16
- <polygon fill="none" stroke="black" points="48.8,-138.6 48.8,-174.2 298.57,-174.2 298.57,-138.6 48.8,-138.6"/>
17
- <text text-anchor="start" x="72.19" y="-152" font-family="Arial Bold" font-size="18.00">public.tags</text>
18
- <text text-anchor="start" x="150.68" y="-152" font-family="Arial" font-size="14.00">    </text>
19
- <text text-anchor="start" x="181.8" y="-152" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
20
- <polygon fill="none" stroke="black" points="48.8,-107.8 48.8,-138.6 298.57,-138.6 298.57,-107.8 48.8,-107.8"/>
21
- <text text-anchor="start" x="55.8" y="-120" font-family="Arial" font-size="14.00">id </text>
22
- <text text-anchor="start" x="70.58" y="-120" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
23
- <polygon fill="none" stroke="black" points="48.8,-77 48.8,-107.8 298.57,-107.8 298.57,-77 48.8,-77"/>
24
- <text text-anchor="start" x="55.8" y="-89.2" font-family="Arial" font-size="14.00">name </text>
25
- <text text-anchor="start" x="94.71" y="-89.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
26
- <polygon fill="none" stroke="black" points="48.8,-46.2 48.8,-77 298.57,-77 298.57,-46.2 48.8,-46.2"/>
27
- <text text-anchor="start" x="55.8" y="-58.4" font-family="Arial" font-size="14.00">created_at </text>
28
- <text text-anchor="start" x="125.84" y="-58.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
29
- <polygon fill="none" stroke="black" stroke-width="3" points="47.3,-44.7 47.3,-175.7 300.07,-175.7 300.07,-44.7 47.3,-44.7"/>
15
+ <polygon fill="#efefef" stroke="none" points="46.2,-305 46.2,-351 650.83,-351 650.83,-305 46.2,-305"/>
16
+ <polygon fill="none" stroke="black" points="46.2,-305 46.2,-351 650.83,-351 650.83,-305 46.2,-305"/>
17
+ <text text-anchor="start" x="247.02" y="-328.8" font-family="Arial Bold" font-size="18.00">public.tags</text>
18
+ <text text-anchor="start" x="325.51" y="-328.8" font-family="Arial" font-size="14.00">    </text>
19
+ <text text-anchor="start" x="356.63" y="-328.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
20
+ <text text-anchor="start" x="236.06" y="-314.4" font-family="Arial" font-size="14.00" fill="#333333">Unique tag names for categorization</text>
21
+ <polygon fill="none" stroke="black" points="46.2,-274.2 46.2,-305 650.83,-305 650.83,-274.2 46.2,-274.2"/>
22
+ <text text-anchor="start" x="53.2" y="-286.4" font-family="Arial" font-size="14.00">created_at </text>
23
+ <text text-anchor="start" x="123.25" y="-286.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
24
+ <text text-anchor="start" x="288.97" y="-286.4" font-family="Arial" font-size="14.00"> When this tag was created</text>
25
+ <polygon fill="none" stroke="black" points="46.2,-243.4 46.2,-274.2 650.83,-274.2 650.83,-243.4 46.2,-243.4"/>
26
+ <text text-anchor="start" x="53.2" y="-255.6" font-family="Arial" font-size="14.00">id </text>
27
+ <text text-anchor="start" x="67.99" y="-255.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
28
+ <polygon fill="none" stroke="black" points="46.2,-212.6 46.2,-243.4 650.83,-243.4 650.83,-212.6 46.2,-212.6"/>
29
+ <text text-anchor="start" x="53.2" y="-224.8" font-family="Arial" font-size="14.00">name </text>
30
+ <text text-anchor="start" x="92.11" y="-224.8" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
31
+ <text text-anchor="start" x="122.45" y="-224.8" font-family="Arial" font-size="14.00"> Hierarchical tag in format: root:level1:level2 (e.g., database:postgresql:timescaledb)</text>
32
+ <polygon fill="none" stroke="black" stroke-width="3" points="44.7,-211.1 44.7,-352.5 652.33,-352.5 652.33,-211.1 44.7,-211.1"/>
30
33
  </g>
31
34
  <!-- public.node_tags -->
32
35
  <g id="node2" class="node">
33
36
  <title>public.node_tags</title>
34
- <polygon fill="#efefef" stroke="none" points="43.2,-422.8 43.2,-458.4 304.16,-458.4 304.16,-422.8 43.2,-422.8"/>
35
- <polygon fill="none" stroke="black" points="43.2,-422.8 43.2,-458.4 304.16,-458.4 304.16,-422.8 43.2,-422.8"/>
36
- <text text-anchor="start" x="50.2" y="-436.2" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
37
- <text text-anchor="start" x="172.68" y="-436.2" font-family="Arial" font-size="14.00">    </text>
38
- <text text-anchor="start" x="203.79" y="-436.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
39
- <polygon fill="none" stroke="black" points="43.2,-392 43.2,-422.8 304.16,-422.8 304.16,-392 43.2,-392"/>
40
- <text text-anchor="start" x="50.2" y="-404.2" font-family="Arial" font-size="14.00">id </text>
41
- <text text-anchor="start" x="64.99" y="-404.2" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
42
- <polygon fill="none" stroke="black" points="43.2,-361.2 43.2,-392 304.16,-392 304.16,-361.2 43.2,-361.2"/>
43
- <text text-anchor="start" x="50.2" y="-373.4" font-family="Arial" font-size="14.00">node_id </text>
44
- <text text-anchor="start" x="103.92" y="-373.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
45
- <polygon fill="none" stroke="black" points="43.2,-330.4 43.2,-361.2 304.16,-361.2 304.16,-330.4 43.2,-330.4"/>
46
- <text text-anchor="start" x="50.2" y="-342.6" font-family="Arial" font-size="14.00">tag_id </text>
47
- <text text-anchor="start" x="92.23" y="-342.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
48
- <polygon fill="none" stroke="black" points="43.2,-299.6 43.2,-330.4 304.16,-330.4 304.16,-299.6 43.2,-299.6"/>
49
- <text text-anchor="start" x="50.2" y="-311.8" font-family="Arial" font-size="14.00">created_at </text>
50
- <text text-anchor="start" x="120.25" y="-311.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
37
+ <polygon fill="#efefef" stroke="none" points="482.91,-766 482.91,-812 952.12,-812 952.12,-766 482.91,-766"/>
38
+ <polygon fill="none" stroke="black" points="482.91,-766 482.91,-812 952.12,-812 952.12,-766 482.91,-766"/>
39
+ <text text-anchor="start" x="594.03" y="-789.8" font-family="Arial Bold" font-size="18.00">public.node_tags</text>
40
+ <text text-anchor="start" x="716.51" y="-789.8" font-family="Arial" font-size="14.00">    </text>
41
+ <text text-anchor="start" x="747.62" y="-789.8" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
42
+ <text text-anchor="start" x="556.43" y="-775.4" font-family="Arial" font-size="14.00" fill="#333333">Join table connecting nodes to tags (many&#45;to&#45;many)</text>
43
+ <polygon fill="none" stroke="black" points="482.91,-735.2 482.91,-766 952.12,-766 952.12,-735.2 482.91,-735.2"/>
44
+ <text text-anchor="start" x="489.91" y="-747.4" font-family="Arial" font-size="14.00">created_at </text>
45
+ <text text-anchor="start" x="559.95" y="-747.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
46
+ <text text-anchor="start" x="725.68" y="-747.4" font-family="Arial" font-size="14.00"> When this association was created</text>
47
+ <polygon fill="none" stroke="black" points="482.91,-704.4 482.91,-735.2 952.12,-735.2 952.12,-704.4 482.91,-704.4"/>
48
+ <text text-anchor="start" x="489.91" y="-716.6" font-family="Arial" font-size="14.00">id </text>
49
+ <text text-anchor="start" x="504.69" y="-716.6" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
50
+ <polygon fill="none" stroke="black" points="482.91,-673.6 482.91,-704.4 952.12,-704.4 952.12,-673.6 482.91,-673.6"/>
51
+ <text text-anchor="start" x="489.91" y="-685.8" font-family="Arial" font-size="14.00">node_id </text>
52
+ <text text-anchor="start" x="543.62" y="-685.8" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
53
+ <text text-anchor="start" x="584.87" y="-685.8" font-family="Arial" font-size="14.00"> ID of the node being tagged</text>
54
+ <polygon fill="none" stroke="black" points="482.91,-642.8 482.91,-673.6 952.12,-673.6 952.12,-642.8 482.91,-642.8"/>
55
+ <text text-anchor="start" x="489.91" y="-655" font-family="Arial" font-size="14.00">tag_id </text>
56
+ <text text-anchor="start" x="531.94" y="-655" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
57
+ <text text-anchor="start" x="573.19" y="-655" font-family="Arial" font-size="14.00"> ID of the tag being applied</text>
51
58
  </g>
52
59
  <!-- public.node_tags&#45;&gt;public.tags -->
53
60
  <g id="edge1" class="edge">
54
61
  <title>public.node_tags:tag_id&#45;&gt;public.tags:id</title>
55
- <path fill="none" stroke="black" d="M315.48,-344.95C403.6,-330 394.96,-123.2 299.57,-123.2"/>
56
- <polygon fill="black" stroke="black" points="315.46,-344.95 305.13,-341.29 310.15,-345.39 305.83,-345.75 305.83,-345.75 305.83,-345.75 310.15,-345.39 305.87,-350.26 315.46,-344.95"/>
57
- <text text-anchor="start" x="312.16" y="-355.8" font-family="Arial" font-size="10.00">FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE</text>
62
+ <path fill="none" stroke="black" d="M472.11,-655.39C461.78,-646.74 475.41,-619.83 482.91,-599.6 523.51,-490 610.76,-507 650.83,-397.2 671.91,-339.41 713.34,-258.8 651.83,-258.8"/>
63
+ <polygon fill="black" stroke="black" points="471.97,-655.35 480.35,-662.43 477.1,-656.82 481.26,-658.02 481.26,-658.02 481.26,-658.02 477.1,-656.82 482.82,-653.78 471.97,-655.35"/>
64
+ <text text-anchor="start" x="152.05" y="-668.2" font-family="Arial" font-size="10.00">FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE</text>
65
+ </g>
66
+ <!-- public.nodes -->
67
+ <g id="node3" class="node">
68
+ <title>public.nodes</title>
69
+ <polygon fill="#efefef" stroke="none" points="758.49,-474.4 758.49,-520.4 1414.53,-520.4 1414.53,-474.4 758.49,-474.4"/>
70
+ <polygon fill="none" stroke="black" points="758.49,-474.4 758.49,-520.4 1414.53,-520.4 1414.53,-474.4 758.49,-474.4"/>
71
+ <text text-anchor="start" x="978.53" y="-498.2" font-family="Arial Bold" font-size="18.00">public.nodes</text>
72
+ <text text-anchor="start" x="1070.01" y="-498.2" font-family="Arial" font-size="14.00">    </text>
73
+ <text text-anchor="start" x="1101.13" y="-498.2" font-family="Arial" font-size="14.00" fill="#666666">[BASE TABLE]</text>
74
+ <text text-anchor="start" x="895.09" y="-483.8" font-family="Arial" font-size="14.00" fill="#333333">Core memory storage for conversation messages and context</text>
75
+ <polygon fill="none" stroke="black" points="758.49,-443.6 758.49,-474.4 1414.53,-474.4 1414.53,-443.6 758.49,-443.6"/>
76
+ <text text-anchor="start" x="765.49" y="-455.8" font-family="Arial" font-size="14.00">access_count </text>
77
+ <text text-anchor="start" x="854.99" y="-455.8" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
78
+ <text text-anchor="start" x="905.58" y="-455.8" font-family="Arial" font-size="14.00"> Number of times this node has been accessed/retrieved</text>
79
+ <polygon fill="none" stroke="black" points="758.49,-412.8 758.49,-443.6 1414.53,-443.6 1414.53,-412.8 758.49,-412.8"/>
80
+ <text text-anchor="start" x="765.49" y="-425" font-family="Arial" font-size="14.00">chunk_position </text>
81
+ <text text-anchor="start" x="862.78" y="-425" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
82
+ <text text-anchor="start" x="913.37" y="-425" font-family="Arial" font-size="14.00"> Position within source file (0&#45;indexed)</text>
83
+ <polygon fill="none" stroke="black" points="758.49,-382 758.49,-412.8 1414.53,-412.8 1414.53,-382 758.49,-382"/>
84
+ <text text-anchor="start" x="765.49" y="-394.2" font-family="Arial" font-size="14.00">content </text>
85
+ <text text-anchor="start" x="815.31" y="-394.2" font-family="Arial" font-size="14.00" fill="#666666">[text]</text>
86
+ <text text-anchor="start" x="845.65" y="-394.2" font-family="Arial" font-size="14.00"> The conversation message/utterance content</text>
87
+ <polygon fill="none" stroke="black" points="758.49,-351.2 758.49,-382 1414.53,-382 1414.53,-351.2 758.49,-351.2"/>
88
+ <text text-anchor="start" x="765.49" y="-363.4" font-family="Arial" font-size="14.00">content_hash </text>
89
+ <text text-anchor="start" x="853.45" y="-363.4" font-family="Arial" font-size="14.00" fill="#666666">[varchar(64)]</text>
90
+ <text text-anchor="start" x="932.81" y="-363.4" font-family="Arial" font-size="14.00"> SHA&#45;256 hash of content for deduplication</text>
91
+ <polygon fill="none" stroke="black" points="758.49,-320.4 758.49,-351.2 1414.53,-351.2 1414.53,-320.4 758.49,-320.4"/>
92
+ <text text-anchor="start" x="765.49" y="-332.6" font-family="Arial" font-size="14.00">created_at </text>
93
+ <text text-anchor="start" x="835.54" y="-332.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
94
+ <text text-anchor="start" x="1001.26" y="-332.6" font-family="Arial" font-size="14.00"> When this memory was created</text>
95
+ <polygon fill="none" stroke="black" points="758.49,-289.6 758.49,-320.4 1414.53,-320.4 1414.53,-289.6 758.49,-289.6"/>
96
+ <text text-anchor="start" x="765.49" y="-301.8" font-family="Arial" font-size="14.00">deleted_at </text>
97
+ <text text-anchor="start" x="834.78" y="-301.8" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
98
+ <text text-anchor="start" x="1000.5" y="-301.8" font-family="Arial" font-size="14.00"> Soft delete timestamp &#45; node is considered deleted when set</text>
99
+ <polygon fill="none" stroke="black" points="758.49,-258.8 758.49,-289.6 1414.53,-289.6 1414.53,-258.8 758.49,-258.8"/>
100
+ <text text-anchor="start" x="765.49" y="-271" font-family="Arial" font-size="14.00">embedding </text>
101
+ <text text-anchor="start" x="838.66" y="-271" font-family="Arial" font-size="14.00" fill="#666666">[vector(2000)]</text>
102
+ <text text-anchor="start" x="925.03" y="-271" font-family="Arial" font-size="14.00"> Vector embedding (max 2000 dimensions) for semantic search</text>
103
+ <polygon fill="none" stroke="black" points="758.49,-228 758.49,-258.8 1414.53,-258.8 1414.53,-228 758.49,-228"/>
104
+ <text text-anchor="start" x="765.49" y="-240.2" font-family="Arial" font-size="14.00">embedding_dimension </text>
105
+ <text text-anchor="start" x="910.26" y="-240.2" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
106
+ <text text-anchor="start" x="960.84" y="-240.2" font-family="Arial" font-size="14.00"> Actual number of dimensions used in the embedding vector (max 2000)</text>
107
+ <polygon fill="none" stroke="black" points="758.49,-197.2 758.49,-228 1414.53,-228 1414.53,-197.2 758.49,-197.2"/>
108
+ <text text-anchor="start" x="765.49" y="-209.4" font-family="Arial" font-size="14.00">id </text>
109
+ <text text-anchor="start" x="780.28" y="-209.4" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
110
+ <polygon fill="none" stroke="black" points="758.49,-166.4 758.49,-197.2 1414.53,-197.2 1414.53,-166.4 758.49,-166.4"/>
111
+ <text text-anchor="start" x="765.49" y="-178.6" font-family="Arial" font-size="14.00">last_accessed </text>
112
+ <text text-anchor="start" x="858.1" y="-178.6" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
113
+ <text text-anchor="start" x="1023.82" y="-178.6" font-family="Arial" font-size="14.00"> When this memory was last accessed</text>
114
+ <polygon fill="none" stroke="black" points="758.49,-135.6 758.49,-166.4 1414.53,-166.4 1414.53,-135.6 758.49,-135.6"/>
115
+ <text text-anchor="start" x="765.49" y="-147.8" font-family="Arial" font-size="14.00">metadata </text>
116
+ <text text-anchor="start" x="827.76" y="-147.8" font-family="Arial" font-size="14.00" fill="#666666">[jsonb]</text>
117
+ <text text-anchor="start" x="869" y="-147.8" font-family="Arial" font-size="14.00"> Flexible metadata storage (memory_type, importance, source, etc.)</text>
118
+ <polygon fill="none" stroke="black" points="758.49,-104.8 758.49,-135.6 1414.53,-135.6 1414.53,-104.8 758.49,-104.8"/>
119
+ <text text-anchor="start" x="765.49" y="-117" font-family="Arial" font-size="14.00">source_id </text>
120
+ <text text-anchor="start" x="830.09" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[bigint]</text>
121
+ <text text-anchor="start" x="871.33" y="-117" font-family="Arial" font-size="14.00"> Reference to source file (for file&#45;loaded nodes)</text>
122
+ <polygon fill="none" stroke="black" points="758.49,-74 758.49,-104.8 1414.53,-104.8 1414.53,-74 758.49,-74"/>
123
+ <text text-anchor="start" x="765.49" y="-86.2" font-family="Arial" font-size="14.00">token_count </text>
124
+ <text text-anchor="start" x="845.67" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[integer]</text>
125
+ <text text-anchor="start" x="896.25" y="-86.2" font-family="Arial" font-size="14.00"> Number of tokens in the content (for context budget management)</text>
126
+ <polygon fill="none" stroke="black" points="758.49,-43.2 758.49,-74 1414.53,-74 1414.53,-43.2 758.49,-43.2"/>
127
+ <text text-anchor="start" x="765.49" y="-55.4" font-family="Arial" font-size="14.00">updated_at </text>
128
+ <text text-anchor="start" x="839.45" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[timestamp with time zone]</text>
129
+ <text text-anchor="start" x="1005.18" y="-55.4" font-family="Arial" font-size="14.00"> When this memory was last modified</text>
130
+ </g>
131
+ <!-- public.node_tags&#45;&gt;public.nodes -->
132
+ <g id="edge2" class="edge">
133
+ <title>public.node_tags:node_id&#45;&gt;public.nodes:id</title>
134
+ <path fill="none" stroke="black" d="M963.23,-687.39C989.79,-677.75 975.19,-627.05 952.12,-599.6 895.79,-532.6 814.54,-630.83 758.49,-563.6 708.55,-503.69 679.49,-212.6 757.49,-212.6"/>
135
+ <polygon fill="black" stroke="black" points="963.33,-687.38 952.74,-684.5 958.06,-688.22 953.78,-688.9 953.78,-688.9 953.78,-688.9 958.06,-688.22 954.15,-693.39 963.33,-687.38"/>
136
+ <text text-anchor="start" x="960.12" y="-699" font-family="Arial" font-size="10.00">FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE</text>
58
137
  </g>
59
138
  </g>
60
139
  </svg>