htm 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/.envrc +1 -0
- data/.tbls.yml +30 -0
- data/CHANGELOG.md +30 -0
- data/SETUP.md +132 -101
- data/db/migrate/20250125000001_add_content_hash_to_nodes.rb +14 -0
- data/db/migrate/20250125000002_create_robot_nodes.rb +35 -0
- data/db/migrate/20250125000003_remove_source_and_robot_id_from_nodes.rb +28 -0
- data/db/migrate/20250126000001_create_working_memories.rb +19 -0
- data/db/migrate/20250126000002_remove_unused_columns.rb +12 -0
- data/db/schema.sql +226 -43
- data/docs/api/database.md +20 -232
- data/docs/api/embedding-service.md +1 -7
- data/docs/api/htm.md +195 -449
- data/docs/api/index.md +1 -7
- data/docs/api/long-term-memory.md +342 -590
- data/docs/architecture/adrs/001-postgresql-timescaledb.md +1 -1
- data/docs/architecture/adrs/003-ollama-embeddings.md +1 -1
- data/docs/architecture/adrs/010-redis-working-memory-rejected.md +2 -27
- data/docs/architecture/adrs/index.md +2 -13
- data/docs/architecture/hive-mind.md +165 -166
- data/docs/architecture/index.md +2 -2
- data/docs/architecture/overview.md +5 -171
- data/docs/architecture/two-tier-memory.md +1 -35
- data/docs/assets/images/adr-010-current-architecture.svg +37 -0
- data/docs/assets/images/adr-010-proposed-architecture.svg +48 -0
- data/docs/assets/images/adr-dependency-tree.svg +93 -0
- data/docs/assets/images/class-hierarchy.svg +55 -0
- data/docs/assets/images/exception-hierarchy.svg +45 -0
- data/docs/assets/images/htm-architecture-overview.svg +83 -0
- data/docs/assets/images/htm-complete-memory-flow.svg +160 -0
- data/docs/assets/images/htm-context-assembly-flow.svg +148 -0
- data/docs/assets/images/htm-eviction-process.svg +141 -0
- data/docs/assets/images/htm-memory-addition-flow.svg +138 -0
- data/docs/assets/images/htm-memory-recall-flow.svg +152 -0
- data/docs/assets/images/htm-node-states.svg +123 -0
- data/docs/assets/images/project-structure.svg +78 -0
- data/docs/assets/images/test-directory-structure.svg +38 -0
- data/{dbdoc → docs/database}/README.md +5 -3
- data/{dbdoc → docs/database}/public.node_tags.md +4 -5
- data/docs/database/public.node_tags.svg +106 -0
- data/{dbdoc → docs/database}/public.nodes.md +3 -8
- data/docs/database/public.nodes.svg +152 -0
- data/docs/database/public.robot_nodes.md +44 -0
- data/docs/database/public.robot_nodes.svg +121 -0
- data/{dbdoc → docs/database}/public.robots.md +1 -2
- data/docs/database/public.robots.svg +106 -0
- data/docs/database/public.working_memories.md +40 -0
- data/docs/database/public.working_memories.svg +112 -0
- data/{dbdoc → docs/database}/schema.json +342 -110
- data/docs/database/schema.svg +223 -0
- data/docs/development/index.md +1 -29
- data/docs/development/schema.md +84 -324
- data/docs/development/testing.md +1 -9
- data/docs/getting-started/index.md +47 -0
- data/docs/{installation.md → getting-started/installation.md} +2 -2
- data/docs/{quick-start.md → getting-started/quick-start.md} +5 -5
- data/docs/guides/adding-memories.md +221 -655
- data/docs/guides/search-strategies.md +85 -51
- data/docs/images/htm-er-diagram.svg +156 -0
- data/docs/index.md +16 -31
- data/docs/multi_framework_support.md +4 -4
- data/examples/basic_usage.rb +18 -16
- data/examples/cli_app/htm_cli.rb +86 -8
- data/examples/custom_llm_configuration.rb +1 -2
- data/examples/example_app/app.rb +11 -14
- data/examples/sinatra_app/Gemfile +1 -0
- data/examples/sinatra_app/Gemfile.lock +166 -0
- data/examples/sinatra_app/app.rb +219 -24
- data/lib/htm/active_record_config.rb +10 -3
- data/lib/htm/configuration.rb +265 -78
- data/lib/htm/{sinatra.rb → integrations/sinatra.rb} +87 -12
- data/lib/htm/job_adapter.rb +10 -3
- data/lib/htm/long_term_memory.rb +220 -57
- data/lib/htm/models/node.rb +36 -7
- data/lib/htm/models/robot.rb +30 -4
- data/lib/htm/models/robot_node.rb +50 -0
- data/lib/htm/models/tag.rb +52 -0
- data/lib/htm/models/working_memory_entry.rb +88 -0
- data/lib/htm/tasks.rb +4 -0
- data/lib/htm/version.rb +1 -1
- data/lib/htm.rb +34 -13
- data/lib/tasks/htm.rake +32 -1
- data/lib/tasks/jobs.rake +7 -3
- data/lib/tasks/tags.rake +34 -0
- data/mkdocs.yml +56 -9
- metadata +61 -31
- data/dbdoc/public.node_tags.svg +0 -112
- data/dbdoc/public.nodes.svg +0 -118
- data/dbdoc/public.robots.svg +0 -90
- data/dbdoc/schema.svg +0 -154
- /data/{dbdoc → docs/database}/public.node_stats.md +0 -0
- /data/{dbdoc → docs/database}/public.node_stats.svg +0 -0
- /data/{dbdoc → docs/database}/public.nodes_tags.md +0 -0
- /data/{dbdoc → docs/database}/public.nodes_tags.svg +0 -0
- /data/{dbdoc → docs/database}/public.ontology_structure.md +0 -0
- /data/{dbdoc → docs/database}/public.ontology_structure.svg +0 -0
- /data/{dbdoc → docs/database}/public.operations_log.md +0 -0
- /data/{dbdoc → docs/database}/public.operations_log.svg +0 -0
- /data/{dbdoc → docs/database}/public.relationships.md +0 -0
- /data/{dbdoc → docs/database}/public.relationships.svg +0 -0
- /data/{dbdoc → docs/database}/public.robot_activity.md +0 -0
- /data/{dbdoc → docs/database}/public.robot_activity.svg +0 -0
- /data/{dbdoc → docs/database}/public.schema_migrations.md +0 -0
- /data/{dbdoc → docs/database}/public.schema_migrations.svg +0 -0
- /data/{dbdoc → docs/database}/public.tags.md +0 -0
- /data/{dbdoc → docs/database}/public.tags.svg +0 -0
- /data/{dbdoc → docs/database}/public.topic_relationships.md +0 -0
- /data/{dbdoc → docs/database}/public.topic_relationships.svg +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class HTM
|
|
4
|
+
module Models
|
|
5
|
+
# WorkingMemoryEntry - Tracks which nodes are in each robot's working memory
|
|
6
|
+
#
|
|
7
|
+
# This provides optional database persistence for working memory state.
|
|
8
|
+
# Useful for:
|
|
9
|
+
# - Restoring working memory after process restart
|
|
10
|
+
# - Querying what nodes robots are actively working with
|
|
11
|
+
# - Debugging/monitoring working memory across robots
|
|
12
|
+
#
|
|
13
|
+
# Note: The in-memory WorkingMemory class remains the primary interface.
|
|
14
|
+
# This table is for persistence/observability, not required for operation.
|
|
15
|
+
#
|
|
16
|
+
class WorkingMemoryEntry < ActiveRecord::Base
|
|
17
|
+
self.table_name = 'working_memories'
|
|
18
|
+
|
|
19
|
+
belongs_to :robot, class_name: 'HTM::Models::Robot'
|
|
20
|
+
belongs_to :node, class_name: 'HTM::Models::Node'
|
|
21
|
+
|
|
22
|
+
validates :robot_id, presence: true
|
|
23
|
+
validates :node_id, presence: true
|
|
24
|
+
validates :robot_id, uniqueness: { scope: :node_id, message: 'already has this node in working memory' }
|
|
25
|
+
|
|
26
|
+
# Scopes
|
|
27
|
+
scope :by_robot, ->(robot_id) { where(robot_id: robot_id) }
|
|
28
|
+
scope :recent, -> { order(added_at: :desc) }
|
|
29
|
+
|
|
30
|
+
# Class methods
|
|
31
|
+
|
|
32
|
+
# Sync working memory state from in-memory hash to database
|
|
33
|
+
#
|
|
34
|
+
# @param robot_id [Integer] Robot ID
|
|
35
|
+
# @param node_entries [Hash] Hash of node_id => { token_count:, ... }
|
|
36
|
+
#
|
|
37
|
+
def self.sync_from_memory(robot_id, node_entries)
|
|
38
|
+
transaction do
|
|
39
|
+
# Clear existing entries for this robot
|
|
40
|
+
where(robot_id: robot_id).delete_all
|
|
41
|
+
|
|
42
|
+
# Insert current entries
|
|
43
|
+
node_entries.each do |node_id, data|
|
|
44
|
+
create!(
|
|
45
|
+
robot_id: robot_id,
|
|
46
|
+
node_id: node_id,
|
|
47
|
+
token_count: data[:token_count],
|
|
48
|
+
added_at: data[:added_at] || Time.current
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Load working memory state from database
|
|
55
|
+
#
|
|
56
|
+
# @param robot_id [Integer] Robot ID
|
|
57
|
+
# @return [Hash] Hash suitable for WorkingMemory restoration
|
|
58
|
+
#
|
|
59
|
+
def self.load_for_robot(robot_id)
|
|
60
|
+
by_robot(robot_id).includes(:node).each_with_object({}) do |entry, hash|
|
|
61
|
+
hash[entry.node_id] = {
|
|
62
|
+
content: entry.node.content,
|
|
63
|
+
token_count: entry.token_count,
|
|
64
|
+
added_at: entry.added_at,
|
|
65
|
+
access_count: entry.node.access_count
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Clear working memory for a robot
|
|
71
|
+
#
|
|
72
|
+
# @param robot_id [Integer] Robot ID
|
|
73
|
+
#
|
|
74
|
+
def self.clear_for_robot(robot_id)
|
|
75
|
+
where(robot_id: robot_id).delete_all
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Get total token count for a robot's working memory
|
|
79
|
+
#
|
|
80
|
+
# @param robot_id [Integer] Robot ID
|
|
81
|
+
# @return [Integer] Total tokens
|
|
82
|
+
#
|
|
83
|
+
def self.total_tokens_for_robot(robot_id)
|
|
84
|
+
where(robot_id: robot_id).sum(:token_count)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
data/lib/htm/tasks.rb
CHANGED
|
@@ -28,11 +28,15 @@
|
|
|
28
28
|
# rake htm:jobs:failed # Show nodes with processing issues
|
|
29
29
|
# rake htm:jobs:clear_all # Clear all embeddings and tags (testing)
|
|
30
30
|
#
|
|
31
|
+
# Tag tasks:
|
|
32
|
+
# rake htm:tags:tree # Display tags as a hierarchical tree
|
|
33
|
+
#
|
|
31
34
|
|
|
32
35
|
if defined?(Rake)
|
|
33
36
|
# Load the rake tasks
|
|
34
37
|
load File.expand_path('../tasks/htm.rake', __dir__)
|
|
35
38
|
load File.expand_path('../tasks/jobs.rake', __dir__)
|
|
39
|
+
load File.expand_path('../tasks/tags.rake', __dir__)
|
|
36
40
|
else
|
|
37
41
|
warn "HTM tasks not loaded: Rake is not available"
|
|
38
42
|
end
|
data/lib/htm/version.rb
CHANGED
data/lib/htm.rb
CHANGED
|
@@ -107,15 +107,14 @@ class HTM
|
|
|
107
107
|
# @return [Integer] Database ID of the memory node
|
|
108
108
|
#
|
|
109
109
|
# @example Remember with source
|
|
110
|
-
# node_id = htm.remember("PostgreSQL is great for HTM"
|
|
110
|
+
# node_id = htm.remember("PostgreSQL is great for HTM")
|
|
111
111
|
#
|
|
112
112
|
# @example Remember with manual tags
|
|
113
|
-
# node_id = htm.remember("Time-series data",
|
|
113
|
+
# node_id = htm.remember("Time-series data", tags: ["database:timescaledb"])
|
|
114
114
|
#
|
|
115
|
-
def remember(content,
|
|
115
|
+
def remember(content, tags: [])
|
|
116
116
|
# Convert nil to empty string
|
|
117
117
|
content = content.to_s
|
|
118
|
-
source = source.to_s
|
|
119
118
|
|
|
120
119
|
# If content is empty, return the last node ID without creating a new entry
|
|
121
120
|
if content.empty?
|
|
@@ -126,22 +125,35 @@ class HTM
|
|
|
126
125
|
# Calculate token count using configured counter
|
|
127
126
|
token_count = HTM.count_tokens(content)
|
|
128
127
|
|
|
129
|
-
# Store in long-term memory
|
|
130
|
-
#
|
|
131
|
-
|
|
128
|
+
# Store in long-term memory (with deduplication)
|
|
129
|
+
# Returns { node_id:, is_new:, robot_node: }
|
|
130
|
+
result = @long_term_memory.add(
|
|
132
131
|
content: content,
|
|
133
|
-
source: source,
|
|
134
132
|
token_count: token_count,
|
|
135
133
|
robot_id: @robot_id,
|
|
136
134
|
embedding: nil # Will be generated in background
|
|
137
135
|
)
|
|
138
136
|
|
|
139
|
-
|
|
137
|
+
node_id = result[:node_id]
|
|
138
|
+
is_new = result[:is_new]
|
|
140
139
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
if is_new
|
|
141
|
+
HTM.logger.info "Node #{node_id} created for robot #{@robot_name} (#{token_count} tokens)"
|
|
142
|
+
|
|
143
|
+
# Enqueue background jobs for embedding and tag generation
|
|
144
|
+
# Only for NEW nodes - existing nodes already have embeddings/tags
|
|
145
|
+
enqueue_embedding_job(node_id)
|
|
146
|
+
enqueue_tags_job(node_id, manual_tags: tags)
|
|
147
|
+
else
|
|
148
|
+
HTM.logger.info "Node #{node_id} already exists, linked to robot #{@robot_name} (remember_count: #{result[:robot_node].remember_count})"
|
|
149
|
+
|
|
150
|
+
# For existing nodes, only add manual tags if provided
|
|
151
|
+
if tags.any?
|
|
152
|
+
node = HTM::Models::Node.find(node_id)
|
|
153
|
+
node.add_tags(tags)
|
|
154
|
+
HTM.logger.info "Added #{tags.length} manual tags to existing node #{node_id}"
|
|
155
|
+
end
|
|
156
|
+
end
|
|
145
157
|
|
|
146
158
|
# Add to working memory (access_count starts at 0)
|
|
147
159
|
@working_memory.add(node_id, content, token_count: token_count, access_count: 0)
|
|
@@ -385,6 +397,15 @@ class HTM
|
|
|
385
397
|
when /last (\d+) days?/
|
|
386
398
|
days = $1.to_i
|
|
387
399
|
(now - days * 24 * 3600)..now
|
|
400
|
+
when /last (\d+) seconds?/
|
|
401
|
+
seconds = $1.to_i
|
|
402
|
+
(now - seconds)..now
|
|
403
|
+
when /last (\d+) minutes?/
|
|
404
|
+
minutes = $1.to_i
|
|
405
|
+
(now - minutes * 60)..now
|
|
406
|
+
when /last (\d+) hours?/
|
|
407
|
+
hours = $1.to_i
|
|
408
|
+
(now - hours * 3600)..now
|
|
388
409
|
when /this month/
|
|
389
410
|
start_of_month = Time.new(now.year, now.month, 1)
|
|
390
411
|
start_of_month..now
|
data/lib/tasks/htm.rake
CHANGED
|
@@ -138,10 +138,41 @@ namespace :htm do
|
|
|
138
138
|
end
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
namespace :doc do
|
|
141
144
|
desc "Generate/update database documentation in dbdoc/"
|
|
142
|
-
task :
|
|
145
|
+
task :db do
|
|
146
|
+
unless system("which tbls > /dev/null 2>&1")
|
|
147
|
+
puts "Error: 'tbls' is not installed."
|
|
148
|
+
puts "Install it with: brew install tbls"
|
|
149
|
+
exit 1
|
|
150
|
+
end
|
|
143
151
|
require 'htm'
|
|
144
152
|
HTM::Database.generate_docs
|
|
145
153
|
end
|
|
154
|
+
|
|
155
|
+
desc "Build documentation site with MkDocs"
|
|
156
|
+
task :build do
|
|
157
|
+
unless system("which mkdocs > /dev/null 2>&1")
|
|
158
|
+
puts "Error: 'mkdocs' is not installed."
|
|
159
|
+
puts "Install it with: brew install mkdocs"
|
|
160
|
+
exit 1
|
|
161
|
+
end
|
|
162
|
+
sh "mkdocs build"
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
desc "Serve documentation site locally with MkDocs"
|
|
166
|
+
task :serve do
|
|
167
|
+
unless system("which mkdocs > /dev/null 2>&1")
|
|
168
|
+
puts "Error: 'mkdocs' is not installed."
|
|
169
|
+
puts "Install it with: brew install mkdocs"
|
|
170
|
+
exit 1
|
|
171
|
+
end
|
|
172
|
+
sh "mkdocs serve"
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
desc "Generate DB docs, build site, and serve locally"
|
|
176
|
+
task :all => [:db, :build, :serve]
|
|
146
177
|
end
|
|
147
178
|
end
|
data/lib/tasks/jobs.rake
CHANGED
|
@@ -42,9 +42,13 @@ namespace :htm do
|
|
|
42
42
|
# Tags by depth
|
|
43
43
|
if total_tags > 0
|
|
44
44
|
puts "\nTag hierarchy breakdown:"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
depth_counts = Hash.new(0)
|
|
46
|
+
HTM::Models::Tag.pluck(:name).each do |name|
|
|
47
|
+
depth = name.count(':')
|
|
48
|
+
depth_counts[depth] += 1
|
|
49
|
+
end
|
|
50
|
+
depth_counts.keys.sort.each do |depth|
|
|
51
|
+
puts " Depth #{depth}: #{depth_counts[depth]} tags"
|
|
48
52
|
end
|
|
49
53
|
end
|
|
50
54
|
|
data/lib/tasks/tags.rake
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# HTM Tag Management Tasks
|
|
4
|
+
#
|
|
5
|
+
# These tasks are available to any application using the HTM gem.
|
|
6
|
+
# Add to your application's Rakefile:
|
|
7
|
+
#
|
|
8
|
+
# require 'htm/tasks'
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
namespace :htm do
|
|
12
|
+
namespace :tags do
|
|
13
|
+
desc "Display tags as a hierarchical tree"
|
|
14
|
+
task :tree do
|
|
15
|
+
require 'htm'
|
|
16
|
+
|
|
17
|
+
# Ensure database connection
|
|
18
|
+
HTM::ActiveRecordConfig.establish_connection!
|
|
19
|
+
|
|
20
|
+
count = HTM::Models::Tag.count
|
|
21
|
+
|
|
22
|
+
if count.zero?
|
|
23
|
+
puts "No tags found in database."
|
|
24
|
+
next
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Display tree using Tag model method
|
|
28
|
+
puts "\nHTM Tags Tree"
|
|
29
|
+
puts "=" * 40
|
|
30
|
+
print HTM::Models::Tag.all.tree_string
|
|
31
|
+
puts "\nTotal tags: #{count}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/mkdocs.yml
CHANGED
|
@@ -13,21 +13,21 @@ edit_uri: edit/main/docs/
|
|
|
13
13
|
# Configuration
|
|
14
14
|
theme:
|
|
15
15
|
name: material
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
# Color scheme - Default to light mode
|
|
18
18
|
palette:
|
|
19
19
|
# Palette toggle for light mode (default)
|
|
20
20
|
- scheme: default
|
|
21
|
-
primary:
|
|
22
|
-
accent:
|
|
21
|
+
primary: indigo
|
|
22
|
+
accent: deep purple
|
|
23
23
|
toggle:
|
|
24
24
|
icon: material/brightness-7
|
|
25
25
|
name: Switch to dark mode
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
# Palette toggle for dark mode
|
|
28
28
|
- scheme: slate
|
|
29
|
-
primary:
|
|
30
|
-
accent:
|
|
29
|
+
primary: indigo
|
|
30
|
+
accent: deep purple
|
|
31
31
|
toggle:
|
|
32
32
|
icon: material/brightness-4
|
|
33
33
|
name: Switch to light mode
|
|
@@ -37,6 +37,10 @@ theme:
|
|
|
37
37
|
text: Roboto
|
|
38
38
|
code: Roboto Mono
|
|
39
39
|
|
|
40
|
+
# Logo and icon
|
|
41
|
+
icon:
|
|
42
|
+
repo: fontawesome/brands/github
|
|
43
|
+
|
|
40
44
|
# Theme features
|
|
41
45
|
features:
|
|
42
46
|
# Navigation
|
|
@@ -48,6 +52,7 @@ theme:
|
|
|
48
52
|
- navigation.path
|
|
49
53
|
- navigation.indexes
|
|
50
54
|
- navigation.top
|
|
55
|
+
- navigation.footer
|
|
51
56
|
|
|
52
57
|
# Table of contents
|
|
53
58
|
- toc.follow
|
|
@@ -72,6 +77,7 @@ theme:
|
|
|
72
77
|
plugins:
|
|
73
78
|
- search:
|
|
74
79
|
separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
|
|
80
|
+
- tags
|
|
75
81
|
|
|
76
82
|
# Extensions
|
|
77
83
|
markdown_extensions:
|
|
@@ -82,6 +88,7 @@ markdown_extensions:
|
|
|
82
88
|
- def_list
|
|
83
89
|
- footnotes
|
|
84
90
|
- md_in_html
|
|
91
|
+
- tables
|
|
85
92
|
- toc:
|
|
86
93
|
permalink: true
|
|
87
94
|
title: On this page
|
|
@@ -92,6 +99,7 @@ markdown_extensions:
|
|
|
92
99
|
- pymdownx.betterem:
|
|
93
100
|
smart_enable: all
|
|
94
101
|
- pymdownx.caret
|
|
102
|
+
- pymdownx.critic
|
|
95
103
|
- pymdownx.details
|
|
96
104
|
- pymdownx.emoji:
|
|
97
105
|
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
|
@@ -108,6 +116,8 @@ markdown_extensions:
|
|
|
108
116
|
repo: htm
|
|
109
117
|
- pymdownx.mark
|
|
110
118
|
- pymdownx.smartsymbols
|
|
119
|
+
- pymdownx.snippets:
|
|
120
|
+
check_paths: true
|
|
111
121
|
- pymdownx.superfences:
|
|
112
122
|
custom_fences:
|
|
113
123
|
- name: mermaid
|
|
@@ -138,11 +148,28 @@ extra:
|
|
|
138
148
|
link: https://rubygems.org/gems/htm
|
|
139
149
|
name: HTM on RubyGems
|
|
140
150
|
|
|
151
|
+
analytics:
|
|
152
|
+
feedback:
|
|
153
|
+
title: Was this page helpful?
|
|
154
|
+
ratings:
|
|
155
|
+
- icon: material/emoticon-happy-outline
|
|
156
|
+
name: This page was helpful
|
|
157
|
+
data: 1
|
|
158
|
+
note: >-
|
|
159
|
+
Thanks for your feedback!
|
|
160
|
+
- icon: material/emoticon-sad-outline
|
|
161
|
+
name: This page could be improved
|
|
162
|
+
data: 0
|
|
163
|
+
note: >-
|
|
164
|
+
Thanks for your feedback! Help us improve by creating an issue.
|
|
165
|
+
|
|
141
166
|
# Navigation
|
|
142
167
|
nav:
|
|
143
168
|
- Home: index.md
|
|
144
|
-
-
|
|
145
|
-
|
|
169
|
+
- Getting Started:
|
|
170
|
+
- getting-started/index.md
|
|
171
|
+
- Installation: getting-started/installation.md
|
|
172
|
+
- Quick Start: getting-started/quick-start.md
|
|
146
173
|
- Architecture:
|
|
147
174
|
- architecture/index.md
|
|
148
175
|
- Overview: architecture/overview.md
|
|
@@ -184,7 +211,27 @@ nav:
|
|
|
184
211
|
- Testing: development/testing.md
|
|
185
212
|
- Contributing: development/contributing.md
|
|
186
213
|
- Database Schema: development/schema.md
|
|
214
|
+
- Database Tables:
|
|
215
|
+
- database/README.md
|
|
216
|
+
- Core Tables:
|
|
217
|
+
- Robots: database/public.robots.md
|
|
218
|
+
- Nodes: database/public.nodes.md
|
|
219
|
+
- Tags: database/public.tags.md
|
|
220
|
+
- Working Memories: database/public.working_memories.md
|
|
221
|
+
- Join Tables:
|
|
222
|
+
- Node Tags: database/public.node_tags.md
|
|
223
|
+
- Nodes Tags (Legacy): database/public.nodes_tags.md
|
|
224
|
+
- Robot Nodes: database/public.robot_nodes.md
|
|
225
|
+
- Views & Stats:
|
|
226
|
+
- Node Stats: database/public.node_stats.md
|
|
227
|
+
- Robot Activity: database/public.robot_activity.md
|
|
228
|
+
- Topic Relationships: database/public.topic_relationships.md
|
|
229
|
+
- Ontology Structure: database/public.ontology_structure.md
|
|
230
|
+
- Relationships: database/public.relationships.md
|
|
231
|
+
- System:
|
|
232
|
+
- Operations Log: database/public.operations_log.md
|
|
233
|
+
- Schema Migrations: database/public.schema_migrations.md
|
|
187
234
|
- Multi-Framework Support: multi_framework_support.md
|
|
188
235
|
- Database Rake Tasks: database_rake_tasks.md
|
|
189
236
|
- Using Rake Tasks: using_rake_tasks_in_your_app.md
|
|
190
|
-
- Setup Local Database: setup_local_database.md
|
|
237
|
+
- Setup Local Database: setup_local_database.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.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dewayne VanHoozer
|
|
@@ -182,6 +182,7 @@ files:
|
|
|
182
182
|
- ".architecture/reviews/initial-system-analysis.md"
|
|
183
183
|
- ".envrc"
|
|
184
184
|
- ".irbrc"
|
|
185
|
+
- ".tbls.yml"
|
|
185
186
|
- CHANGELOG.md
|
|
186
187
|
- COMMITS.md
|
|
187
188
|
- LICENSE
|
|
@@ -194,38 +195,16 @@ files:
|
|
|
194
195
|
- db/migrate/20250101000003_create_nodes.rb
|
|
195
196
|
- db/migrate/20250101000005_create_tags.rb
|
|
196
197
|
- db/migrate/20250101000007_add_node_vector_indexes.rb
|
|
198
|
+
- db/migrate/20250125000001_add_content_hash_to_nodes.rb
|
|
199
|
+
- db/migrate/20250125000002_create_robot_nodes.rb
|
|
200
|
+
- db/migrate/20250125000003_remove_source_and_robot_id_from_nodes.rb
|
|
201
|
+
- db/migrate/20250126000001_create_working_memories.rb
|
|
202
|
+
- db/migrate/20250126000002_remove_unused_columns.rb
|
|
197
203
|
- db/schema.sql
|
|
198
204
|
- db/seed_data/README.md
|
|
199
205
|
- db/seed_data/presidents.md
|
|
200
206
|
- db/seed_data/states.md
|
|
201
207
|
- db/seeds.rb
|
|
202
|
-
- dbdoc/README.md
|
|
203
|
-
- dbdoc/public.node_stats.md
|
|
204
|
-
- dbdoc/public.node_stats.svg
|
|
205
|
-
- dbdoc/public.node_tags.md
|
|
206
|
-
- dbdoc/public.node_tags.svg
|
|
207
|
-
- dbdoc/public.nodes.md
|
|
208
|
-
- dbdoc/public.nodes.svg
|
|
209
|
-
- dbdoc/public.nodes_tags.md
|
|
210
|
-
- dbdoc/public.nodes_tags.svg
|
|
211
|
-
- dbdoc/public.ontology_structure.md
|
|
212
|
-
- dbdoc/public.ontology_structure.svg
|
|
213
|
-
- dbdoc/public.operations_log.md
|
|
214
|
-
- dbdoc/public.operations_log.svg
|
|
215
|
-
- dbdoc/public.relationships.md
|
|
216
|
-
- dbdoc/public.relationships.svg
|
|
217
|
-
- dbdoc/public.robot_activity.md
|
|
218
|
-
- dbdoc/public.robot_activity.svg
|
|
219
|
-
- dbdoc/public.robots.md
|
|
220
|
-
- dbdoc/public.robots.svg
|
|
221
|
-
- dbdoc/public.schema_migrations.md
|
|
222
|
-
- dbdoc/public.schema_migrations.svg
|
|
223
|
-
- dbdoc/public.tags.md
|
|
224
|
-
- dbdoc/public.tags.svg
|
|
225
|
-
- dbdoc/public.topic_relationships.md
|
|
226
|
-
- dbdoc/public.topic_relationships.svg
|
|
227
|
-
- dbdoc/schema.json
|
|
228
|
-
- dbdoc/schema.svg
|
|
229
208
|
- docs/api/database.md
|
|
230
209
|
- docs/api/embedding-service.md
|
|
231
210
|
- docs/api/htm.md
|
|
@@ -249,23 +228,71 @@ files:
|
|
|
249
228
|
- docs/architecture/overview.md
|
|
250
229
|
- docs/architecture/two-tier-memory.md
|
|
251
230
|
- docs/assets/css/custom.css
|
|
231
|
+
- docs/assets/images/adr-010-current-architecture.svg
|
|
232
|
+
- docs/assets/images/adr-010-proposed-architecture.svg
|
|
233
|
+
- docs/assets/images/adr-dependency-tree.svg
|
|
234
|
+
- docs/assets/images/class-hierarchy.svg
|
|
235
|
+
- docs/assets/images/exception-hierarchy.svg
|
|
236
|
+
- docs/assets/images/htm-architecture-overview.svg
|
|
237
|
+
- docs/assets/images/htm-complete-memory-flow.svg
|
|
238
|
+
- docs/assets/images/htm-context-assembly-flow.svg
|
|
252
239
|
- docs/assets/images/htm-core-components.svg
|
|
253
240
|
- docs/assets/images/htm-database-schema.svg
|
|
241
|
+
- docs/assets/images/htm-eviction-process.svg
|
|
254
242
|
- docs/assets/images/htm-hive-mind-architecture.svg
|
|
255
243
|
- docs/assets/images/htm-importance-scoring-framework.svg
|
|
256
244
|
- docs/assets/images/htm-layered-architecture.svg
|
|
257
245
|
- docs/assets/images/htm-long-term-memory-architecture.svg
|
|
246
|
+
- docs/assets/images/htm-memory-addition-flow.svg
|
|
247
|
+
- docs/assets/images/htm-memory-recall-flow.svg
|
|
248
|
+
- docs/assets/images/htm-node-states.svg
|
|
258
249
|
- docs/assets/images/htm-working-memory-architecture.svg
|
|
259
250
|
- docs/assets/images/htm.jpg
|
|
260
251
|
- docs/assets/images/htm_demo.gif
|
|
252
|
+
- docs/assets/images/project-structure.svg
|
|
253
|
+
- docs/assets/images/test-directory-structure.svg
|
|
261
254
|
- docs/assets/js/mathjax.js
|
|
262
255
|
- docs/assets/videos/htm_video.mp4
|
|
256
|
+
- docs/database/README.md
|
|
257
|
+
- docs/database/public.node_stats.md
|
|
258
|
+
- docs/database/public.node_stats.svg
|
|
259
|
+
- docs/database/public.node_tags.md
|
|
260
|
+
- docs/database/public.node_tags.svg
|
|
261
|
+
- docs/database/public.nodes.md
|
|
262
|
+
- docs/database/public.nodes.svg
|
|
263
|
+
- docs/database/public.nodes_tags.md
|
|
264
|
+
- docs/database/public.nodes_tags.svg
|
|
265
|
+
- docs/database/public.ontology_structure.md
|
|
266
|
+
- docs/database/public.ontology_structure.svg
|
|
267
|
+
- docs/database/public.operations_log.md
|
|
268
|
+
- docs/database/public.operations_log.svg
|
|
269
|
+
- docs/database/public.relationships.md
|
|
270
|
+
- docs/database/public.relationships.svg
|
|
271
|
+
- docs/database/public.robot_activity.md
|
|
272
|
+
- docs/database/public.robot_activity.svg
|
|
273
|
+
- docs/database/public.robot_nodes.md
|
|
274
|
+
- docs/database/public.robot_nodes.svg
|
|
275
|
+
- docs/database/public.robots.md
|
|
276
|
+
- docs/database/public.robots.svg
|
|
277
|
+
- docs/database/public.schema_migrations.md
|
|
278
|
+
- docs/database/public.schema_migrations.svg
|
|
279
|
+
- docs/database/public.tags.md
|
|
280
|
+
- docs/database/public.tags.svg
|
|
281
|
+
- docs/database/public.topic_relationships.md
|
|
282
|
+
- docs/database/public.topic_relationships.svg
|
|
283
|
+
- docs/database/public.working_memories.md
|
|
284
|
+
- docs/database/public.working_memories.svg
|
|
285
|
+
- docs/database/schema.json
|
|
286
|
+
- docs/database/schema.svg
|
|
263
287
|
- docs/database_rake_tasks.md
|
|
264
288
|
- docs/development/contributing.md
|
|
265
289
|
- docs/development/index.md
|
|
266
290
|
- docs/development/schema.md
|
|
267
291
|
- docs/development/setup.md
|
|
268
292
|
- docs/development/testing.md
|
|
293
|
+
- docs/getting-started/index.md
|
|
294
|
+
- docs/getting-started/installation.md
|
|
295
|
+
- docs/getting-started/quick-start.md
|
|
269
296
|
- docs/guides/adding-memories.md
|
|
270
297
|
- docs/guides/context-assembly.md
|
|
271
298
|
- docs/guides/getting-started.md
|
|
@@ -275,10 +302,9 @@ files:
|
|
|
275
302
|
- docs/guides/recalling-memories.md
|
|
276
303
|
- docs/guides/search-strategies.md
|
|
277
304
|
- docs/guides/working-memory.md
|
|
305
|
+
- docs/images/htm-er-diagram.svg
|
|
278
306
|
- docs/index.md
|
|
279
|
-
- docs/installation.md
|
|
280
307
|
- docs/multi_framework_support.md
|
|
281
|
-
- docs/quick-start.md
|
|
282
308
|
- docs/setup_local_database.md
|
|
283
309
|
- docs/using_rake_tasks_in_your_app.md
|
|
284
310
|
- examples/basic_usage.rb
|
|
@@ -288,6 +314,7 @@ files:
|
|
|
288
314
|
- examples/example_app/Rakefile
|
|
289
315
|
- examples/example_app/app.rb
|
|
290
316
|
- examples/sinatra_app/Gemfile
|
|
317
|
+
- examples/sinatra_app/Gemfile.lock
|
|
291
318
|
- examples/sinatra_app/app.rb
|
|
292
319
|
- lib/htm.rb
|
|
293
320
|
- lib/htm/active_record_config.rb
|
|
@@ -295,6 +322,7 @@ files:
|
|
|
295
322
|
- lib/htm/database.rb
|
|
296
323
|
- lib/htm/embedding_service.rb
|
|
297
324
|
- lib/htm/errors.rb
|
|
325
|
+
- lib/htm/integrations/sinatra.rb
|
|
298
326
|
- lib/htm/job_adapter.rb
|
|
299
327
|
- lib/htm/jobs/generate_embedding_job.rb
|
|
300
328
|
- lib/htm/jobs/generate_tags_job.rb
|
|
@@ -302,9 +330,10 @@ files:
|
|
|
302
330
|
- lib/htm/models/node.rb
|
|
303
331
|
- lib/htm/models/node_tag.rb
|
|
304
332
|
- lib/htm/models/robot.rb
|
|
333
|
+
- lib/htm/models/robot_node.rb
|
|
305
334
|
- lib/htm/models/tag.rb
|
|
335
|
+
- lib/htm/models/working_memory_entry.rb
|
|
306
336
|
- lib/htm/railtie.rb
|
|
307
|
-
- lib/htm/sinatra.rb
|
|
308
337
|
- lib/htm/tag_service.rb
|
|
309
338
|
- lib/htm/tasks.rb
|
|
310
339
|
- lib/htm/version.rb
|
|
@@ -312,6 +341,7 @@ files:
|
|
|
312
341
|
- lib/tasks/db.rake
|
|
313
342
|
- lib/tasks/htm.rake
|
|
314
343
|
- lib/tasks/jobs.rake
|
|
344
|
+
- lib/tasks/tags.rake
|
|
315
345
|
- mkdocs.yml
|
|
316
346
|
- scripts/install_local_database.sh
|
|
317
347
|
homepage: https://github.com/madbomber/htm
|