htm 0.0.10 → 0.0.14
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/.dictate.toml +46 -0
- data/.envrc +2 -0
- data/CHANGELOG.md +86 -3
- data/README.md +86 -7
- data/Rakefile +14 -2
- data/bin/htm_mcp.rb +621 -0
- data/config/database.yml +20 -13
- data/db/migrate/00010_add_soft_delete_to_associations.rb +29 -0
- data/db/migrate/00011_add_performance_indexes.rb +21 -0
- data/db/migrate/00012_add_tags_trigram_index.rb +18 -0
- data/db/migrate/00013_enable_lz4_compression.rb +43 -0
- data/db/schema.sql +49 -92
- data/docs/api/index.md +1 -1
- data/docs/api/yard/HTM.md +2 -4
- data/docs/architecture/index.md +1 -1
- data/docs/development/index.md +1 -1
- data/docs/getting-started/index.md +1 -1
- data/docs/guides/index.md +1 -1
- data/docs/images/telemetry-architecture.svg +153 -0
- data/docs/telemetry.md +391 -0
- data/examples/README.md +171 -1
- data/examples/cli_app/README.md +1 -1
- data/examples/cli_app/htm_cli.rb +1 -1
- data/examples/mcp_client.rb +529 -0
- data/examples/sinatra_app/app.rb +1 -1
- data/examples/telemetry/README.md +147 -0
- data/examples/telemetry/SETUP_README.md +169 -0
- data/examples/telemetry/demo.rb +498 -0
- data/examples/telemetry/grafana/dashboards/htm-metrics.json +457 -0
- data/lib/htm/configuration.rb +261 -70
- data/lib/htm/database.rb +46 -22
- data/lib/htm/embedding_service.rb +24 -14
- data/lib/htm/errors.rb +15 -1
- data/lib/htm/jobs/generate_embedding_job.rb +19 -0
- data/lib/htm/jobs/generate_propositions_job.rb +103 -0
- data/lib/htm/jobs/generate_tags_job.rb +24 -0
- data/lib/htm/loaders/markdown_chunker.rb +79 -0
- data/lib/htm/loaders/markdown_loader.rb +41 -15
- data/lib/htm/long_term_memory/fulltext_search.rb +138 -0
- data/lib/htm/long_term_memory/hybrid_search.rb +324 -0
- data/lib/htm/long_term_memory/node_operations.rb +209 -0
- data/lib/htm/long_term_memory/relevance_scorer.rb +355 -0
- data/lib/htm/long_term_memory/robot_operations.rb +34 -0
- data/lib/htm/long_term_memory/tag_operations.rb +428 -0
- data/lib/htm/long_term_memory/vector_search.rb +109 -0
- data/lib/htm/long_term_memory.rb +51 -1153
- data/lib/htm/models/node.rb +35 -2
- data/lib/htm/models/node_tag.rb +31 -0
- data/lib/htm/models/robot_node.rb +31 -0
- data/lib/htm/models/tag.rb +44 -0
- data/lib/htm/proposition_service.rb +169 -0
- data/lib/htm/query_cache.rb +214 -0
- data/lib/htm/sql_builder.rb +178 -0
- data/lib/htm/tag_service.rb +16 -6
- data/lib/htm/tasks.rb +8 -2
- data/lib/htm/telemetry.rb +224 -0
- data/lib/htm/version.rb +1 -1
- data/lib/htm.rb +64 -3
- data/lib/tasks/doc.rake +1 -1
- data/lib/tasks/htm.rake +259 -13
- data/mkdocs.yml +96 -96
- metadata +75 -18
- data/.aigcm_msg +0 -1
- data/.claude/settings.local.json +0 -92
- data/CLAUDE.md +0 -603
- data/examples/cli_app/temp.log +0 -93
- data/lib/htm/loaders/paragraph_chunker.rb +0 -112
- data/notes/ARCHITECTURE_REVIEW.md +0 -1167
- data/notes/IMPLEMENTATION_SUMMARY.md +0 -606
- data/notes/MULTI_FRAMEWORK_IMPLEMENTATION.md +0 -451
- data/notes/next_steps.md +0 -100
- data/notes/plan.md +0 -627
- data/notes/tag_ontology_enhancement_ideas.md +0 -222
- data/notes/timescaledb_removal_summary.md +0 -200
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
# Tag Ontology Enhancement Ideas
|
|
2
|
-
|
|
3
|
-
## Problem Statement
|
|
4
|
-
|
|
5
|
-
HTM builds a dynamic hierarchical tag ontology but doesn't fully leverage it for retrieval. The tag extraction is sophisticated (LLM-based, ontology-consistent, hierarchical), but the retrieval capabilities are limited.
|
|
6
|
-
|
|
7
|
-
## Current State Analysis
|
|
8
|
-
|
|
9
|
-
### What's Working Well
|
|
10
|
-
- Sophisticated LLM-based tag extraction with ontology consistency
|
|
11
|
-
- Hierarchical format (`database:postgresql:indexes`)
|
|
12
|
-
- Beautiful visualization (tree, Mermaid, SVG)
|
|
13
|
-
- Tag relationship analysis (co-occurrence)
|
|
14
|
-
- Async generation via `GenerateTagsJob`
|
|
15
|
-
|
|
16
|
-
### What's Missing
|
|
17
|
-
1. **`search_by_tags()` and `nodes_by_topic()` exist in LongTermMemory but aren't exposed in the public HTM API**
|
|
18
|
-
2. `recall()` accepts `query_tags:` parameter but **ignores it** except for relevance scoring
|
|
19
|
-
3. No hierarchical traversal (parent/child/ancestor queries)
|
|
20
|
-
4. No tag-only retrieval (without text query)
|
|
21
|
-
5. No query expansion using tag relationships
|
|
22
|
-
6. No faceted navigation
|
|
23
|
-
7. No tag-based result grouping
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Proposed Enhancements
|
|
28
|
-
|
|
29
|
-
### 1. Expose Tag-Based Retrieval in HTM API
|
|
30
|
-
|
|
31
|
-
**Priority: High** - These methods already exist, just need to be exposed.
|
|
32
|
-
|
|
33
|
-
```ruby
|
|
34
|
-
# Browse by topic path (hierarchical navigation)
|
|
35
|
-
htm.browse("database:postgresql") # All nodes under this branch
|
|
36
|
-
|
|
37
|
-
# Filter recall with tags
|
|
38
|
-
htm.recall("query", tags: ["database:postgresql"], match_all: false)
|
|
39
|
-
|
|
40
|
-
# Tag-only retrieval (no text query required)
|
|
41
|
-
htm.by_tags(["database:postgresql", "ai:embeddings"])
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**Implementation:**
|
|
45
|
-
- Add `browse(topic_path, exact: false, limit: 20)` to HTM class
|
|
46
|
-
- Add `by_tags(tags, match_all: false, limit: 20)` to HTM class
|
|
47
|
-
- Wire `query_tags:` parameter through to actual filtering in `recall()`
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
### 2. Hierarchical Query Expansion
|
|
52
|
-
|
|
53
|
-
**Priority: High** - Leverages the hierarchical structure.
|
|
54
|
-
|
|
55
|
-
```ruby
|
|
56
|
-
# Searching "database:postgresql" should optionally include children:
|
|
57
|
-
# database:postgresql:indexes
|
|
58
|
-
# database:postgresql:extensions
|
|
59
|
-
# database:postgresql:partitioning
|
|
60
|
-
|
|
61
|
-
htm.recall("indexes", tags: ["database:postgresql"], expand_children: true)
|
|
62
|
-
|
|
63
|
-
# Or expand upward to include parent context
|
|
64
|
-
htm.recall("specific query", tags: ["database:postgresql:indexes"], expand_ancestors: true)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Implementation:**
|
|
68
|
-
- Add `expand_children:` and `expand_ancestors:` options
|
|
69
|
-
- Query `tags.name LIKE 'database:postgresql:%'` for children
|
|
70
|
-
- Parse tag path and query ancestors for upward expansion
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
### 3. Faceted Search / Tag Aggregation
|
|
75
|
-
|
|
76
|
-
**Priority: Medium** - Enables discovery and navigation.
|
|
77
|
-
|
|
78
|
-
```ruby
|
|
79
|
-
# "What topics are represented in my search results?"
|
|
80
|
-
results = htm.recall("machine learning")
|
|
81
|
-
facets = results.facet_by_tags
|
|
82
|
-
# => { "ai:ml" => 15, "ai:llm" => 8, "database:vector" => 5 }
|
|
83
|
-
|
|
84
|
-
# Or as a standalone method
|
|
85
|
-
htm.tag_facets(query: "machine learning", limit: 10)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Implementation:**
|
|
89
|
-
- Return tag counts grouped by topic
|
|
90
|
-
- Weight by specificity (deeper tags = more specific)
|
|
91
|
-
- Consider returning hierarchical facet structure
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
### 4. Semantic Tag Matching in Recall
|
|
96
|
-
|
|
97
|
-
**Priority: Medium** - Auto-extract tags from query.
|
|
98
|
-
|
|
99
|
-
```ruby
|
|
100
|
-
# Auto-extract tags from query and use them to boost results
|
|
101
|
-
htm.recall("PostgreSQL vector search", auto_tag: true)
|
|
102
|
-
# Internally: extracts ["database:postgresql", "database:vector-search"]
|
|
103
|
-
# and uses these to boost relevant results
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
**Implementation:**
|
|
107
|
-
- Use `find_query_matching_tags()` (already exists in LongTermMemory)
|
|
108
|
-
- Boost results that match extracted tags
|
|
109
|
-
- Make this opt-in or opt-out via configuration
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
### 5. Tag-Based Context Assembly
|
|
114
|
-
|
|
115
|
-
**Priority: Medium** - Topic-focused context building.
|
|
116
|
-
|
|
117
|
-
```ruby
|
|
118
|
-
# Assemble context prioritizing specific topic branches
|
|
119
|
-
htm.assemble_context(
|
|
120
|
-
token_budget: 4000,
|
|
121
|
-
focus_topics: ["database:postgresql", "ai:embeddings"],
|
|
122
|
-
strategy: :topic_balanced # New strategy
|
|
123
|
-
)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**Implementation:**
|
|
127
|
-
- Add `:topic_balanced` strategy to WorkingMemory
|
|
128
|
-
- Weight nodes by tag overlap with focus topics
|
|
129
|
-
- Ensure diverse topic coverage within budget
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
### 6. Ontology-Aware Related Memories
|
|
134
|
-
|
|
135
|
-
**Priority: Low** - Nice-to-have for exploration.
|
|
136
|
-
|
|
137
|
-
```ruby
|
|
138
|
-
# Find related memories via shared tags (not just vector similarity)
|
|
139
|
-
htm.related_by_topic(node_id)
|
|
140
|
-
# Returns nodes sharing the most tags, weighted by specificity
|
|
141
|
-
|
|
142
|
-
# Compare to existing vector-based similarity
|
|
143
|
-
htm.similar(node_id) # Vector similarity
|
|
144
|
-
htm.related_by_topic(node_id) # Tag-based similarity
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
**Implementation:**
|
|
148
|
-
- Count shared tags between nodes
|
|
149
|
-
- Weight by tag depth (more specific = higher weight)
|
|
150
|
-
- Combine with vector similarity for hybrid relatedness
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
### 7. Tag Model Enhancements
|
|
155
|
-
|
|
156
|
-
**Priority: Medium** - Better hierarchy navigation.
|
|
157
|
-
|
|
158
|
-
```ruby
|
|
159
|
-
# Add to HTM::Models::Tag
|
|
160
|
-
tag.parent # Parent tag (e.g., "database:postgresql" -> "database")
|
|
161
|
-
tag.children # Child tags (e.g., "database" -> ["database:postgresql", "database:mysql"])
|
|
162
|
-
tag.siblings # Same-level tags under same parent
|
|
163
|
-
tag.ancestors # All ancestors up to root
|
|
164
|
-
tag.descendants # All descendants (recursive)
|
|
165
|
-
|
|
166
|
-
# Class methods
|
|
167
|
-
Tag.roots # All root-level tags
|
|
168
|
-
Tag.at_depth(2) # All tags at specific depth
|
|
169
|
-
Tag.under("database") # All tags in this branch
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Implementation:**
|
|
173
|
-
- Parse colon-separated paths
|
|
174
|
-
- Use SQL LIKE queries for efficient hierarchy traversal
|
|
175
|
-
- Consider materialized path or nested set for performance at scale
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### 8. Tag-Based Grouping in Results
|
|
180
|
-
|
|
181
|
-
**Priority: Low** - Organizational feature.
|
|
182
|
-
|
|
183
|
-
```ruby
|
|
184
|
-
# Group results by their primary tag
|
|
185
|
-
results = htm.recall("query", group_by_tag: true)
|
|
186
|
-
# => {
|
|
187
|
-
# "database:postgresql" => [node1, node2],
|
|
188
|
-
# "ai:embeddings" => [node3, node4],
|
|
189
|
-
# "uncategorized" => [node5]
|
|
190
|
-
# }
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## Implementation Priority
|
|
196
|
-
|
|
197
|
-
### Phase 1 (High Value, Low Effort)
|
|
198
|
-
1. Expose existing `search_by_tags()` and `nodes_by_topic()` in HTM API
|
|
199
|
-
2. Wire `query_tags:` parameter through `recall()` for actual filtering
|
|
200
|
-
|
|
201
|
-
### Phase 2 (High Value, Medium Effort)
|
|
202
|
-
3. Add hierarchical query expansion (`expand_children:`, `expand_ancestors:`)
|
|
203
|
-
4. Add Tag model hierarchy methods (parent, children, ancestors, descendants)
|
|
204
|
-
|
|
205
|
-
### Phase 3 (Medium Value, Medium Effort)
|
|
206
|
-
5. Faceted search / tag aggregation
|
|
207
|
-
6. Semantic tag matching in recall (auto-extract from query)
|
|
208
|
-
7. Tag-based context assembly strategy
|
|
209
|
-
|
|
210
|
-
### Phase 4 (Nice to Have)
|
|
211
|
-
8. Ontology-aware related memories
|
|
212
|
-
9. Tag-based result grouping
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Notes
|
|
217
|
-
|
|
218
|
-
- All enhancements should maintain backward compatibility
|
|
219
|
-
- Consider adding configuration options for default behaviors
|
|
220
|
-
- Tag operations should be efficient (indexed queries)
|
|
221
|
-
- Consider caching popular tag queries
|
|
222
|
-
- Document new methods with YARD comments
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
# TimescaleDB Removal Summary
|
|
2
|
-
|
|
3
|
-
**Date:** 2025-10-28
|
|
4
|
-
**Decision:** Remove TimescaleDB extension from HTM gem as it does not add sufficient value
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
|
|
8
|
-
TimescaleDB was originally included in the HTM gem for time-series optimization capabilities. However, analysis revealed that:
|
|
9
|
-
|
|
10
|
-
1. **No hypertables were actually created** - The `setup_hypertables` method in `lib/htm/database.rb` was essentially a no-op with a comment stating "All tables use simple PRIMARY KEY (id), no hypertable conversions"
|
|
11
|
-
2. **Time-range queries use standard indexed columns** - The `created_at` column on `nodes` and `timestamp` column on `operations_log` are indexed using standard PostgreSQL B-tree indexes
|
|
12
|
-
3. **No compression policies were used** - Despite documentation mentioning compression, no actual compression was implemented
|
|
13
|
-
4. **Additional dependency overhead** - Required users to have TimescaleDB available even though it provided no actual benefit
|
|
14
|
-
|
|
15
|
-
## Code Files Modified
|
|
16
|
-
|
|
17
|
-
The following code files were modified to remove TimescaleDB:
|
|
18
|
-
|
|
19
|
-
### 1. `lib/htm/active_record_config.rb`
|
|
20
|
-
**Lines modified:** 71-74
|
|
21
|
-
|
|
22
|
-
**Changes:**
|
|
23
|
-
- Removed `'timescaledb' => 'TimescaleDB extension'` from the `required_extensions` hash in `verify_extensions!` method
|
|
24
|
-
|
|
25
|
-
**Before:**
|
|
26
|
-
```ruby
|
|
27
|
-
required_extensions = {
|
|
28
|
-
'timescaledb' => 'TimescaleDB extension',
|
|
29
|
-
'vector' => 'pgvector extension',
|
|
30
|
-
'pg_trgm' => 'PostgreSQL trigram extension'
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**After:**
|
|
35
|
-
```ruby
|
|
36
|
-
required_extensions = {
|
|
37
|
-
'vector' => 'pgvector extension',
|
|
38
|
-
'pg_trgm' => 'PostgreSQL trigram extension'
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 2. `lib/htm/database.rb`
|
|
43
|
-
**Multiple sections modified**
|
|
44
|
-
|
|
45
|
-
**Changes:**
|
|
46
|
-
- **Line 9:** Updated class documentation comment from "Handles schema creation and TimescaleDB hypertable setup" to "Handles schema creation and database initialization"
|
|
47
|
-
- **Lines 31-39:** Removed entire hypertable conversion block that called `setup_hypertables(conn)`
|
|
48
|
-
- **Lines 342-347:** Removed TimescaleDB version check from `verify_extensions` method
|
|
49
|
-
- **Lines 432-437:** Removed entire `setup_hypertables` method definition
|
|
50
|
-
|
|
51
|
-
**Impact:** The Database class now only handles standard PostgreSQL schema setup without any TimescaleDB-specific code.
|
|
52
|
-
|
|
53
|
-
### 3. `db/README.md`
|
|
54
|
-
**Lines modified:** 29, 127
|
|
55
|
-
|
|
56
|
-
**Changes:**
|
|
57
|
-
- **Line 29:** Changed "Vector similarity search (pgvector on TimescaleDB Cloud)" to "Vector similarity search (pgvector)"
|
|
58
|
-
- **Line 127:** Removed "**TimescaleDB** extension (optional, for hypertables)" from Database Requirements section
|
|
59
|
-
|
|
60
|
-
### 4. `lib/tasks/htm.rake`
|
|
61
|
-
**Lines modified:** 67-73
|
|
62
|
-
|
|
63
|
-
**Changes:**
|
|
64
|
-
- Removed TimescaleDB version check from the `htm:db:test` rake task
|
|
65
|
-
|
|
66
|
-
**Before:**
|
|
67
|
-
```ruby
|
|
68
|
-
# Check TimescaleDB
|
|
69
|
-
timescale = conn.exec("SELECT extversion FROM pg_extension WHERE extname='timescaledb'").first
|
|
70
|
-
if timescale
|
|
71
|
-
puts " ✓ TimescaleDB version: #{timescale['extversion']}"
|
|
72
|
-
else
|
|
73
|
-
puts " ⚠ Warning: TimescaleDB extension not found"
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
# Check pgvector
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
**After:**
|
|
80
|
-
```ruby
|
|
81
|
-
# Check pgvector
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Other Potentially Impacted Files
|
|
85
|
-
|
|
86
|
-
A codebase-wide search revealed **114 total files** containing references to "TimescaleDB", "timescaledb", or "hypertable". These fall into the following categories:
|
|
87
|
-
|
|
88
|
-
### Documentation Files
|
|
89
|
-
- `README.md` - Main project documentation
|
|
90
|
-
- `CLAUDE.md` - AI assistant context documentation
|
|
91
|
-
- `.architecture/` directory - Architecture Decision Records (ADRs) and reviews
|
|
92
|
-
- `dbdoc/` directory - Auto-generated database documentation (120+ files)
|
|
93
|
-
|
|
94
|
-
### Test Files
|
|
95
|
-
- `test/` directory - Unit and integration tests may reference TimescaleDB in comments or mock data
|
|
96
|
-
|
|
97
|
-
### Example Files
|
|
98
|
-
- `examples/` directory - Example code may mention TimescaleDB in documentation
|
|
99
|
-
|
|
100
|
-
### Migration Files
|
|
101
|
-
- `db/migrate/` directory - Migration files may have comments referencing TimescaleDB optimization
|
|
102
|
-
|
|
103
|
-
## Recommended Follow-up Actions
|
|
104
|
-
|
|
105
|
-
### High Priority
|
|
106
|
-
1. **Update README.md** - Remove TimescaleDB from installation instructions and feature descriptions
|
|
107
|
-
2. **Update CLAUDE.md** - Remove TimescaleDB references from project overview and architecture descriptions
|
|
108
|
-
3. **Review ADRs** - Update or create new ADR documenting the decision to remove TimescaleDB
|
|
109
|
-
|
|
110
|
-
### Medium Priority
|
|
111
|
-
4. **Update test files** - Remove TimescaleDB references from test comments and documentation
|
|
112
|
-
5. **Update example code** - Remove TimescaleDB mentions from example documentation
|
|
113
|
-
6. **Regenerate dbdoc/** - Run `tbls` again to regenerate database documentation without TimescaleDB references
|
|
114
|
-
|
|
115
|
-
### Low Priority
|
|
116
|
-
7. **Update migration comments** - Clean up any comments in migration files that reference TimescaleDB optimization
|
|
117
|
-
8. **Review dependencies** - Verify that `Gemfile` or gemspec doesn't list TimescaleDB as a requirement (not found in initial search)
|
|
118
|
-
|
|
119
|
-
## Benefits of Removal
|
|
120
|
-
|
|
121
|
-
1. **Simplified deployment** - Users no longer need TimescaleDB-enabled PostgreSQL instances
|
|
122
|
-
2. **Reduced complexity** - One less extension to manage and verify
|
|
123
|
-
3. **Broader compatibility** - Works with any PostgreSQL 12+ installation (not just TimescaleDB Cloud or self-hosted TimescaleDB)
|
|
124
|
-
4. **Clearer documentation** - Removes confusion about TimescaleDB's role (since it wasn't actually used)
|
|
125
|
-
5. **Honest architecture** - Codebase now accurately reflects what it actually uses
|
|
126
|
-
|
|
127
|
-
## No Loss of Functionality
|
|
128
|
-
|
|
129
|
-
Removing TimescaleDB results in **zero loss of functionality** because:
|
|
130
|
-
|
|
131
|
-
- No hypertables were created
|
|
132
|
-
- No compression policies were used
|
|
133
|
-
- Time-range queries already use standard B-tree indexes
|
|
134
|
-
- All existing queries continue to work identically
|
|
135
|
-
- Performance characteristics remain unchanged
|
|
136
|
-
|
|
137
|
-
## Database Requirements After Removal
|
|
138
|
-
|
|
139
|
-
The HTM gem now requires:
|
|
140
|
-
|
|
141
|
-
- **PostgreSQL** 12+
|
|
142
|
-
- **vector** extension (pgvector) - for embedding similarity search
|
|
143
|
-
- **pg_trgm** extension - for fuzzy text matching
|
|
144
|
-
|
|
145
|
-
No TimescaleDB required.
|
|
146
|
-
|
|
147
|
-
## Testing Verification
|
|
148
|
-
|
|
149
|
-
After these changes, verify:
|
|
150
|
-
|
|
151
|
-
1. **Database setup works:**
|
|
152
|
-
```bash
|
|
153
|
-
rake htm:db:setup
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
2. **Database connection test works:**
|
|
157
|
-
```bash
|
|
158
|
-
rake htm:db:test
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
3. **All tests pass:**
|
|
162
|
-
```bash
|
|
163
|
-
rake test
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
4. **Example code runs:**
|
|
167
|
-
```bash
|
|
168
|
-
rake example
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## Git Commit Message Suggestion
|
|
172
|
-
|
|
173
|
-
```
|
|
174
|
-
refactor!: remove TimescaleDB extension dependency
|
|
175
|
-
|
|
176
|
-
BREAKING CHANGE: TimescaleDB is no longer required or checked for.
|
|
177
|
-
|
|
178
|
-
TimescaleDB was originally included for time-series optimization
|
|
179
|
-
but was never actually used (no hypertables were created, no
|
|
180
|
-
compression policies configured). Time-range queries use standard
|
|
181
|
-
PostgreSQL B-tree indexes on timestamp columns.
|
|
182
|
-
|
|
183
|
-
This change:
|
|
184
|
-
- Removes TimescaleDB from required extensions check
|
|
185
|
-
- Removes verify_extensions and setup_hypertables methods
|
|
186
|
-
- Updates documentation to reflect PostgreSQL-only requirements
|
|
187
|
-
- Simplifies deployment by removing unnecessary dependency
|
|
188
|
-
|
|
189
|
-
No functionality is lost as TimescaleDB features were not being used.
|
|
190
|
-
|
|
191
|
-
Modified files:
|
|
192
|
-
- lib/htm/active_record_config.rb
|
|
193
|
-
- lib/htm/database.rb
|
|
194
|
-
- db/README.md
|
|
195
|
-
- lib/tasks/htm.rake
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
## Conclusion
|
|
199
|
-
|
|
200
|
-
The removal of TimescaleDB from the HTM gem is a **low-risk refactoring** that simplifies the architecture and deployment requirements without any loss of functionality. All code changes have been completed in the core library files, with follow-up documentation updates recommended.
|