htm 0.0.17 → 0.0.20

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 (130) 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 +130 -1
  9. data/README.md +13 -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 +3 -3
  15. data/docs/api/database.md +37 -37
  16. data/docs/api/embedding-service.md +140 -110
  17. data/docs/api/htm.md +1 -1
  18. data/docs/api/yard/HTM/ActiveRecordConfig.md +8 -2
  19. data/docs/api/yard/HTM/Config.md +173 -0
  20. data/docs/api/yard/HTM/ConfigSection.md +28 -0
  21. data/docs/api/yard/HTM/Database.md +7 -8
  22. data/docs/api/yard/HTM/JobAdapter.md +1 -1
  23. data/docs/api/yard/HTM.md +0 -57
  24. data/docs/api/yard/index.csv +76 -61
  25. data/docs/api/yard-reference.md +2 -1
  26. data/docs/architecture/adrs/001-postgresql-timescaledb.md +1 -1
  27. data/docs/architecture/adrs/003-ollama-embeddings.md +45 -36
  28. data/docs/architecture/adrs/004-hive-mind.md +1 -1
  29. data/docs/architecture/adrs/008-robot-identification.md +1 -1
  30. data/docs/architecture/adrs/011-pgai-integration.md +4 -4
  31. data/docs/architecture/index.md +11 -9
  32. data/docs/architecture/overview.md +11 -7
  33. data/docs/assets/images/balanced-strategy-decay.svg +41 -0
  34. data/docs/assets/images/class-hierarchy.svg +1 -1
  35. data/docs/assets/images/eviction-priority.svg +43 -0
  36. data/docs/assets/images/exception-hierarchy.svg +2 -2
  37. data/docs/assets/images/hive-mind-shared-memory.svg +52 -0
  38. data/docs/assets/images/htm-architecture-overview.svg +3 -3
  39. data/docs/assets/images/htm-core-components.svg +4 -4
  40. data/docs/assets/images/htm-layered-architecture.svg +1 -1
  41. data/docs/assets/images/htm-memory-addition-flow.svg +2 -2
  42. data/docs/assets/images/htm-memory-recall-flow.svg +2 -2
  43. data/docs/assets/images/memory-topology.svg +53 -0
  44. data/docs/assets/images/two-tier-memory-architecture.svg +55 -0
  45. data/docs/database_rake_tasks.md +5 -5
  46. data/docs/development/rake-tasks.md +11 -11
  47. data/docs/development/setup.md +97 -65
  48. data/docs/development/testing.md +1 -1
  49. data/docs/examples/basic-usage.md +133 -0
  50. data/docs/examples/config-files.md +170 -0
  51. data/docs/examples/file-loading.md +208 -0
  52. data/docs/examples/index.md +116 -0
  53. data/docs/examples/llm-configuration.md +168 -0
  54. data/docs/examples/mcp-client.md +172 -0
  55. data/docs/examples/rails-integration.md +173 -0
  56. data/docs/examples/robot-groups.md +210 -0
  57. data/docs/examples/sinatra-integration.md +218 -0
  58. data/docs/examples/standalone-app.md +216 -0
  59. data/docs/examples/telemetry.md +224 -0
  60. data/docs/examples/timeframes.md +143 -0
  61. data/docs/getting-started/installation.md +117 -60
  62. data/docs/getting-started/quick-start.md +35 -18
  63. data/docs/guides/configuration.md +515 -0
  64. data/docs/guides/file-loading.md +322 -0
  65. data/docs/guides/getting-started.md +42 -11
  66. data/docs/guides/index.md +3 -3
  67. data/docs/guides/long-term-memory.md +1 -1
  68. data/docs/guides/mcp-server.md +47 -29
  69. data/docs/guides/propositions.md +264 -0
  70. data/docs/guides/recalling-memories.md +4 -4
  71. data/docs/guides/search-strategies.md +3 -3
  72. data/docs/guides/tags.md +318 -0
  73. data/docs/guides/telemetry.md +229 -0
  74. data/docs/index.md +10 -18
  75. data/docs/multi_framework_support.md +8 -8
  76. data/docs/{architecture → robots}/hive-mind.md +8 -111
  77. data/docs/robots/index.md +73 -0
  78. data/docs/{guides → robots}/multi-robot.md +3 -3
  79. data/docs/{guides → robots}/robot-groups.md +14 -13
  80. data/docs/{architecture → robots}/two-tier-memory.md +13 -149
  81. data/docs/robots/why-robots.md +85 -0
  82. data/docs/setup_local_database.md +19 -19
  83. data/docs/using_rake_tasks_in_your_app.md +14 -14
  84. data/examples/README.md +50 -6
  85. data/examples/basic_usage.rb +31 -21
  86. data/examples/cli_app/README.md +8 -8
  87. data/examples/cli_app/htm_cli.rb +5 -5
  88. data/examples/config_file_example/README.md +256 -0
  89. data/examples/config_file_example/config/htm.local.yml +34 -0
  90. data/examples/config_file_example/custom_config.yml +22 -0
  91. data/examples/config_file_example/show_config.rb +125 -0
  92. data/examples/custom_llm_configuration.rb +7 -7
  93. data/examples/example_app/Rakefile +2 -2
  94. data/examples/example_app/app.rb +8 -8
  95. data/examples/file_loader_usage.rb +9 -9
  96. data/examples/mcp_client.rb +5 -5
  97. data/examples/rails_app/Gemfile.lock +48 -56
  98. data/examples/rails_app/README.md +1 -1
  99. data/examples/robot_groups/multi_process.rb +5 -5
  100. data/examples/robot_groups/robot_worker.rb +5 -5
  101. data/examples/robot_groups/same_process.rb +9 -9
  102. data/examples/sinatra_app/app.rb +1 -1
  103. data/examples/timeframe_demo.rb +1 -1
  104. data/lib/htm/active_record_config.rb +12 -25
  105. data/lib/htm/circuit_breaker.rb +0 -2
  106. data/lib/htm/config/defaults.yml +246 -0
  107. data/lib/htm/config.rb +888 -0
  108. data/lib/htm/database.rb +23 -27
  109. data/lib/htm/embedding_service.rb +0 -4
  110. data/lib/htm/integrations/sinatra.rb +3 -7
  111. data/lib/htm/job_adapter.rb +76 -16
  112. data/lib/htm/jobs/generate_embedding_job.rb +1 -7
  113. data/lib/htm/jobs/generate_propositions_job.rb +2 -12
  114. data/lib/htm/jobs/generate_tags_job.rb +1 -8
  115. data/lib/htm/loaders/defaults_loader.rb +143 -0
  116. data/lib/htm/loaders/xdg_config_loader.rb +116 -0
  117. data/lib/htm/mcp/cli.rb +200 -58
  118. data/lib/htm/mcp/server.rb +3 -3
  119. data/lib/htm/proposition_service.rb +2 -12
  120. data/lib/htm/railtie.rb +3 -4
  121. data/lib/htm/tag_service.rb +1 -8
  122. data/lib/htm/version.rb +1 -1
  123. data/lib/htm/workflows/remember_workflow.rb +212 -0
  124. data/lib/htm.rb +125 -5
  125. data/mkdocs.yml +33 -8
  126. metadata +83 -10
  127. data/config/database.yml +0 -77
  128. data/docs/api/yard/HTM/Configuration.md +0 -229
  129. data/docs/telemetry.md +0 -391
  130. data/lib/htm/configuration.rb +0 -799
