htm 0.0.17 → 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 (80) 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 -25
  6. data/.irbrc +7 -7
  7. data/.tbls.yml +2 -2
  8. data/CHANGELOG.md +71 -0
  9. data/README.md +1 -1
  10. data/Rakefile +8 -3
  11. data/SETUP.md +12 -12
  12. data/bin/htm_mcp +0 -4
  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 +20 -20
  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 +17 -17
  33. data/docs/guides/robot-groups.md +8 -8
  34. data/docs/index.md +4 -4
  35. data/docs/multi_framework_support.md +8 -8
  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 +5 -5
  51. data/examples/rails_app/Gemfile.lock +48 -56
  52. data/examples/rails_app/README.md +1 -1
  53. data/examples/robot_groups/multi_process.rb +5 -5
  54. data/examples/robot_groups/robot_worker.rb +5 -5
  55. data/examples/robot_groups/same_process.rb +9 -9
  56. data/examples/sinatra_app/app.rb +1 -1
  57. data/examples/timeframe_demo.rb +1 -1
  58. data/lib/htm/active_record_config.rb +12 -25
  59. data/lib/htm/circuit_breaker.rb +0 -2
  60. data/lib/htm/config/defaults.yml +246 -0
  61. data/lib/htm/config.rb +888 -0
  62. data/lib/htm/database.rb +23 -27
  63. data/lib/htm/embedding_service.rb +0 -4
  64. data/lib/htm/integrations/sinatra.rb +3 -7
  65. data/lib/htm/job_adapter.rb +1 -15
  66. data/lib/htm/jobs/generate_embedding_job.rb +1 -7
  67. data/lib/htm/jobs/generate_propositions_job.rb +2 -12
  68. data/lib/htm/jobs/generate_tags_job.rb +1 -8
  69. data/lib/htm/loaders/defaults_loader.rb +143 -0
  70. data/lib/htm/loaders/xdg_config_loader.rb +116 -0
  71. data/lib/htm/mcp/cli.rb +200 -58
  72. data/lib/htm/mcp/server.rb +3 -3
  73. data/lib/htm/proposition_service.rb +2 -12
  74. data/lib/htm/railtie.rb +3 -4
  75. data/lib/htm/tag_service.rb +1 -8
  76. data/lib/htm/version.rb +1 -1
  77. data/lib/htm.rb +124 -5
  78. metadata +24 -4
  79. data/config/database.yml +0 -77
  80. data/lib/htm/configuration.rb +0 -799
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -149,6 +149,20 @@ dependencies:
149
149
  - - ">="
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
+ - !ruby/object:Gem::Dependency
153
+ name: anyway_config
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '2.6'
159
+ type: :runtime
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '2.6'
152
166
  - !ruby/object:Gem::Dependency
153
167
  name: rake
154
168
  requirement: !ruby/object:Gem::Requirement
@@ -291,7 +305,6 @@ files:
291
305
  - Rakefile
292
306
  - SETUP.md
293
307
  - bin/htm_mcp
294
- - config/database.yml
295
308
  - db/migrate/00001_enable_extensions.rb
296
309
  - db/migrate/00002_create_robots.rb
297
310
  - db/migrate/00003_create_file_sources.rb
@@ -454,6 +467,10 @@ files:
454
467
  - examples/basic_usage.rb
455
468
  - examples/cli_app/README.md
456
469
  - examples/cli_app/htm_cli.rb
470
+ - examples/config_file_example/README.md
471
+ - examples/config_file_example/config/htm.local.yml
472
+ - examples/config_file_example/custom_config.yml
473
+ - examples/config_file_example/show_config.rb
457
474
  - examples/custom_llm_configuration.rb
458
475
  - examples/example_app/Rakefile
459
476
  - examples/example_app/app.rb
@@ -523,7 +540,8 @@ files:
523
540
  - lib/htm.rb
524
541
  - lib/htm/active_record_config.rb
525
542
  - lib/htm/circuit_breaker.rb
526
- - lib/htm/configuration.rb
543
+ - lib/htm/config.rb
544
+ - lib/htm/config/defaults.yml
527
545
  - lib/htm/database.rb
528
546
  - lib/htm/embedding_service.rb
529
547
  - lib/htm/errors.rb
