htm 0.0.15 → 0.0.18

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 (135) hide show
  1. checksums.yaml +4 -4
  2. data/.architecture/decisions/adrs/001-use-postgresql-timescaledb-storage.md +1 -1
  3. data/.architecture/decisions/adrs/011-database-side-embedding-generation-with-pgai.md +4 -4
  4. data/.architecture/decisions/adrs/012-llm-driven-ontology-topic-extraction.md +1 -1
  5. data/.envrc +12 -24
  6. data/.irbrc +7 -7
  7. data/.tbls.yml +2 -2
  8. data/CHANGELOG.md +138 -0
  9. data/README.md +97 -1592
  10. data/Rakefile +8 -3
  11. data/SETUP.md +12 -12
  12. data/bin/htm_mcp +27 -0
  13. data/db/seed_data/README.md +2 -2
  14. data/db/seeds.rb +2 -2
  15. data/docs/api/database.md +37 -37
  16. data/docs/api/htm.md +1 -1
  17. data/docs/api/yard/HTM/ActiveRecordConfig.md +2 -2
  18. data/docs/api/yard/HTM/Configuration.md +26 -15
  19. data/docs/api/yard/HTM/Database.md +7 -8
  20. data/docs/api/yard/HTM/JobAdapter.md +1 -1
  21. data/docs/api/yard/HTM/Railtie.md +2 -2
  22. data/docs/architecture/adrs/001-postgresql-timescaledb.md +1 -1
  23. data/docs/architecture/adrs/011-pgai-integration.md +4 -4
  24. data/docs/database_rake_tasks.md +5 -5
  25. data/docs/development/rake-tasks.md +11 -11
  26. data/docs/development/setup.md +21 -21
  27. data/docs/development/testing.md +1 -1
  28. data/docs/getting-started/installation.md +51 -31
  29. data/docs/getting-started/quick-start.md +12 -12
  30. data/docs/guides/getting-started.md +2 -2
  31. data/docs/guides/long-term-memory.md +1 -1
  32. data/docs/guides/mcp-server.md +464 -29
  33. data/docs/guides/robot-groups.md +8 -8
  34. data/docs/index.md +4 -4
  35. data/docs/multi_framework_support.md +10 -10
  36. data/docs/setup_local_database.md +19 -19
  37. data/docs/using_rake_tasks_in_your_app.md +14 -14
  38. data/examples/README.md +50 -6
  39. data/examples/basic_usage.rb +31 -21
  40. data/examples/cli_app/README.md +8 -8
  41. data/examples/cli_app/htm_cli.rb +5 -5
  42. data/examples/config_file_example/README.md +256 -0
  43. data/examples/config_file_example/config/htm.local.yml +34 -0
  44. data/examples/config_file_example/custom_config.yml +22 -0
  45. data/examples/config_file_example/show_config.rb +125 -0
  46. data/examples/custom_llm_configuration.rb +7 -7
  47. data/examples/example_app/Rakefile +2 -2
  48. data/examples/example_app/app.rb +8 -8
  49. data/examples/file_loader_usage.rb +9 -9
  50. data/examples/mcp_client.rb +7 -7
  51. data/examples/rails_app/.gitignore +2 -0
  52. data/examples/rails_app/Gemfile +22 -0
  53. data/examples/rails_app/Gemfile.lock +430 -0
  54. data/examples/rails_app/Procfile.dev +1 -0
  55. data/examples/rails_app/README.md +98 -0
  56. data/examples/rails_app/Rakefile +5 -0
  57. data/examples/rails_app/app/assets/stylesheets/application.css +83 -0
  58. data/examples/rails_app/app/assets/stylesheets/inter-font.css +6 -0
  59. data/examples/rails_app/app/controllers/application_controller.rb +19 -0
  60. data/examples/rails_app/app/controllers/dashboard_controller.rb +27 -0
  61. data/examples/rails_app/app/controllers/files_controller.rb +205 -0
  62. data/examples/rails_app/app/controllers/memories_controller.rb +102 -0
  63. data/examples/rails_app/app/controllers/robots_controller.rb +44 -0
  64. data/examples/rails_app/app/controllers/search_controller.rb +46 -0
  65. data/examples/rails_app/app/controllers/tags_controller.rb +30 -0
  66. data/examples/rails_app/app/javascript/application.js +4 -0
  67. data/examples/rails_app/app/javascript/controllers/application.js +9 -0
  68. data/examples/rails_app/app/javascript/controllers/index.js +6 -0
  69. data/examples/rails_app/app/views/dashboard/index.html.erb +123 -0
  70. data/examples/rails_app/app/views/files/index.html.erb +108 -0
  71. data/examples/rails_app/app/views/files/new.html.erb +321 -0
  72. data/examples/rails_app/app/views/files/show.html.erb +130 -0
  73. data/examples/rails_app/app/views/layouts/application.html.erb +124 -0
  74. data/examples/rails_app/app/views/memories/_memory_card.html.erb +51 -0
  75. data/examples/rails_app/app/views/memories/deleted.html.erb +62 -0
  76. data/examples/rails_app/app/views/memories/edit.html.erb +35 -0
  77. data/examples/rails_app/app/views/memories/index.html.erb +81 -0
  78. data/examples/rails_app/app/views/memories/new.html.erb +71 -0
  79. data/examples/rails_app/app/views/memories/show.html.erb +126 -0
  80. data/examples/rails_app/app/views/robots/index.html.erb +106 -0
  81. data/examples/rails_app/app/views/robots/new.html.erb +36 -0
  82. data/examples/rails_app/app/views/robots/show.html.erb +79 -0
  83. data/examples/rails_app/app/views/search/index.html.erb +184 -0
  84. data/examples/rails_app/app/views/shared/_navbar.html.erb +52 -0
  85. data/examples/rails_app/app/views/shared/_stat_card.html.erb +52 -0
  86. data/examples/rails_app/app/views/tags/index.html.erb +131 -0
  87. data/examples/rails_app/app/views/tags/show.html.erb +67 -0
  88. data/examples/rails_app/bin/dev +8 -0
  89. data/examples/rails_app/bin/rails +4 -0
  90. data/examples/rails_app/bin/rake +4 -0
  91. data/examples/rails_app/config/application.rb +33 -0
  92. data/examples/rails_app/config/boot.rb +5 -0
  93. data/examples/rails_app/config/database.yml +15 -0
  94. data/examples/rails_app/config/environment.rb +5 -0
  95. data/examples/rails_app/config/importmap.rb +7 -0
  96. data/examples/rails_app/config/routes.rb +38 -0
  97. data/examples/rails_app/config/tailwind.config.js +35 -0
  98. data/examples/rails_app/config.ru +5 -0
  99. data/examples/rails_app/log/.keep +0 -0
  100. data/examples/rails_app/tmp/local_secret.txt +1 -0
  101. data/examples/robot_groups/multi_process.rb +5 -5
  102. data/examples/robot_groups/robot_worker.rb +5 -5
  103. data/examples/robot_groups/same_process.rb +9 -9
  104. data/examples/sinatra_app/app.rb +1 -1
  105. data/examples/timeframe_demo.rb +1 -1
  106. data/lib/htm/active_record_config.rb +12 -28
  107. data/lib/htm/circuit_breaker.rb +0 -2
  108. data/lib/htm/config/defaults.yml +246 -0
  109. data/lib/htm/config.rb +888 -0
  110. data/lib/htm/database.rb +26 -33
  111. data/lib/htm/embedding_service.rb +0 -4
  112. data/lib/htm/integrations/sinatra.rb +3 -7
  113. data/lib/htm/job_adapter.rb +1 -15
  114. data/lib/htm/jobs/generate_embedding_job.rb +1 -7
  115. data/lib/htm/jobs/generate_propositions_job.rb +2 -12
  116. data/lib/htm/jobs/generate_tags_job.rb +1 -8
  117. data/lib/htm/loaders/defaults_loader.rb +143 -0
  118. data/lib/htm/loaders/xdg_config_loader.rb +116 -0
  119. data/lib/htm/mcp/cli.rb +475 -0
  120. data/lib/htm/mcp/group_tools.rb +476 -0
  121. data/lib/htm/mcp/resources.rb +89 -0
  122. data/lib/htm/mcp/server.rb +98 -0
  123. data/lib/htm/mcp/tools.rb +488 -0
  124. data/lib/htm/models/file_source.rb +5 -3
  125. data/lib/htm/proposition_service.rb +2 -12
  126. data/lib/htm/railtie.rb +3 -8
  127. data/lib/htm/tag_service.rb +1 -8
  128. data/lib/htm/tasks.rb +7 -4
  129. data/lib/htm/version.rb +1 -1
  130. data/lib/htm.rb +124 -5
  131. data/lib/tasks/htm.rake +6 -9
  132. metadata +81 -6
  133. data/bin/htm_mcp.rb +0 -621
  134. data/config/database.yml +0 -74
  135. data/lib/htm/configuration.rb +0 -766