data/lib/htm.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "htm/version"
4
4
  require_relative "htm/errors"
5
- require_relative "htm/configuration"
5
+ require_relative "htm/config"
6
6
  require_relative "htm/circuit_breaker"
7
7
  require_relative "htm/active_record_config"
8
8
  require_relative "htm/database"
@@ -19,6 +19,7 @@ require_relative "htm/jobs/generate_tags_job"
19
19
  require_relative "htm/jobs/generate_propositions_job"
20
20
  require_relative "htm/loaders/markdown_chunker"
21
21
  require_relative "htm/loaders/markdown_loader"
22
+ require_relative "htm/workflows/remember_workflow"
22
23
  require_relative "htm/observability"
23
24
  require_relative "htm/telemetry"
24
25
  require_relative "htm/working_memory_channel"
@@ -70,7 +71,7 @@ class HTM
70
71
  #
71
72
  # @param working_memory_size [Integer] Maximum tokens for working memory (default: 128,000)
72
73
  # @param robot_name [String] Human-readable name for this robot (auto-generated if not provided)
73
- # @param db_config [Hash] Database configuration (uses ENV['HTM_DBURL'] if not provided)
74
+ # @param db_config [Hash] Database configuration (uses ENV['HTM_DATABASE__URL'] if not provided)
74
75
  # @param db_pool_size [Integer] Database connection pool size (default: 5)
