htm 0.0.15 → 0.0.17

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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +1 -0
  3. data/CHANGELOG.md +67 -0
  4. data/README.md +97 -1592
  5. data/bin/htm_mcp +31 -0
  6. data/config/database.yml +7 -4
  7. data/docs/getting-started/installation.md +31 -11
  8. data/docs/guides/mcp-server.md +456 -21
  9. data/docs/multi_framework_support.md +2 -2
  10. data/examples/mcp_client.rb +2 -2
  11. data/examples/rails_app/.gitignore +2 -0
  12. data/examples/rails_app/Gemfile +22 -0
  13. data/examples/rails_app/Gemfile.lock +438 -0
  14. data/examples/rails_app/Procfile.dev +1 -0
  15. data/examples/rails_app/README.md +98 -0
  16. data/examples/rails_app/Rakefile +5 -0
  17. data/examples/rails_app/app/assets/stylesheets/application.css +83 -0
  18. data/examples/rails_app/app/assets/stylesheets/inter-font.css +6 -0
  19. data/examples/rails_app/app/controllers/application_controller.rb +19 -0
  20. data/examples/rails_app/app/controllers/dashboard_controller.rb +27 -0
  21. data/examples/rails_app/app/controllers/files_controller.rb +205 -0
  22. data/examples/rails_app/app/controllers/memories_controller.rb +102 -0
  23. data/examples/rails_app/app/controllers/robots_controller.rb +44 -0
  24. data/examples/rails_app/app/controllers/search_controller.rb +46 -0
  25. data/examples/rails_app/app/controllers/tags_controller.rb +30 -0
  26. data/examples/rails_app/app/javascript/application.js +4 -0
  27. data/examples/rails_app/app/javascript/controllers/application.js +9 -0
  28. data/examples/rails_app/app/javascript/controllers/index.js +6 -0
  29. data/examples/rails_app/app/views/dashboard/index.html.erb +123 -0
  30. data/examples/rails_app/app/views/files/index.html.erb +108 -0
  31. data/examples/rails_app/app/views/files/new.html.erb +321 -0
  32. data/examples/rails_app/app/views/files/show.html.erb +130 -0
  33. data/examples/rails_app/app/views/layouts/application.html.erb +124 -0
  34. data/examples/rails_app/app/views/memories/_memory_card.html.erb +51 -0
  35. data/examples/rails_app/app/views/memories/deleted.html.erb +62 -0
  36. data/examples/rails_app/app/views/memories/edit.html.erb +35 -0
  37. data/examples/rails_app/app/views/memories/index.html.erb +81 -0
  38. data/examples/rails_app/app/views/memories/new.html.erb +71 -0
  39. data/examples/rails_app/app/views/memories/show.html.erb +126 -0
  40. data/examples/rails_app/app/views/robots/index.html.erb +106 -0
  41. data/examples/rails_app/app/views/robots/new.html.erb +36 -0
  42. data/examples/rails_app/app/views/robots/show.html.erb +79 -0
  43. data/examples/rails_app/app/views/search/index.html.erb +184 -0
  44. data/examples/rails_app/app/views/shared/_navbar.html.erb +52 -0
  45. data/examples/rails_app/app/views/shared/_stat_card.html.erb +52 -0
  46. data/examples/rails_app/app/views/tags/index.html.erb +131 -0
  47. data/examples/rails_app/app/views/tags/show.html.erb +67 -0
  48. data/examples/rails_app/bin/dev +8 -0
  49. data/examples/rails_app/bin/rails +4 -0
  50. data/examples/rails_app/bin/rake +4 -0
  51. data/examples/rails_app/config/application.rb +33 -0
  52. data/examples/rails_app/config/boot.rb +5 -0
  53. data/examples/rails_app/config/database.yml +15 -0
  54. data/examples/rails_app/config/environment.rb +5 -0
  55. data/examples/rails_app/config/importmap.rb +7 -0
  56. data/examples/rails_app/config/routes.rb +38 -0
  57. data/examples/rails_app/config/tailwind.config.js +35 -0
  58. data/examples/rails_app/config.ru +5 -0
  59. data/examples/rails_app/log/.keep +0 -0
  60. data/examples/rails_app/tmp/local_secret.txt +1 -0
  61. data/lib/htm/active_record_config.rb +2 -5
  62. data/lib/htm/configuration.rb +35 -2
  63. data/lib/htm/database.rb +3 -6
  64. data/lib/htm/mcp/cli.rb +333 -0
  65. data/lib/htm/mcp/group_tools.rb +476 -0
  66. data/lib/htm/mcp/resources.rb +89 -0
  67. data/lib/htm/mcp/server.rb +98 -0
  68. data/lib/htm/mcp/tools.rb +488 -0
  69. data/lib/htm/models/file_source.rb +5 -3
  70. data/lib/htm/railtie.rb +0 -4
  71. data/lib/htm/tasks.rb +7 -4
  72. data/lib/htm/version.rb +1 -1
  73. data/lib/tasks/htm.rake +6 -9
  74. metadata +59 -4
  75. data/bin/htm_mcp.rb +0 -621