@@ -532,8 +550,10 @@ files:
532
550
  - lib/htm/jobs/generate_embedding_job.rb
533
551
  - lib/htm/jobs/generate_propositions_job.rb
534
552
  - lib/htm/jobs/generate_tags_job.rb
553
+ - lib/htm/loaders/defaults_loader.rb
535
554
  - lib/htm/loaders/markdown_chunker.rb
536
555
  - lib/htm/loaders/markdown_loader.rb
556
+ - lib/htm/loaders/xdg_config_loader.rb
537
557
  - lib/htm/long_term_memory.rb
538
558
  - lib/htm/long_term_memory/fulltext_search.rb
539
559
  - lib/htm/long_term_memory/hybrid_search.rb
@@ -596,7 +616,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
596
616
  - !ruby/object:Gem::Version
597
617
  version: '0'
598
618
  requirements: []
599
- rubygems_version: 4.0.1
619
+ rubygems_version: 4.0.2
600
620
  specification_version: 4
601
621
  summary: Hierarchical Temporal Memory for LLM robots
602
622
  test_files: []
data/config/database.yml DELETED
@@ -1,77 +0,0 @@
1
- # HTM Database Configuration
2
- # Uses ERB to read from environment variables
3
- #
4
- # Priority:
5
- # 1. HTM_DBURL - Full connection URL (preferred for development/production)
6
- # 2. Individual HTM_DB* variables - Host, name, user, password, port
7
- # 3. Defaults for development/test
8
- #
9
- # Example HTM_DBURL format:
10
- # postgresql://user:password@host:port/database?sslmode=require
11
- #
12
- # Environment detection priority:
13
- # HTM_ENV > RAILS_ENV > RACK_ENV > 'development'
14
- #
15
- # Test database:
16
- # Tests always use htm_test database.
17
- # Set HTM_ENV=test (or RAILS_ENV=test) to use the test configuration.
18
-
19
- <%
20
- require 'uri'
21
-
22
- # Determine current environment (HTM_ENV takes priority for non-Rails users)
23
- current_env = ENV['HTM_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
24
-
25
- # Parse connection from HTM_DBURL or use individual variables
26
- if ENV['HTM_DBURL']
27
- uri = URI.parse(ENV['HTM_DBURL'])
28
- params = URI.decode_www_form(uri.query || '').to_h
29
- base_database = uri.path[1..-1]
30
-
31
- # Extract base name (remove _development, _test, _production suffixes if present)
32
- base_name = base_database.sub(/_(development|test|production)$/, '')
33
-
34
- db_config = {
35
- 'host' => uri.host,
36
- 'port' => uri.port || 5432,
37
- 'base_name' => base_name,
38
- 'username' => uri.user,
39
- 'password' => uri.password,
40
- 'sslmode' => params['sslmode'] || 'prefer'
41
- }
42
- else
43
- db_config = {
44
- 'host' => ENV.fetch('HTM_DBHOST', 'localhost'),
45
- 'port' => ENV.fetch('HTM_DBPORT', 5432).to_i,
46
- 'base_name' => ENV.fetch('HTM_DBNAME', 'htm').sub(/_(development|test|production)$/, ''),
47
- 'username' => ENV.fetch('HTM_DBUSER', ENV['USER']),
48
- 'password' => ENV.fetch('HTM_DBPASS', ''),
49
- 'sslmode' => ENV.fetch('HTM_SSLMODE', 'prefer')
50
- }
51
- end
52
- %>
53
-
54
- default: &default
55
- adapter: postgresql
56
- encoding: unicode
57
- pool: <%= ENV.fetch("HTM_DB_POOL_SIZE", "10").to_i %>
58
- timeout: 5000
59
- prepared_statements: false
60
- advisory_locks: false
61
- host: <%= db_config['host'] %>
62
- port: <%= db_config['port'] %>
63
- username: <%= db_config['username'] %>
64
- password: <%= db_config['password'] %>
65
- sslmode: <%= db_config['sslmode'] %>
66
-
67
- development:
68
- <<: *default
69
- database: <%= db_config['base_name'] %>_development
70
-
71
- test:
72
- <<: *default
73
- database: <%= db_config['base_name'] %>_test
74
-
75
- production:
76
- <<: *default
77
- database: <%= db_config['base_name'] %>_production