75
76
  # @param db_query_timeout [Integer] Database query timeout in milliseconds (default: 30000)
76
77
  # @param db_cache_size [Integer] Number of database query results to cache (default: 1000, use 0 to disable)
@@ -170,7 +171,7 @@ class HTM
170
171
  enqueue_tags_job(node_id, manual_tags: tags)
171
172
 
172
173
  # Enqueue proposition extraction if enabled and not already a proposition
173
- if HTM.configuration.extract_propositions && !metadata[:is_proposition]
174
+ if HTM.config.extract_propositions && !metadata[:is_proposition]
174
175
  enqueue_propositions_job(node_id)
175
176
  end
176
177
  else
@@ -251,7 +252,6 @@ class HTM
251
252
  normalized_timeframe = if timeframe == :auto
252
253
  result = HTM::Timeframe.normalize(:auto, query: topic)
253
254
  search_query = result.query # Use cleaned query for search
254
- HTM.logger.debug "Auto-extracted timeframe: #{result.extracted.inspect}" if result.extracted
255
255
  result.timeframe
256
256
  else
257
257
  HTM::Timeframe.normalize(timeframe)
@@ -595,7 +595,6 @@ class HTM
595
595
  tag = HTM::Models::Tag.find_or_create_by!(name: tag_name)
596
596
  HTM::Models::NodeTag.find_or_create_by!(node_id: node_id, tag_id: tag.id)
597
597
  end
598
- HTM.logger.debug "Added #{manual_tags.length} manual tags to node #{node_id}"
599
598
  end
600
599
 
601
600
  # Enqueue tag generation using configured job backend
@@ -679,4 +678,125 @@ class HTM
679
678
  end
680
679
  end
681
680
 
681
+ # ===========================================================================
682
+ # Class Methods
683
+ # ===========================================================================
684
+
685
+ class << self
686
+ # Get current configuration (singleton)
687
+ #
688
+ # @return [HTM::Config]
689
+ #
690
+ def config
691
+ @config ||= Config.new
692
+ end
693
+
694
+ # Alias for backward compatibility
695
+ alias configuration config
696
+
697
+ # Configure HTM
698
+ #
699
+ # @yield [config] Configuration object
700
+ # @yieldparam config [HTM::Config]
701
+ #
702
+ # @example Custom configuration
703
+ # HTM.configure do |config|
704
+ # config.embedding_generator = ->(text) { MyEmbedder.embed(text) }
705
+ # config.tag_extractor = ->(text, ontology) { MyTagger.extract(text, ontology) }
706
+ # end
707
+ #
708
+ # @example Default configuration
709
+ # HTM.configure # Uses RubyLLM defaults
710
+ #
711
+ def configure
712
+ yield(config) if block_given?
713
+ config.validate!
714
+ config
715
+ end
716
+
717
+ # Reset configuration to defaults
718
+ def reset_configuration!
719
+ @config = nil
720
+ end
721
+
722
+ # Get current environment
723
+ #
724
+ # @return [String] Current environment name
725
+ #
726
+ def env
727
+ Config.env
728
+ end
729
+
730
+ # Check if running in test environment
731
+ #
732
+ # @return [Boolean]
733
+ #
734
+ def test?
735
+ env == 'test'
736
+ end
737
+
738
+ # Check if running in development environment
739
+ #
740
+ # @return [Boolean]
741
+ #
742
+ def development?
743
+ env == 'development'
744
+ end
745
+
746
+ # Check if running in production environment
747
+ #
748
+ # @return [Boolean]
749
+ #
750
+ def production?
751
+ env == 'production'
752
+ end
753
+
754
+ # Generate embedding using EmbeddingService
755
+ #
756
+ # @param text [String] Text to embed
757
+ # @return [Array<Float>] Embedding vector (original, not padded)
758
+ #
759
+ def embed(text)
760
+ result = HTM::EmbeddingService.generate(text)
761
+ result[:embedding]
762
+ end
763
+
764
+ # Extract tags using TagService
765
+ #
766
+ # @param text [String] Text to analyze
767
+ # @param existing_ontology [Array<String>] Sample of existing tags for context
768
+ # @return [Array<String>] Extracted and validated tag names
769
+ #
770
+ def extract_tags(text, existing_ontology: [])
771
+ HTM::TagService.extract(text, existing_ontology: existing_ontology)
772
+ end
773
+
774
+ # Extract propositions using PropositionService
775
+ #
776
+ # @param text [String] Text to analyze
777
+ # @return [Array<String>] Extracted atomic propositions
778
+ #
779
+ def extract_propositions(text)
780
+ HTM::PropositionService.extract(text)
781
+ end
782
+
783
+ # Count tokens using configured counter
784
+ #
785
+ # @param text [String] Text to count tokens for
786
+ # @return [Integer] Token count
787
+ #
788
+ def count_tokens(text)
789
+ config.token_counter.call(text)
790
+ rescue StandardError => e
791
+ raise HTM::ValidationError, "Token counting failed: #{e.message}"
792
+ end
793
+
794
+ # Get configured logger
795
+ #
796
+ # @return [Logger] Configured logger instance
797
+ #
798
+ def logger
799
+ config.logger
800
+ end
801
+ end
682
802
  end