@@ -11,7 +11,7 @@
11
11
  # 1. Install gems: gem install ruby_llm-mcp
12
12
  # 2. Have Ollama running with gpt-oss model: ollama pull gpt-oss
13
13
  # 3. Set HTM_DBURL environment variable
14
- # 4. The htm_mcp.rb must be available (this client will launch it)
14
+ # 4. The htm_mcp executable must be available (this client will launch it)
15
15
  #
16
16
  # Usage:
17
17
  # ruby examples/mcp_client.rb
@@ -29,7 +29,7 @@ require 'ruby_llm/mcp'
29
29
  # Configuration
30
30
  OLLAMA_MODEL = ENV.fetch('OLLAMA_MODEL', 'gpt-oss:latest')
31
31
  OLLAMA_URL = ENV.fetch('OLLAMA_URL', 'http://localhost:11434')
32
- MCP_SERVER_PATH = File.expand_path('../bin/htm_mcp.rb', __dir__)
32
+ MCP_SERVER_PATH = File.expand_path('../bin/htm_mcp', __dir__)
33
33
  ENV_ROBOT_NAME = ENV['HTM_ROBOT_NAME'] # nil if not set, allows prompting
34
34
 
35
35
  class HTMMcpClient
@@ -0,0 +1,2 @@
1
+ /log/
2
+ /tmp/
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Rails - full-stack setup
6
+ gem 'rails', '~> 7.1'
7
+ gem 'puma', '~> 6.0'
8
+
9
+ # HTM (use local development version)
10
+ gem 'htm', path: '../..'
11
+
12
+ # PostgreSQL (required for HTM)
13
+ gem 'pg', '~> 1.5'
14
+
15
+ # Frontend - using CDN for Tailwind and Hotwire (no build step)
16
+ gem 'propshaft' # Asset pipeline for CSS/images
17
+ # Pagination uses simple offset/limit (no Kaminari needed)
18
+
19
+ group :development do
20
+ gem 'debug_me'
21
+ gem 'web-console'
22
+ end
@@ -0,0 +1,438 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ htm (0.0.16)
5
+ activerecord
6
+ baran
7
+ chronic
8
+ fast-mcp
9
+ lru_redux
10
+ neighbor
11
+ pg (>= 1.5.0)
12
+ ruby-progressbar
13
+ ruby_llm
14
+ tiktoken_ruby
15
+
16
+ GEM
17
+ remote: https://rubygems.org/
18
+ specs:
19
+ actioncable (7.2.3)
20
+ actionpack (= 7.2.3)
21
+ activesupport (= 7.2.3)
22
+ nio4r (~> 2.0)
23
+ websocket-driver (>= 0.6.1)
24
+ zeitwerk (~> 2.6)
25
+ actionmailbox (7.2.3)
26
+ actionpack (= 7.2.3)
27
+ activejob (= 7.2.3)
28
+ activerecord (= 7.2.3)
29
+ activestorage (= 7.2.3)
30
+ activesupport (= 7.2.3)
31
+ mail (>= 2.8.0)
32
+ actionmailer (7.2.3)
33
+ actionpack (= 7.2.3)
34
+ actionview (= 7.2.3)
35
+ activejob (= 7.2.3)
36
+ activesupport (= 7.2.3)
37
+ mail (>= 2.8.0)
38
+ rails-dom-testing (~> 2.2)
39
+ actionpack (7.2.3)
40
+ actionview (= 7.2.3)
41
+ activesupport (= 7.2.3)
42
+ cgi
43
+ nokogiri (>= 1.8.5)
44
+ racc
45
+ rack (>= 2.2.4, < 3.3)
46
+ rack-session (>= 1.0.1)
47
+ rack-test (>= 0.6.3)
48
+ rails-dom-testing (~> 2.2)
49
+ rails-html-sanitizer (~> 1.6)
50
+ useragent (~> 0.16)
51
+ actiontext (7.2.3)
52
+ actionpack (= 7.2.3)
53
+ activerecord (= 7.2.3)
54
+ activestorage (= 7.2.3)
55
+ activesupport (= 7.2.3)
56
+ globalid (>= 0.6.0)
57
+ nokogiri (>= 1.8.5)
58
+ actionview (7.2.3)
59
+ activesupport (= 7.2.3)
60
+ builder (~> 3.1)
61
+ cgi
62
+ erubi (~> 1.11)
63
+ rails-dom-testing (~> 2.2)
64
+ rails-html-sanitizer (~> 1.6)
65
+ activejob (7.2.3)
66
+ activesupport (= 7.2.3)
67
+ globalid (>= 0.3.6)
68
+ activemodel (7.2.3)
69
+ activesupport (= 7.2.3)
70
+ activerecord (7.2.3)
71
+ activemodel (= 7.2.3)
72
+ activesupport (= 7.2.3)
73
+ timeout (>= 0.4.0)
74
+ activestorage (7.2.3)
75
+ actionpack (= 7.2.3)
76
+ activejob (= 7.2.3)
77
+ activerecord (= 7.2.3)
78
+ activesupport (= 7.2.3)
79
+ marcel (~> 1.0)
80
+ activesupport (7.2.3)
81
+ base64
82
+ benchmark (>= 0.3)
83
+ bigdecimal
84
+ concurrent-ruby (~> 1.0, >= 1.3.1)
85
+ connection_pool (>= 2.2.5)
86
+ drb
87
+ i18n (>= 1.6, < 2)
88
+ logger (>= 1.4.2)
89
+ minitest (>= 5.1)
90
+ securerandom (>= 0.3)
91
+ tzinfo (~> 2.0, >= 2.0.5)
92
+ addressable (2.8.8)
93
+ public_suffix (>= 2.0.2, < 8.0)
94
+ baran (0.2.1)
95
+ base64 (0.3.0)
96
+ benchmark (0.5.0)
97
+ bigdecimal (3.3.1)
98
+ bindex (0.8.1)
99
+ builder (3.3.0)
100
+ cgi (0.5.0)
101
+ chronic (0.10.2)
102
+ concurrent-ruby (1.3.5)
103
+ connection_pool (3.0.2)
104
+ crass (1.0.6)
105
+ date (3.5.0)
106
+ debug_me (1.1.3)
107
+ drb (2.2.3)
108
+ dry-configurable (1.3.0)
109
+ dry-core (~> 1.1)
110
+ zeitwerk (~> 2.6)
111
+ dry-core (1.1.0)
112
+ concurrent-ruby (~> 1.0)
113
+ logger
114
+ zeitwerk (~> 2.6)
115
+ dry-inflector (1.2.0)
116
+ dry-initializer (3.2.0)
117
+ dry-logic (1.6.0)
118
+ bigdecimal
119
+ concurrent-ruby (~> 1.0)
120
+ dry-core (~> 1.1)
121
+ zeitwerk (~> 2.6)
122
+ dry-schema (1.14.1)
123
+ concurrent-ruby (~> 1.0)
124
+ dry-configurable (~> 1.0, >= 1.0.1)
125
+ dry-core (~> 1.1)
126
+ dry-initializer (~> 3.2)
127
+ dry-logic (~> 1.5)
128
+ dry-types (~> 1.8)
129
+ zeitwerk (~> 2.6)
130
+ dry-types (1.8.3)
131
+ bigdecimal (~> 3.0)
132
+ concurrent-ruby (~> 1.0)
133
+ dry-core (~> 1.0)
134
+ dry-inflector (~> 1.0)
135
+ dry-logic (~> 1.4)
136
+ zeitwerk (~> 2.6)
137
+ erb (6.0.0)
138
+ erubi (1.13.1)
139
+ event_stream_parser (1.0.0)
140
+ faraday (2.14.0)
141
+ faraday-net_http (>= 2.0, < 3.5)
142
+ json
143
+ logger
144
+ faraday-multipart (1.1.1)
145
+ multipart-post (~> 2.0)
146
+ faraday-net_http (3.4.2)
147
+ net-http (~> 0.5)
148
+ faraday-retry (2.3.2)
149
+ faraday (~> 2.0)
150
+ fast-mcp (1.6.0)
151
+ addressable (~> 2.8)
152
+ base64
153
+ dry-schema (~> 1.14)
154
+ json (~> 2.0)
155
+ mime-types (~> 3.4)
156
+ rack (>= 2.0, < 4.0)
157
+ globalid (1.3.0)
158
+ activesupport (>= 6.1)
159
+ i18n (1.14.7)
160
+ concurrent-ruby (~> 1.0)
161
+ io-console (0.8.1)
162
+ irb (1.15.3)
163
+ pp (>= 0.6.0)
164
+ rdoc (>= 4.0.0)
165
+ reline (>= 0.4.2)
166
+ json (2.17.1)
167
+ kaminari (1.2.2)
168
+ activesupport (>= 4.1.0)
169
+ kaminari-actionview (= 1.2.2)
170
+ kaminari-activerecord (= 1.2.2)
171
+ kaminari-core (= 1.2.2)
172
+ kaminari-actionview (1.2.2)
173
+ actionview
174
+ kaminari-core (= 1.2.2)
175
+ kaminari-activerecord (1.2.2)
176
+ activerecord
177
+ kaminari-core (= 1.2.2)
178
+ kaminari-core (1.2.2)
179
+ logger (1.7.0)
180
+ loofah (2.24.1)
181
+ crass (~> 1.0.2)
182
+ nokogiri (>= 1.12.0)
183
+ lru_redux (1.1.0)
184
+ mail (2.9.0)
185
+ logger
186
+ mini_mime (>= 0.1.1)
187
+ net-imap
188
+ net-pop
189
+ net-smtp
190
+ marcel (1.1.0)
191
+ mime-types (3.7.0)
192
+ logger
193
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
194
+ mime-types-data (3.2025.0924)
195
+ mini_mime (1.1.5)
196
+ mini_portile2 (2.8.9)
197
+ minitest (5.26.2)
198
+ multipart-post (2.4.1)
199
+ neighbor (0.6.0)
200
+ activerecord (>= 7.1)
201
+ net-http (0.8.0)
202
+ uri (>= 0.11.1)
203
+ net-imap (0.5.12)
204
+ date
205
+ net-protocol
206
+ net-pop (0.1.2)
207
+ net-protocol
208
+ net-protocol (0.2.2)
209
+ timeout
210
+ net-smtp (0.5.1)
211
+ net-protocol
212
+ nio4r (2.7.5)
213
+ nokogiri (1.18.10)
214
+ mini_portile2 (~> 2.8.2)
215
+ racc (~> 1.4)
216
+ pg (1.6.2)
217
+ pp (0.6.3)
218
+ prettyprint
219
+ prettyprint (0.2.0)
220
+ propshaft (1.3.1)
221
+ actionpack (>= 7.0.0)
222
+ activesupport (>= 7.0.0)
223
+ rack
224
+ psych (5.2.6)
225
+ date
226
+ stringio
227
+ public_suffix (7.0.0)
228
+ puma (6.6.1)
229
+ nio4r (~> 2.0)
230
+ racc (1.8.1)
231
+ rack (3.2.4)
232
+ rack-session (2.1.1)
233
+ base64 (>= 0.1.0)
234
+ rack (>= 3.0.0)
235
+ rack-test (2.2.0)
236
+ rack (>= 1.3)
237
+ rackup (2.3.1)
238
+ rack (>= 3)
239
+ rails (7.2.3)
240
+ actioncable (= 7.2.3)
241
+ actionmailbox (= 7.2.3)
242
+ actionmailer (= 7.2.3)
243
+ actionpack (= 7.2.3)
244
+ actiontext (= 7.2.3)
245
+ actionview (= 7.2.3)
246
+ activejob (= 7.2.3)
247
+ activemodel (= 7.2.3)
248
+ activerecord (= 7.2.3)
249
+ activestorage (= 7.2.3)
250
+ activesupport (= 7.2.3)
251
+ bundler (>= 1.15.0)
252
+ railties (= 7.2.3)
253
+ rails-dom-testing (2.3.0)
254
+ activesupport (>= 5.0.0)
255
+ minitest
256
+ nokogiri (>= 1.6)
257
+ rails-html-sanitizer (1.6.2)
258
+ loofah (~> 2.21)
259
+ 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)
260
+ railties (7.2.3)
261
+ actionpack (= 7.2.3)
262
+ activesupport (= 7.2.3)
263
+ cgi
264
+ irb (~> 1.13)
265
+ rackup (>= 1.0.0)
266
+ rake (>= 12.2)
267
+ thor (~> 1.0, >= 1.2.2)
268
+ tsort (>= 0.2)
269
+ zeitwerk (~> 2.6)
270
+ rake (13.3.1)
271
+ rake-compiler-dock (1.10.0)
272
+ rb_sys (0.9.119)
273
+ rake-compiler-dock (= 1.10.0)
274
+ rdoc (6.16.1)
275
+ erb
276
+ psych (>= 4.0.0)
277
+ tsort
278
+ reline (0.6.3)
279
+ io-console (~> 0.5)
280
+ ruby-progressbar (1.13.0)
281
+ ruby_llm (1.9.1)
282
+ base64
283
+ event_stream_parser (~> 1)
284
+ faraday (>= 1.10.0)
285
+ faraday-multipart (>= 1)
286
+ faraday-net_http (>= 1)
287
+ faraday-retry (>= 1)
288
+ marcel (~> 1.0)
289
+ ruby_llm-schema (~> 0.2.1)
290
+ zeitwerk (~> 2)
291
+ ruby_llm-schema (0.2.5)
292
+ securerandom (0.4.1)
293
+ stringio (3.1.9)
294
+ thor (1.4.0)
295
+ tiktoken_ruby (0.0.13)
296
+ rb_sys (~> 0.9)
297
+ timeout (0.4.4)
298
+ tsort (0.2.0)
299
+ tzinfo (2.0.6)
300
+ concurrent-ruby (~> 1.0)
301
+ uri (1.1.1)
302
+ useragent (0.16.11)
303
+ web-console (4.2.1)
304
+ actionview (>= 6.0.0)
305
+ activemodel (>= 6.0.0)
306
+ bindex (>= 0.4.0)
307
+ railties (>= 6.0.0)
308
+ websocket-driver (0.8.0)
309
+ base64
310
+ websocket-extensions (>= 0.1.0)
311
+ websocket-extensions (0.1.5)
312
+ zeitwerk (2.7.3)
313
+
314
+ PLATFORMS
315
+ arm64-darwin-25
316
+ ruby
317
+
318
+ DEPENDENCIES
319
+ debug_me
320
+ htm!
321
+ kaminari
322
+ pg (~> 1.5)
323
+ propshaft
324
+ puma (~> 6.0)
325
+ rails (~> 7.1)
326
+ web-console
327
+
328
+ CHECKSUMS
329
+ actioncable (7.2.3) sha256=e15d17b245f1dfe7cafdda4a0c6f7ba8ebaab1af33884415e09cfef4e93ad4f9
330
+ actionmailbox (7.2.3) sha256=16bbf0a7c330f2d08d52d5e3c1b03813a8ef60bfb0a48e89c0bf92b069cb4d5e
331
+ actionmailer (7.2.3) sha256=68d646b852a6d2b25d8834fc796c3dc10f76a4c7fd77b3251c3f4dd832ec8ab8
332
+ actionpack (7.2.3) sha256=2a14e4c64695777041ea7aaf498462284cadd561f009654393daf9b2de7207cf
333
+ actiontext (7.2.3) sha256=a6ffd9efb7b7b4e26029e5c88e8a2ea9aae8d6cefdfed960be139772f1a94037
334
+ actionview (7.2.3) sha256=1f427d7a41b43804d7250911535740451b9c32b6416239d87e6dab9d5948ecb2
335
+ activejob (7.2.3) sha256=e44964472de267b69e93752f088193c8ad2e56d2ef451d059dd7a53761e5ffb0
336
+ activemodel (7.2.3) sha256=bbaf66aeb93212e98ebf6ab900f8290f9a831645f0b235427f5acf0e074739db
337
+ activerecord (7.2.3) sha256=6facb7478ceb5f6baa9f0647daa50b4a3a43934997900f0011e6c667ff41a0d7
338
+ activestorage (7.2.3) sha256=4c1422bbfaa60c89e7b43cc38ade7bd3b8dc81024c48a21c1ac56814cf34ca2f
339
+ activesupport (7.2.3) sha256=5675c9770dac93e371412684249f9dc3c8cec104efd0624362a520ae685c7b10
340
+ addressable (2.8.8) sha256=7c13b8f9536cf6364c03b9d417c19986019e28f7c00ac8132da4eb0fe393b057
341
+ baran (0.2.1) sha256=6c19e835c6f73c70e7073fb3d3cb48d2c85606e0b1484914b4c01a3cecdd7892
342
+ base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
343
+ benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
344
+ bigdecimal (3.3.1) sha256=eaa01e228be54c4f9f53bf3cc34fe3d5e845c31963e7fcc5bedb05a4e7d52218
345
+ bindex (0.8.1) sha256=7b1ecc9dc539ed8bccfc8cb4d2732046227b09d6f37582ff12e50a5047ceb17e
346
+ builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
347
+ cgi (0.5.0) sha256=fe99f65bb2c146e294372ebb27602adbc3b4c008e9ea7038c6bd48c1ec9759da
348
+ chronic (0.10.2) sha256=766f2fcce6ac3cc152249ed0f2b827770d3e517e2e87c5fba7ed74f4889d2dc3
349
+ concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
350
+ connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
351
+ crass (1.0.6) sha256=dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d
352
+ date (3.5.0) sha256=5e74fd6c04b0e65d97ad4f3bb5cb2d8efb37f386cc848f46310b4593ffc46ee5
353
+ debug_me (1.1.3) sha256=ae8cf61993350d9b3cbe337a7f9a0f595be5b4976c10891a4e1eacc63d09f717
354
+ drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
355
+ dry-configurable (1.3.0) sha256=882d862858567fc1210d2549d4c090f34370fc1bb7c5c1933de3fe792e18afa8
356
+ dry-core (1.1.0) sha256=0903821a9707649a7da545a2cd88e20f3a663ab1c5288abd7f914fa7751ab195
357
+ dry-inflector (1.2.0) sha256=22f5d0b50fd57074ae57e2ca17e3b300e57564c218269dcf82ff3e42d3f38f2e
358
+ dry-initializer (3.2.0) sha256=37d59798f912dc0a1efe14a4db4a9306989007b302dcd5f25d0a2a20c166c4e3
359
+ dry-logic (1.6.0) sha256=da6fedbc0f90fc41f9b0cc7e6f05f5d529d1efaef6c8dcc8e0733f685745cea2
360
+ dry-schema (1.14.1) sha256=2fcd7539a7099cacae6a22f6a3a2c1846fe5afeb1c841cde432c89c6cb9b9ff1
361
+ dry-types (1.8.3) sha256=b5d97a45e0ed273131c0c3d5bc9f5633c2d1242e092ee47401ce7d5eab65c1bc
362
+ erb (6.0.0) sha256=2730893f9d8c9733f16cab315a4e4b71c1afa9cabc1a1e7ad1403feba8f52579
363
+ erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
364
+ event_stream_parser (1.0.0) sha256=a2683bab70126286f8184dc88f7968ffc4028f813161fb073ec90d171f7de3c8
365
+ faraday (2.14.0) sha256=8699cfe5d97e55268f2596f9a9d5a43736808a943714e3d9a53e6110593941cd
366
+ faraday-multipart (1.1.1) sha256=77a18ff40149030fd1aef55bb4fc7a67ce46419a8a3fcd010e28c2526e8d8903
367
+ faraday-net_http (3.4.2) sha256=f147758260d3526939bf57ecf911682f94926a3666502e24c69992765875906c
368
+ faraday-retry (2.3.2) sha256=2402d2029032ebd238a2046221e67f6ef0da78c5a8ce8cd4f8b9c62e4d6451d1
369
+ fast-mcp (1.6.0) sha256=d68abb45d2daab9e7ae2934417460e4bf9ac87493c585dc5bb626f1afb7d12c4
370
+ globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
371
+ htm (0.0.16)
372
+ i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
373
+ io-console (0.8.1) sha256=1e15440a6b2f67b6ea496df7c474ed62c860ad11237f29b3bd187f054b925fcb
374
+ irb (1.15.3) sha256=4349edff1efa7ff7bfd34cb9df74a133a588ba88c2718098b3b4468b81184aaa
375
+ json (2.17.1) sha256=e0e4824541336a44915436f53e7ea74c687314fb8f88080fa1456f6a34ead92e
376
+ kaminari (1.2.2) sha256=c4076ff9adccc6109408333f87b5c4abbda5e39dc464bd4c66d06d9f73442a3e
377
+ kaminari-actionview (1.2.2) sha256=1330f6fc8b59a4a4ef6a549ff8a224797289ebf7a3a503e8c1652535287cc909
378
+ kaminari-activerecord (1.2.2) sha256=0dd3a67bab356a356f36b3b7236bcb81cef313095365befe8e98057dd2472430
379
+ kaminari-core (1.2.2) sha256=3bd26fec7370645af40ca73b9426a448d09b8a8ba7afa9ba3c3e0d39cdbb83ff
380
+ logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
381
+ loofah (2.24.1) sha256=655a30842b70ec476410b347ab1cd2a5b92da46a19044357bbd9f401b009a337
382
+ lru_redux (1.1.0) sha256=ee71d0ccab164c51de146c27b480a68b3631d5b4297b8ffe8eda1c72de87affb
383
+ mail (2.9.0) sha256=6fa6673ecd71c60c2d996260f9ee3dd387d4673b8169b502134659ece6d34941
384
+ marcel (1.1.0) sha256=fdcfcfa33cc52e93c4308d40e4090a5d4ea279e160a7f6af988260fa970e0bee
385
+ mime-types (3.7.0) sha256=dcebf61c246f08e15a4de34e386ebe8233791e868564a470c3fe77c00eed5e56
386
+ mime-types-data (3.2025.0924) sha256=f276bca15e59f35767cbcf2bc10e023e9200b30bd6a572c1daf7f4cc24994728
387
+ mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
388
+ mini_portile2 (2.8.9) sha256=0cd7c7f824e010c072e33f68bc02d85a00aeb6fce05bb4819c03dfd3c140c289
389
+ minitest (5.26.2) sha256=f021118a6185b9ba9f5af71f2ba103ad770c75afde9f2ab8da512677c550cde3
390
+ multipart-post (2.4.1) sha256=9872d03a8e552020ca096adadbf5e3cb1cd1cdd6acd3c161136b8a5737cdb4a8
391
+ neighbor (0.6.0) sha256=e2bd0bb98e1d6403892d1d0cf3683ae9429be51d6a6a14859135dc71cf9c27d3
392
+ net-http (0.8.0) sha256=df42c47ce9f9e95ad32a317c97c12f945bc1af365288837ea4ff259876ecb46d
393
+ net-imap (0.5.12) sha256=cb8cd05bd353fcc19b6cbc530a9cb06b577a969ea10b7ddb0f37787f74be4444
394
+ net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3
395
+ net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8
396
+ net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736
397
+ nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1
398
+ nokogiri (1.18.10) sha256=d5cc0731008aa3b3a87b361203ea3d19b2069628cb55e46ac7d84a0445e69cc1
399
+ pg (1.6.2) sha256=58614afd405cc9c2c9e15bffe8432e0d6cfc58b722344ad4a47c73a85189c875
400
+ pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
401
+ prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
402
+ propshaft (1.3.1) sha256=9acc664ef67e819ffa3d95bd7ad4c3623ea799110c5f4dee67fa7e583e74c392
403
+ psych (5.2.6) sha256=814328aa5dcb6d604d32126a20bc1cbcf05521a5b49dbb1a8b30a07e580f316e
404
+ public_suffix (7.0.0) sha256=f7090b5beb0e56f9f10d79eed4d5fbe551b3b425da65877e075dad47a6a1b095
405
+ puma (6.6.1) sha256=b9b56e4a4ea75d1bfa6d9e1972ee2c9f43d0883f011826d914e8e37b3694ea1e
406
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
407
+ rack (3.2.4) sha256=5d74b6f75082a643f43c1e76b419c40f0e5527fcfee1e669ac1e6b73c0ccb6f6
408
+ rack-session (2.1.1) sha256=0b6dc07dea7e4b583f58a48e8b806d4c9f1c6c9214ebc202ec94562cbea2e4e9
409
+ rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463
410
+ rackup (2.3.1) sha256=6c79c26753778e90983761d677a48937ee3192b3ffef6bc963c0950f94688868
411
+ rails (7.2.3) sha256=9a9812eb131189676e64665f6883fc9c4051f412cc87ef9e3fa242a09c609bff
412
+ rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d
413
+ rails-html-sanitizer (1.6.2) sha256=35fce2ca8242da8775c83b6ba9c1bcaad6751d9eb73c1abaa8403475ab89a560
414
+ railties (7.2.3) sha256=6eb010a6bfe6f223e783f739ddfcbdb5b88b1f3a87f7739f0a0685e466250422
415
+ rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
416
+ rake-compiler-dock (1.10.0) sha256=dd62ee19df2a185a3315697e560cfa8cc9129901332152851e023fab0e94bf11
417
+ rb_sys (0.9.119) sha256=64393fa148e402e1b79b64496d2aabfc7df79da6b822b8bb48dc1141eaf40b4b
418
+ rdoc (6.16.1) sha256=71357cc208e6da77ba0c4494e01ae870dd18b437c7c7d801dd73ee2f340b9f5c
419
+ reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
420
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
421
+ ruby_llm (1.9.1) sha256=f7d3c72489c70041ee73d7bfe4250a989f801fbba1fad2200904091e433ba511
422
+ ruby_llm-schema (0.2.5) sha256=b08cd42e8de7100325e2e868672a56f1915eb23692bb808f51f214e41392104f
423
+ securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
424
+ stringio (3.1.9) sha256=c111af13d3a73eab96a3bc2655ecf93788d13d28cb8e25c1dcbff89ace885121
425
+ thor (1.4.0) sha256=8763e822ccb0f1d7bee88cde131b19a65606657b847cc7b7b4b82e772bcd8a3d
426
+ tiktoken_ruby (0.0.13) sha256=24586eeb6644f27b98a9d54de5ec581ab6d9eea16fc0871a4d9fbe03b6725455
427
+ timeout (0.4.4) sha256=f0f6f970104b82427cd990680f539b6bbb8b1e55efa913a55c6492935e4e0edb
428
+ tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
429
+ tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
430
+ uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
431
+ useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
432
+ web-console (4.2.1) sha256=e7bcf37a10ea2b4ec4281649d1cee461b32232d0a447e82c786e6841fd22fe20
433
+ websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
434
+ websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
435
+ zeitwerk (2.7.3) sha256=b2e86b4a9b57d26ba68a15230dcc7fe6f040f06831ce64417b0621ad96ba3e85
436
+
437
+ BUNDLED WITH
438
+ 4.0.0
@@ -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_DBURL="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
+ }