@@ -0,0 +1,430 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ htm (0.0.18)
5
+ activerecord
6
+ anyway_config (>= 2.6)
7
+ baran
8
+ chronic
9
+ fast-mcp
10
+ lru_redux
11
+ neighbor
12
+ pg (>= 1.5.0)
13
+ ruby-progressbar
14
+ ruby_llm
15
+ tiktoken_ruby
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ actioncable (7.2.3)
21
+ actionpack (= 7.2.3)
22
+ activesupport (= 7.2.3)
23
+ nio4r (~> 2.0)
24
+ websocket-driver (>= 0.6.1)
25
+ zeitwerk (~> 2.6)
26
+ actionmailbox (7.2.3)
27
+ actionpack (= 7.2.3)
28
+ activejob (= 7.2.3)
29
+ activerecord (= 7.2.3)
30
+ activestorage (= 7.2.3)
31
+ activesupport (= 7.2.3)
32
+ mail (>= 2.8.0)
33
+ actionmailer (7.2.3)
34
+ actionpack (= 7.2.3)
35
+ actionview (= 7.2.3)
36
+ activejob (= 7.2.3)
37
+ activesupport (= 7.2.3)
38
+ mail (>= 2.8.0)
39
+ rails-dom-testing (~> 2.2)
40
+ actionpack (7.2.3)
41
+ actionview (= 7.2.3)
42
+ activesupport (= 7.2.3)
43
+ cgi
44
+ nokogiri (>= 1.8.5)
45
+ racc
46
+ rack (>= 2.2.4, < 3.3)
47
+ rack-session (>= 1.0.1)
48
+ rack-test (>= 0.6.3)
49
+ rails-dom-testing (~> 2.2)
50
+ rails-html-sanitizer (~> 1.6)
51
+ useragent (~> 0.16)
52
+ actiontext (7.2.3)
53
+ actionpack (= 7.2.3)
54
+ activerecord (= 7.2.3)
55
+ activestorage (= 7.2.3)
56
+ activesupport (= 7.2.3)
57
+ globalid (>= 0.6.0)
58
+ nokogiri (>= 1.8.5)
59
+ actionview (7.2.3)
60
+ activesupport (= 7.2.3)
61
+ builder (~> 3.1)
62
+ cgi
63
+ erubi (~> 1.11)
64
+ rails-dom-testing (~> 2.2)
65
+ rails-html-sanitizer (~> 1.6)
66
+ activejob (7.2.3)
67
+ activesupport (= 7.2.3)
68
+ globalid (>= 0.3.6)
69
+ activemodel (7.2.3)
70
+ activesupport (= 7.2.3)
71
+ activerecord (7.2.3)
72
+ activemodel (= 7.2.3)
73
+ activesupport (= 7.2.3)
74
+ timeout (>= 0.4.0)
75
+ activestorage (7.2.3)
76
+ actionpack (= 7.2.3)
77
+ activejob (= 7.2.3)
78
+ activerecord (= 7.2.3)
79
+ activesupport (= 7.2.3)
80
+ marcel (~> 1.0)
81
+ activesupport (7.2.3)
82
+ base64
83
+ benchmark (>= 0.3)
84
+ bigdecimal
85
+ concurrent-ruby (~> 1.0, >= 1.3.1)
86
+ connection_pool (>= 2.2.5)
87
+ drb
88
+ i18n (>= 1.6, < 2)
89
+ logger (>= 1.4.2)
90
+ minitest (>= 5.1)
91
+ securerandom (>= 0.3)
92
+ tzinfo (~> 2.0, >= 2.0.5)
93
+ addressable (2.8.8)
94
+ public_suffix (>= 2.0.2, < 8.0)
95
+ anyway_config (2.7.2)
96
+ ruby-next-core (~> 1.0)
97
+ baran (0.2.1)
98
+ base64 (0.3.0)
99
+ benchmark (0.5.0)
100
+ bigdecimal (3.3.1)
101
+ bindex (0.8.1)
102
+ builder (3.3.0)
103
+ cgi (0.5.1)
104
+ chronic (0.10.2)
105
+ concurrent-ruby (1.3.6)
106
+ connection_pool (3.0.2)
107
+ crass (1.0.6)
108
+ date (3.5.1)
109
+ debug_me (1.1.3)
110
+ drb (2.2.3)
111
+ dry-configurable (1.3.0)
112
+ dry-core (~> 1.1)
113
+ zeitwerk (~> 2.6)
114
+ dry-core (1.1.0)
115
+ concurrent-ruby (~> 1.0)
116
+ logger
117
+ zeitwerk (~> 2.6)
118
+ dry-inflector (1.2.0)
119
+ dry-initializer (3.2.0)
120
+ dry-logic (1.6.0)
121
+ bigdecimal
122
+ concurrent-ruby (~> 1.0)
123
+ dry-core (~> 1.1)
124
+ zeitwerk (~> 2.6)
125
+ dry-schema (1.14.1)
126
+ concurrent-ruby (~> 1.0)
127
+ dry-configurable (~> 1.0, >= 1.0.1)
128
+ dry-core (~> 1.1)
129
+ dry-initializer (~> 3.2)
130
+ dry-logic (~> 1.5)
131
+ dry-types (~> 1.8)
132
+ zeitwerk (~> 2.6)
133
+ dry-types (1.8.3)
134
+ bigdecimal (~> 3.0)
135
+ concurrent-ruby (~> 1.0)
136
+ dry-core (~> 1.0)
137
+ dry-inflector (~> 1.0)
138
+ dry-logic (~> 1.4)
139
+ zeitwerk (~> 2.6)
140
+ erb (6.0.1)
141
+ erubi (1.13.1)
142
+ event_stream_parser (1.0.0)
143
+ faraday (2.14.0)
144
+ faraday-net_http (>= 2.0, < 3.5)
145
+ json
146
+ logger
147
+ faraday-multipart (1.1.1)
148
+ multipart-post (~> 2.0)
149
+ faraday-net_http (3.4.2)
150
+ net-http (~> 0.5)
151
+ faraday-retry (2.3.2)
152
+ faraday (~> 2.0)
153
+ fast-mcp (1.6.0)
154
+ addressable (~> 2.8)
155
+ base64
156
+ dry-schema (~> 1.14)
157
+ json (~> 2.0)
158
+ mime-types (~> 3.4)
159
+ rack (>= 2.0, < 4.0)
160
+ globalid (1.3.0)
161
+ activesupport (>= 6.1)
162
+ i18n (1.14.7)
163
+ concurrent-ruby (~> 1.0)
164
+ io-console (0.8.2)
165
+ irb (1.16.0)
166
+ pp (>= 0.6.0)
167
+ rdoc (>= 4.0.0)
168
+ reline (>= 0.4.2)
169
+ json (2.18.0)
170
+ logger (1.7.0)
171
+ loofah (2.25.0)
172
+ crass (~> 1.0.2)
173
+ nokogiri (>= 1.12.0)
174
+ lru_redux (1.1.0)
175
+ mail (2.9.0)
176
+ logger
177
+ mini_mime (>= 0.1.1)
178
+ net-imap
179
+ net-pop
180
+ net-smtp
181
+ marcel (1.1.0)
182
+ mime-types (3.7.0)
183
+ logger
184
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
185
+ mime-types-data (3.2025.0924)
186
+ mini_mime (1.1.5)
187
+ mini_portile2 (2.8.9)
188
+ minitest (6.0.0)
189
+ prism (~> 1.5)
190
+ multipart-post (2.4.1)
191
+ neighbor (0.6.0)
192
+ activerecord (>= 7.1)
193
+ net-http (0.9.1)
194
+ uri (>= 0.11.1)
195
+ net-imap (0.6.2)
196
+ date
197
+ net-protocol
198
+ net-pop (0.1.2)
199
+ net-protocol
200
+ net-protocol (0.2.2)
201
+ timeout
202
+ net-smtp (0.5.1)
203
+ net-protocol
204
+ nio4r (2.7.5)
205
+ nokogiri (1.18.10)
206
+ mini_portile2 (~> 2.8.2)
207
+ racc (~> 1.4)
208
+ pg (1.6.2)
209
+ pp (0.6.3)
210
+ prettyprint
211
+ prettyprint (0.2.0)
212
+ prism (1.7.0)
213
+ propshaft (1.3.1)
214
+ actionpack (>= 7.0.0)
215
+ activesupport (>= 7.0.0)
216
+ rack
217
+ psych (5.3.1)
218
+ date
219
+ stringio
220
+ public_suffix (7.0.0)
221
+ puma (6.6.1)
222
+ nio4r (~> 2.0)
223
+ racc (1.8.1)
224
+ rack (3.2.4)
225
+ rack-session (2.1.1)
226
+ base64 (>= 0.1.0)
227
+ rack (>= 3.0.0)
228
+ rack-test (2.2.0)
229
+ rack (>= 1.3)
230
+ rackup (2.3.1)
231
+ rack (>= 3)
232
+ rails (7.2.3)
233
+ actioncable (= 7.2.3)
234
+ actionmailbox (= 7.2.3)
235
+ actionmailer (= 7.2.3)
236
+ actionpack (= 7.2.3)
237
+ actiontext (= 7.2.3)
238
+ actionview (= 7.2.3)
239
+ activejob (= 7.2.3)
240
+ activemodel (= 7.2.3)
241
+ activerecord (= 7.2.3)
242
+ activestorage (= 7.2.3)
243
+ activesupport (= 7.2.3)
244
+ bundler (>= 1.15.0)
245
+ railties (= 7.2.3)
246
+ rails-dom-testing (2.3.0)
247
+ activesupport (>= 5.0.0)
248
+ minitest
249
+ nokogiri (>= 1.6)
250
+ rails-html-sanitizer (1.6.2)
251
+ loofah (~> 2.21)
252
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
253
+ railties (7.2.3)
254
+ actionpack (= 7.2.3)
255
+ activesupport (= 7.2.3)
256
+ cgi
257
+ irb (~> 1.13)
258
+ rackup (>= 1.0.0)
259
+ rake (>= 12.2)
260
+ thor (~> 1.0, >= 1.2.2)
261
+ tsort (>= 0.2)
262
+ zeitwerk (~> 2.6)
263
+ rake (13.3.1)
264
+ rake-compiler-dock (1.10.0)
265
+ rb_sys (0.9.123)
266
+ rake-compiler-dock (= 1.10.0)
267
+ rdoc (7.0.1)
268
+ erb
269
+ psych (>= 4.0.0)
270
+ tsort
271
+ reline (0.6.3)
272
+ io-console (~> 0.5)
273
+ ruby-next-core (1.1.2)
274
+ ruby-progressbar (1.13.0)
275
+ ruby_llm (1.9.1)
276
+ base64
277
+ event_stream_parser (~> 1)
278
+ faraday (>= 1.10.0)
279
+ faraday-multipart (>= 1)
280
+ faraday-net_http (>= 1)
281
+ faraday-retry (>= 1)
282
+ marcel (~> 1.0)
283
+ ruby_llm-schema (~> 0.2.1)
284
+ zeitwerk (~> 2)
285
+ ruby_llm-schema (0.2.5)
286
+ securerandom (0.4.1)
287
+ stringio (3.2.0)
288
+ thor (1.4.0)
289
+ tiktoken_ruby (0.0.14.1)
290
+ rb_sys (~> 0.9)
291
+ timeout (0.6.0)
292
+ tsort (0.2.0)
293
+ tzinfo (2.0.6)
294
+ concurrent-ruby (~> 1.0)
295
+ uri (1.1.1)
296
+ useragent (0.16.11)
297
+ web-console (4.2.1)
298
+ actionview (>= 6.0.0)
299
+ activemodel (>= 6.0.0)
300
+ bindex (>= 0.4.0)
301
+ railties (>= 6.0.0)
302
+ websocket-driver (0.8.0)
303
+ base64
304
+ websocket-extensions (>= 0.1.0)
305
+ websocket-extensions (0.1.5)
306
+ zeitwerk (2.7.4)
307
+
308
+ PLATFORMS
309
+ arm64-darwin-25
310
+ ruby
311
+
312
+ DEPENDENCIES
313
+ debug_me
314
+ htm!
315
+ pg (~> 1.5)
316
+ propshaft
317
+ puma (~> 6.0)
318
+ rails (~> 7.1)
319
+ web-console
320
+
321
+ CHECKSUMS
322
+ actioncable (7.2.3) sha256=e15d17b245f1dfe7cafdda4a0c6f7ba8ebaab1af33884415e09cfef4e93ad4f9
323
+ actionmailbox (7.2.3) sha256=16bbf0a7c330f2d08d52d5e3c1b03813a8ef60bfb0a48e89c0bf92b069cb4d5e
324
+ actionmailer (7.2.3) sha256=68d646b852a6d2b25d8834fc796c3dc10f76a4c7fd77b3251c3f4dd832ec8ab8
325
+ actionpack (7.2.3) sha256=2a14e4c64695777041ea7aaf498462284cadd561f009654393daf9b2de7207cf
326
+ actiontext (7.2.3) sha256=a6ffd9efb7b7b4e26029e5c88e8a2ea9aae8d6cefdfed960be139772f1a94037
327
+ actionview (7.2.3) sha256=1f427d7a41b43804d7250911535740451b9c32b6416239d87e6dab9d5948ecb2
328
+ activejob (7.2.3) sha256=e44964472de267b69e93752f088193c8ad2e56d2ef451d059dd7a53761e5ffb0
329
+ activemodel (7.2.3) sha256=bbaf66aeb93212e98ebf6ab900f8290f9a831645f0b235427f5acf0e074739db
330
+ activerecord (7.2.3) sha256=6facb7478ceb5f6baa9f0647daa50b4a3a43934997900f0011e6c667ff41a0d7
331
+ activestorage (7.2.3) sha256=4c1422bbfaa60c89e7b43cc38ade7bd3b8dc81024c48a21c1ac56814cf34ca2f
332
+ activesupport (7.2.3) sha256=5675c9770dac93e371412684249f9dc3c8cec104efd0624362a520ae685c7b10
333
+ addressable (2.8.8) sha256=7c13b8f9536cf6364c03b9d417c19986019e28f7c00ac8132da4eb0fe393b057
334
+ anyway_config (2.7.2) sha256=30f6b087c0b41afdd43fe46c81d65a16f052a8489dab453abaeb4ea67aa74bad
335
+ baran (0.2.1) sha256=6c19e835c6f73c70e7073fb3d3cb48d2c85606e0b1484914b4c01a3cecdd7892
336
+ base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
337
+ benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
338
+ bigdecimal (3.3.1) sha256=eaa01e228be54c4f9f53bf3cc34fe3d5e845c31963e7fcc5bedb05a4e7d52218
339
+ bindex (0.8.1) sha256=7b1ecc9dc539ed8bccfc8cb4d2732046227b09d6f37582ff12e50a5047ceb17e
340
+ builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
341
+ cgi (0.5.1) sha256=e93fcafc69b8a934fe1e6146121fa35430efa8b4a4047c4893764067036f18e9
342
+ chronic (0.10.2) sha256=766f2fcce6ac3cc152249ed0f2b827770d3e517e2e87c5fba7ed74f4889d2dc3
343
+ concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
344
+ connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
345
+ crass (1.0.6) sha256=dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d
346
+ date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
347
+ debug_me (1.1.3) sha256=ae8cf61993350d9b3cbe337a7f9a0f595be5b4976c10891a4e1eacc63d09f717
348
+ drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
349
+ dry-configurable (1.3.0) sha256=882d862858567fc1210d2549d4c090f34370fc1bb7c5c1933de3fe792e18afa8
350
+ dry-core (1.1.0) sha256=0903821a9707649a7da545a2cd88e20f3a663ab1c5288abd7f914fa7751ab195
351
+ dry-inflector (1.2.0) sha256=22f5d0b50fd57074ae57e2ca17e3b300e57564c218269dcf82ff3e42d3f38f2e
352
+ dry-initializer (3.2.0) sha256=37d59798f912dc0a1efe14a4db4a9306989007b302dcd5f25d0a2a20c166c4e3
353
+ dry-logic (1.6.0) sha256=da6fedbc0f90fc41f9b0cc7e6f05f5d529d1efaef6c8dcc8e0733f685745cea2
354
+ dry-schema (1.14.1) sha256=2fcd7539a7099cacae6a22f6a3a2c1846fe5afeb1c841cde432c89c6cb9b9ff1
355
+ dry-types (1.8.3) sha256=b5d97a45e0ed273131c0c3d5bc9f5633c2d1242e092ee47401ce7d5eab65c1bc
356
+ erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
357
+ erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
358
+ event_stream_parser (1.0.0) sha256=a2683bab70126286f8184dc88f7968ffc4028f813161fb073ec90d171f7de3c8
359
+ faraday (2.14.0) sha256=8699cfe5d97e55268f2596f9a9d5a43736808a943714e3d9a53e6110593941cd
360
+ faraday-multipart (1.1.1) sha256=77a18ff40149030fd1aef55bb4fc7a67ce46419a8a3fcd010e28c2526e8d8903
361
+ faraday-net_http (3.4.2) sha256=f147758260d3526939bf57ecf911682f94926a3666502e24c69992765875906c
362
+ faraday-retry (2.3.2) sha256=2402d2029032ebd238a2046221e67f6ef0da78c5a8ce8cd4f8b9c62e4d6451d1
363
+ fast-mcp (1.6.0) sha256=d68abb45d2daab9e7ae2934417460e4bf9ac87493c585dc5bb626f1afb7d12c4
364
+ globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
365
+ htm (0.0.18)
366
+ i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
367
+ io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
368
+ irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806
369
+ json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
370
+ logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
371
+ loofah (2.25.0) sha256=df5ed7ac3bac6a4ec802df3877ee5cc86d027299f8952e6243b3dac446b060e6
372
+ lru_redux (1.1.0) sha256=ee71d0ccab164c51de146c27b480a68b3631d5b4297b8ffe8eda1c72de87affb
373
+ mail (2.9.0) sha256=6fa6673ecd71c60c2d996260f9ee3dd387d4673b8169b502134659ece6d34941
374
+ marcel (1.1.0) sha256=fdcfcfa33cc52e93c4308d40e4090a5d4ea279e160a7f6af988260fa970e0bee
375
+ mime-types (3.7.0) sha256=dcebf61c246f08e15a4de34e386ebe8233791e868564a470c3fe77c00eed5e56
376
+ mime-types-data (3.2025.0924) sha256=f276bca15e59f35767cbcf2bc10e023e9200b30bd6a572c1daf7f4cc24994728
377
+ mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
378
+ mini_portile2 (2.8.9) sha256=0cd7c7f824e010c072e33f68bc02d85a00aeb6fce05bb4819c03dfd3c140c289
379
+ minitest (6.0.0) sha256=4ca597fc1d735ea18d2b4b98c5fb1d5a6da4a6f35ddf32bd5fa3eded33a453be
380
+ multipart-post (2.4.1) sha256=9872d03a8e552020ca096adadbf5e3cb1cd1cdd6acd3c161136b8a5737cdb4a8
381
+ neighbor (0.6.0) sha256=e2bd0bb98e1d6403892d1d0cf3683ae9429be51d6a6a14859135dc71cf9c27d3
382
+ net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996
383
+ net-imap (0.6.2) sha256=08caacad486853c61676cca0c0c47df93db02abc4a8239a8b67eb0981428acc6
384
+ net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3
385
+ net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8
386
+ net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736
387
+ nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1
388
+ nokogiri (1.18.10) sha256=d5cc0731008aa3b3a87b361203ea3d19b2069628cb55e46ac7d84a0445e69cc1
389
+ pg (1.6.2) sha256=58614afd405cc9c2c9e15bffe8432e0d6cfc58b722344ad4a47c73a85189c875
390
+ pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
391
+ prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
392
+ prism (1.7.0) sha256=10062f734bf7985c8424c44fac382ac04a58124ea3d220ec3ba9fe4f2da65103
393
+ propshaft (1.3.1) sha256=9acc664ef67e819ffa3d95bd7ad4c3623ea799110c5f4dee67fa7e583e74c392
394
+ psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974
395
+ public_suffix (7.0.0) sha256=f7090b5beb0e56f9f10d79eed4d5fbe551b3b425da65877e075dad47a6a1b095
396
+ puma (6.6.1) sha256=b9b56e4a4ea75d1bfa6d9e1972ee2c9f43d0883f011826d914e8e37b3694ea1e
397
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
398
+ rack (3.2.4) sha256=5d74b6f75082a643f43c1e76b419c40f0e5527fcfee1e669ac1e6b73c0ccb6f6
399
+ rack-session (2.1.1) sha256=0b6dc07dea7e4b583f58a48e8b806d4c9f1c6c9214ebc202ec94562cbea2e4e9
400
+ rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463
401
+ rackup (2.3.1) sha256=6c79c26753778e90983761d677a48937ee3192b3ffef6bc963c0950f94688868
402
+ rails (7.2.3) sha256=9a9812eb131189676e64665f6883fc9c4051f412cc87ef9e3fa242a09c609bff
403
+ rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d
404
+ rails-html-sanitizer (1.6.2) sha256=35fce2ca8242da8775c83b6ba9c1bcaad6751d9eb73c1abaa8403475ab89a560
405
+ railties (7.2.3) sha256=6eb010a6bfe6f223e783f739ddfcbdb5b88b1f3a87f7739f0a0685e466250422
406
+ rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
407
+ rake-compiler-dock (1.10.0) sha256=dd62ee19df2a185a3315697e560cfa8cc9129901332152851e023fab0e94bf11
408
+ rb_sys (0.9.123) sha256=c22ae84d1bca3eec0f13a45ae4ca9ba6eace93d5be270a40a9c0a9a5b92a34e5
409
+ rdoc (7.0.1) sha256=7ae1540c54eb8174f6549440dd2299276eac51deaa7d80ea7db9ea5b96559f53
410
+ reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
411
+ ruby-next-core (1.1.2) sha256=1b095fe2e45929f2581b3ecdb8d92b601ce4d72c12a466057c10e23b6f0c4512
412
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
413
+ ruby_llm (1.9.1) sha256=f7d3c72489c70041ee73d7bfe4250a989f801fbba1fad2200904091e433ba511
414
+ ruby_llm-schema (0.2.5) sha256=b08cd42e8de7100325e2e868672a56f1915eb23692bb808f51f214e41392104f
415
+ securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
416
+ stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
417
+ thor (1.4.0) sha256=8763e822ccb0f1d7bee88cde131b19a65606657b847cc7b7b4b82e772bcd8a3d
418
+ tiktoken_ruby (0.0.14.1) sha256=cff8ecf6e8a7b9e854027812b01e55c35f5f7719182c3589655008d0eeb51db1
419
+ timeout (0.6.0) sha256=6d722ad619f96ee383a0c557ec6eb8c4ecb08af3af62098a0be5057bf00de1af
420
+ tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
421
+ tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
422
+ uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
423
+ useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
424
+ web-console (4.2.1) sha256=e7bcf37a10ea2b4ec4281649d1cee461b32232d0a447e82c786e6841fd22fe20
425
+ websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
426
+ websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
427
+ zeitwerk (2.7.4) sha256=2bef90f356bdafe9a6c2bd32bcd804f83a4f9b8bc27f3600fff051eb3edcec8b
428
+
429
+ BUNDLED WITH
430
+ 4.0.2
@@ -0,0 +1 @@
1
+ web: bin/rails server -p 3000
@@ -0,0 +1,98 @@
1
+ # HTM Memory Explorer
2
+
3
+ A full-stack Rails application demonstrating HTM integration with a compelling UI/UX for exploring and managing semantic memories.
4
+
5
+ ## Features
6
+
7
+ - **Dashboard** - Overview of memory statistics, recent memories, top tags, and active robots
8
+ - **Memories Browser** - Full CRUD for memories with search, filtering, soft delete, and restore
9
+ - **Tag Visualization** - View tags as a list, text tree, or SVG hierarchy diagram
10
+ - **Robots Management** - Manage LLM agents in the hive mind architecture
11
+ - **Semantic Search** - Compare vector, full-text, and hybrid search strategies
12
+ - **File Loading** - Load markdown files with automatic chunking and re-sync
13
+
14
+ ## Tech Stack
15
+
16
+ - Rails 7.1 with Hotwire (Turbo + Stimulus)
17
+ - Tailwind CSS for dark-themed UI
18
+ - PostgreSQL with pgvector
19
+ - HTM gem for semantic memory management
20
+
21
+ ## Setup
22
+
23
+ ```bash
24
+ # From this directory
25
+ bundle install
26
+
27
+ # Ensure HTM database is set up
28
+ export HTM_DATABASE__URL="postgresql://localhost/htm_development"
29
+
30
+ # Install Tailwind CSS
31
+ rails tailwindcss:install
32
+
33
+ # Set up importmap
34
+ rails importmap:install
35
+ rails turbo:install
36
+ rails stimulus:install
37
+ ```
38
+
39
+ ## Running
40
+
41
+ ```bash
42
+ # Start the Rails server with Tailwind CSS watching
43
+ ./bin/dev
44
+
45
+ # Or start manually
46
+ bundle exec rails server
47
+ ```
48
+
49
+ ## Screenshots
50
+
51
+ The app features a dark theme with:
52
+ - Clean dashboard with statistics cards
53
+ - Memory browser with tag filtering
54
+ - Interactive search playground comparing strategies
55
+ - Tag hierarchy visualization (text tree + SVG)
56
+ - Robot management for multi-agent scenarios
57
+
58
+ ## How HTM Integration Works
59
+
60
+ 1. The HTM gem includes a Rails Railtie (`lib/htm/railtie.rb`)
61
+ 2. When Rails boots, the Railtie automatically:
62
+ - Configures HTM to use `Rails.logger`
63
+ - Sets job backend to `:active_job` (or `:inline` in test env)
64
+ - Loads HTM rake tasks
65
+ - Verifies database connection in development
66
+
67
+ 3. The `ApplicationController` provides a `htm` helper method that creates an HTM instance scoped to the current robot (session-based)
68
+
69
+ 4. All HTM features are exposed through the UI:
70
+ - `htm.remember()` - Add memories (Memories > New)
71
+ - `htm.recall()` - Search memories (Search page)
72
+ - `htm.forget()` / `htm.restore()` - Soft delete/restore
73
+ - `htm.load_file()` - Load markdown files (Files page)
74
+ - Tag hierarchy visualization via `HTM::Models::Tag.all.tree_svg`
75
+
76
+ ## Pages
77
+
78
+ | Route | Description |
79
+ |-------|-------------|
80
+ | `/` | Dashboard with stats and overview |
81
+ | `/memories` | Browse, search, and filter memories |
82
+ | `/memories/new` | Add a new memory |
83
+ | `/memories/deleted` | View and restore deleted memories |
84
+ | `/tags` | Browse tags (list, tree, or diagram view) |
85
+ | `/robots` | Manage robots and switch active robot |
86
+ | `/search` | Semantic search playground |
87
+ | `/files` | File loading and management |
88
+
89
+ ## Development
90
+
91
+ The app uses:
92
+ - `propshaft` for asset pipeline
93
+ - `importmap-rails` for JavaScript
94
+ - `tailwindcss-rails` for styling
95
+ - `kaminari` for pagination
96
+ - `turbo-rails` for SPA-like navigation
97
+
98
+ No JavaScript build step required.
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'config/application'
4
+
5
+ Rails.application.load_tasks
@@ -0,0 +1,83 @@
1
+ /*
2
+ * HTM Memory Explorer Styles
3
+ * Tailwind CSS loaded via CDN in layout
4
+ */
5
+
6
+ /* Custom scrollbar for dark theme */
7
+ ::-webkit-scrollbar {
8
+ width: 8px;
9
+ height: 8px;
10
+ }
11
+
12
+ ::-webkit-scrollbar-track {
13
+ background: rgb(31 41 55);
14
+ }
15
+
16
+ ::-webkit-scrollbar-thumb {
17
+ background: rgb(75 85 99);
18
+ border-radius: 4px;
19
+ }
20
+
21
+ ::-webkit-scrollbar-thumb:hover {
22
+ background: rgb(107 114 128);
23
+ }
24
+
25
+ /* Line clamp utility */
26
+ .line-clamp-2 {
27
+ display: -webkit-box;
28
+ -webkit-line-clamp: 2;
29
+ -webkit-box-orient: vertical;
30
+ overflow: hidden;
31
+ }
32
+
33
+ .line-clamp-3 {
34
+ display: -webkit-box;
35
+ -webkit-line-clamp: 3;
36
+ -webkit-box-orient: vertical;
37
+ overflow: hidden;
38
+ }
39
+
40
+ .line-clamp-4 {
41
+ display: -webkit-box;
42
+ -webkit-line-clamp: 4;
43
+ -webkit-box-orient: vertical;
44
+ overflow: hidden;
45
+ }
46
+
47
+ /* Form inputs - styled with inline classes instead of @apply */
48
+ input[type="text"],
49
+ input[type="search"],
50
+ textarea,
51
+ select {
52
+ border-radius: 0.375rem;
53
+ background-color: rgb(55 65 81);
54
+ border-color: rgb(75 85 99);
55
+ color: white;
56
+ }
57
+
58
+ input[type="text"]::placeholder,
59
+ input[type="search"]::placeholder,
60
+ textarea::placeholder {
61
+ color: rgb(156 163 175);
62
+ }
63
+
64
+ input[type="text"]:focus,
65
+ input[type="search"]:focus,
66
+ textarea:focus,
67
+ select:focus {
68
+ outline: 2px solid transparent;
69
+ outline-offset: 2px;
70
+ box-shadow: 0 0 0 2px rgb(99 102 241);
71
+ border-color: rgb(99 102 241);
72
+ }
73
+
74
+ /* SVG container for tag visualization */
75
+ .tag-svg-container svg {
76
+ max-width: 100%;
77
+ height: auto;
78
+ }
79
+
80
+ /* Mermaid diagram styling for dark theme */
81
+ .mermaid {
82
+ background: transparent !important;
83
+ }
@@ -0,0 +1,6 @@
1
+ /* Inter Font from Google Fonts CDN */
2
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');
3
+
4
+ body {
5
+ font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
6
+ }
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ActionController::Base
4
+ # HTM instance for the current request
5
+ def htm
6
+ @htm ||= HTM.new(robot_name: current_robot_name)
7
+ end
8
+ helper_method :htm
9
+
10
+ # Allow switching robots via session
11
+ def current_robot_name
12
+ session[:robot_name] || 'explorer'
13
+ end
14
+ helper_method :current_robot_name
15
+
16
+ def current_robot_name=(name)
17
+ session[:robot_name] = name
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DashboardController < ApplicationController
4
+ def index
5
+ # Note: HTM::Models::Node has a default_scope that excludes deleted nodes
6
+ # so we don't need to call .active explicitly
7
+ @stats = {
8
+ total_nodes: HTM::Models::Node.count,
9
+ nodes_with_embeddings: HTM::Models::Node.with_embeddings.count,
10
+ deleted_nodes: HTM::Models::Node.deleted.count,
11
+ total_tags: HTM::Models::Tag.count,
12
+ total_robots: HTM::Models::Robot.count,
13
+ total_file_sources: HTM::Models::FileSource.count
14
+ }
15
+
16
+ @recent_memories = HTM::Models::Node.recent.limit(5)
17
+
18
+ @top_tags = HTM::Models::Tag
19
+ .joins(:nodes)
20
+ .group('tags.id')
21
+ .order('COUNT(nodes.id) DESC')
22
+ .limit(10)
23
+ .select('tags.*, COUNT(nodes.id) as node_count')
24
+
25
+ @robots = HTM::Models::Robot.order(created_at: :desc).limit(5)
26
+ end
27
+ end