data/mkdocs.yml CHANGED
@@ -48,7 +48,6 @@ theme:
48
48
  - navigation.tracking
49
49
  - navigation.tabs
50
50
  - navigation.tabs.sticky
51
- - navigation.sections
52
51
  - navigation.path
53
52
  - navigation.indexes
54
53
  - navigation.top
@@ -166,7 +165,38 @@ extra:
166
165
 
167
166
  # Navigation
168
167
  nav:
169
- - Home: index.md
168
+ - Home:
169
+ - Overview: index.md
170
+ - MCP (htm_mcp):
171
+ - Server (htm_mcp): guides/mcp-server.md
172
+ - Example Usage: examples/mcp-client.md
173
+ - Robots!:
174
+ - robots/index.md
175
+ - Why "Robots"?: robots/why-robots.md
176
+ - Hive Mind: robots/hive-mind.md
177
+ - Two-Tier Memory: robots/two-tier-memory.md
178
+ - Multi-Robot Systems: robots/multi-robot.md
179
+ - Robot Groups: robots/robot-groups.md
180
+ - Additional Features:
181
+ - Configuration: guides/configuration.md
182
+ - Hierarchical Tags: guides/tags.md
183
+ - Propositions: guides/propositions.md
184
+ - File Loading: guides/file-loading.md
185
+ - Telemetry: guides/telemetry.md
186
+ - Search Strategies: guides/search-strategies.md
187
+ - Examples:
188
+ - examples/index.md
189
+ - Basic Usage: examples/basic-usage.md
190
+ - Standalone App: examples/standalone-app.md
191
+ - LLM Configuration: examples/llm-configuration.md
192
+ - Config Files: examples/config-files.md
193
+ - File Loading: examples/file-loading.md
194
+ - Timeframes: examples/timeframes.md
195
+ - Robot Groups: examples/robot-groups.md
196
+ - Telemetry: examples/telemetry.md
197
+ - Framework Integration:
198
+ - Rails App: examples/rails-integration.md
199
+ - Sinatra App: examples/sinatra-integration.md
170
200
  - Getting Started:
171
201
  - getting-started/index.md
172
202
  - Installation: getting-started/installation.md
@@ -174,8 +204,6 @@ nav:
174
204
  - Architecture:
175
205
  - architecture/index.md
176
206
  - Overview: architecture/overview.md
177
- - Two-Tier Memory: architecture/two-tier-memory.md
178
- - Hive Mind: architecture/hive-mind.md
179
207
  - ADRs:
180
208
  - architecture/adrs/index.md
181
209
  - ADR-001 PostgreSQL & TimescaleDB: architecture/adrs/001-postgresql-timescaledb.md
@@ -196,10 +224,7 @@ nav:
196
224
  - Recalling Memories: guides/recalling-memories.md
197
225
  - Working Memory: guides/working-memory.md
198
226
  - Long-Term Memory: guides/long-term-memory.md
199
- - Multi-Robot Usage: guides/multi-robot.md
200
- - Search Strategies: guides/search-strategies.md
201
227
  - Context Assembly: guides/context-assembly.md
202
- - MCP Server: guides/mcp-server.md
203
228
  - API Reference:
204
229
  - api/index.md
205
230
  - HTM Class: api/htm.md
@@ -211,7 +236,7 @@ nav:
211
236
  - api/yard-reference.md
212
237
  - HTM Module: api/yard/HTM.md
213
238
  - Core Classes:
214
- - Configuration: api/yard/HTM/Configuration.md
239
+ - Configuration: api/yard/HTM/Config.md
215
240
  - Database: api/yard/HTM/Database.md
216
241
  - LongTermMemory: api/yard/HTM/LongTermMemory.md
217
242
  - WorkingMemory: api/yard/HTM/WorkingMemory.md
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.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -149,6 +149,48 @@ 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'
166
+ - !ruby/object:Gem::Dependency
167
+ name: simple_flow
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ type: :runtime
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ - !ruby/object:Gem::Dependency
181
+ name: async
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '2.0'
187
+ type: :runtime
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: '2.0'
152
194
  - !ruby/object:Gem::Dependency
153
195
  name: rake
154
196
  requirement: !ruby/object:Gem::Requirement
@@ -291,7 +333,6 @@ files:
291
333
  - Rakefile
292
334
  - SETUP.md
293
335
  - bin/htm_mcp
294
- - config/database.yml
295
336
  - db/migrate/00001_enable_extensions.rb
296
337
  - db/migrate/00002_create_robots.rb
297
338
  - db/migrate/00003_create_file_sources.rb
@@ -316,7 +357,8 @@ files:
316
357
  - docs/api/yard/HTM/AuthorizationError.md
317
358
  - docs/api/yard/HTM/CircuitBreaker.md
318
359
  - docs/api/yard/HTM/CircuitBreakerOpenError.md
319
- - docs/api/yard/HTM/Configuration.md
360
+ - docs/api/yard/HTM/Config.md
361
+ - docs/api/yard/HTM/ConfigSection.md
320
362
  - docs/api/yard/HTM/Database.md
321
363
  - docs/api/yard/HTM/DatabaseError.md
322
364
  - docs/api/yard/HTM/EmbeddingError.md
@@ -359,16 +401,17 @@ files:
359
401
  - docs/architecture/adrs/010-redis-working-memory-rejected.md
360
402
  - docs/architecture/adrs/011-pgai-integration.md
361
403
  - docs/architecture/adrs/index.md
362
- - docs/architecture/hive-mind.md
363
404
  - docs/architecture/index.md
364
405
  - docs/architecture/overview.md
365
- - docs/architecture/two-tier-memory.md
366
406
  - docs/assets/css/custom.css
367
407
  - docs/assets/images/adr-010-current-architecture.svg
368
408
  - docs/assets/images/adr-010-proposed-architecture.svg
369
409
  - docs/assets/images/adr-dependency-tree.svg
410
+ - docs/assets/images/balanced-strategy-decay.svg
370
411
  - docs/assets/images/class-hierarchy.svg
412
+ - docs/assets/images/eviction-priority.svg
371
413
  - docs/assets/images/exception-hierarchy.svg
414
+ - docs/assets/images/hive-mind-shared-memory.svg
372
415
  - docs/assets/images/htm-architecture-overview.svg
373
416
  - docs/assets/images/htm-complete-memory-flow.svg
374
417
  - docs/assets/images/htm-context-assembly-flow.svg
@@ -385,10 +428,12 @@ files:
385
428
  - docs/assets/images/htm-working-memory-architecture.svg
386
429
  - docs/assets/images/htm.jpg
387
430
  - docs/assets/images/htm_demo.gif
431
+ - docs/assets/images/memory-topology.svg
388
432
  - docs/assets/images/multi-provider-failover.svg
389
433
  - docs/assets/images/project-structure.svg
390
434
  - docs/assets/images/robot-group-architecture.svg
391
435
  - docs/assets/images/test-directory-structure.svg
436
+ - docs/assets/images/two-tier-memory-architecture.svg
392
437
  - docs/assets/js/mathjax.js
393
438
  - docs/assets/videos/htm_video.mp4
394
439
  - docs/database/README.md
@@ -429,31 +474,55 @@ files:
429
474
  - docs/development/schema.md
430
475
  - docs/development/setup.md
431
476
  - docs/development/testing.md
477
+ - docs/examples/basic-usage.md
478
+ - docs/examples/config-files.md
479
+ - docs/examples/file-loading.md
480
+ - docs/examples/index.md
481
+ - docs/examples/llm-configuration.md
482
+ - docs/examples/mcp-client.md
483
+ - docs/examples/rails-integration.md
484
+ - docs/examples/robot-groups.md
485
+ - docs/examples/sinatra-integration.md
486
+ - docs/examples/standalone-app.md
487
+ - docs/examples/telemetry.md
488
+ - docs/examples/timeframes.md
432
489
  - docs/getting-started/index.md
433
490
  - docs/getting-started/installation.md
434
491
  - docs/getting-started/quick-start.md
435
492
  - docs/guides/adding-memories.md
493
+ - docs/guides/configuration.md
436
494
  - docs/guides/context-assembly.md
495
+ - docs/guides/file-loading.md
437
496
  - docs/guides/getting-started.md
438
497
  - docs/guides/index.md
439
498
  - docs/guides/long-term-memory.md
440
499
  - docs/guides/mcp-server.md
441
- - docs/guides/multi-robot.md
500
+ - docs/guides/propositions.md
442
501
  - docs/guides/recalling-memories.md
443
- - docs/guides/robot-groups.md
444
502
  - docs/guides/search-strategies.md
503
+ - docs/guides/tags.md
504
+ - docs/guides/telemetry.md
445
505
  - docs/guides/working-memory.md
446
506
  - docs/images/htm-er-diagram.svg
447
507
  - docs/images/telemetry-architecture.svg
448
508
  - docs/index.md
449
509
  - docs/multi_framework_support.md
510
+ - docs/robots/hive-mind.md
511
+ - docs/robots/index.md
512
+ - docs/robots/multi-robot.md
513
+ - docs/robots/robot-groups.md
514
+ - docs/robots/two-tier-memory.md
515
+ - docs/robots/why-robots.md
450
516
  - docs/setup_local_database.md
451
- - docs/telemetry.md
452
517
  - docs/using_rake_tasks_in_your_app.md
453
518
  - examples/README.md
454
519
  - examples/basic_usage.rb
455
520
  - examples/cli_app/README.md
456
521
  - examples/cli_app/htm_cli.rb
522
+ - examples/config_file_example/README.md
523
+ - examples/config_file_example/config/htm.local.yml
524
+ - examples/config_file_example/custom_config.yml
525
+ - examples/config_file_example/show_config.rb
457
526
  - examples/custom_llm_configuration.rb
458
527
  - examples/example_app/Rakefile
459
528
  - examples/example_app/app.rb
@@ -523,7 +592,8 @@ files:
523
592
  - lib/htm.rb
524
593
  - lib/htm/active_record_config.rb
525
594
  - lib/htm/circuit_breaker.rb
526
- - lib/htm/configuration.rb
595
+ - lib/htm/config.rb
596
+ - lib/htm/config/defaults.yml
527
597
  - lib/htm/database.rb
528
598
  - lib/htm/embedding_service.rb
529
599
  - lib/htm/errors.rb
@@ -532,8 +602,10 @@ files:
532
602
  - lib/htm/jobs/generate_embedding_job.rb
533
603
  - lib/htm/jobs/generate_propositions_job.rb
534
604
  - lib/htm/jobs/generate_tags_job.rb
605
+ - lib/htm/loaders/defaults_loader.rb
535
606
  - lib/htm/loaders/markdown_chunker.rb
536
607
  - lib/htm/loaders/markdown_loader.rb
608
+ - lib/htm/loaders/xdg_config_loader.rb
537
609
  - lib/htm/long_term_memory.rb
538
610
  - lib/htm/long_term_memory/fulltext_search.rb
539
611
  - lib/htm/long_term_memory/hybrid_search.rb
@@ -565,6 +637,7 @@ files:
565
637
  - lib/htm/timeframe.rb
566
638
  - lib/htm/timeframe_extractor.rb
567
639
  - lib/htm/version.rb
640
+ - lib/htm/workflows/remember_workflow.rb
568
641
  - lib/htm/working_memory.rb
569
642
  - lib/htm/working_memory_channel.rb
570
643
  - lib/tasks/db.rake
@@ -596,7 +669,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
596
669
  - !ruby/object:Gem::Version
597
670
  version: '0'
598
671
  requirements: []
599
- rubygems_version: 4.0.1
672
+ rubygems_version: 4.0.2
600
673
  specification_version: 4
601
674
  summary: Hierarchical Temporal Memory for LLM robots
602
675
  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