htm 0.0.2 → 0.0.10
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/.aigcm_msg +1 -0
- data/.architecture/reviews/comprehensive-codebase-review.md +577 -0
- data/.claude/settings.local.json +92 -0
- data/.irbrc +283 -80
- data/.tbls.yml +2 -1
- data/CHANGELOG.md +294 -26
- data/CLAUDE.md +603 -0
- data/README.md +76 -5
- data/Rakefile +5 -0
- data/db/migrate/{20250101000001_enable_extensions.rb → 00001_enable_extensions.rb} +0 -1
- data/db/migrate/00002_create_robots.rb +11 -0
- data/db/migrate/00003_create_file_sources.rb +20 -0
- data/db/migrate/00004_create_nodes.rb +65 -0
- data/db/migrate/00005_create_tags.rb +13 -0
- data/db/migrate/00006_create_node_tags.rb +18 -0
- data/db/migrate/00007_create_robot_nodes.rb +26 -0
- data/db/migrate/00009_add_working_memory_to_robot_nodes.rb +12 -0
- data/db/schema.sql +172 -1
- data/docs/api/database.md +1 -2
- data/docs/api/htm.md +197 -2
- data/docs/api/yard/HTM/ActiveRecordConfig.md +23 -0
- data/docs/api/yard/HTM/AuthorizationError.md +11 -0
- data/docs/api/yard/HTM/CircuitBreaker.md +92 -0
- data/docs/api/yard/HTM/CircuitBreakerOpenError.md +34 -0
- data/docs/api/yard/HTM/Configuration.md +175 -0
- data/docs/api/yard/HTM/Database.md +99 -0
- data/docs/api/yard/HTM/DatabaseError.md +14 -0
- data/docs/api/yard/HTM/EmbeddingError.md +18 -0
- data/docs/api/yard/HTM/EmbeddingService.md +58 -0
- data/docs/api/yard/HTM/Error.md +11 -0
- data/docs/api/yard/HTM/JobAdapter.md +39 -0
- data/docs/api/yard/HTM/LongTermMemory.md +342 -0
- data/docs/api/yard/HTM/NotFoundError.md +17 -0
- data/docs/api/yard/HTM/Observability.md +107 -0
- data/docs/api/yard/HTM/QueryTimeoutError.md +19 -0
- data/docs/api/yard/HTM/Railtie.md +27 -0
- data/docs/api/yard/HTM/ResourceExhaustedError.md +13 -0
- data/docs/api/yard/HTM/TagError.md +18 -0
- data/docs/api/yard/HTM/TagService.md +67 -0
- data/docs/api/yard/HTM/Timeframe/Result.md +24 -0
- data/docs/api/yard/HTM/Timeframe.md +40 -0
- data/docs/api/yard/HTM/TimeframeExtractor/Result.md +24 -0
- data/docs/api/yard/HTM/TimeframeExtractor.md +45 -0
- data/docs/api/yard/HTM/ValidationError.md +20 -0
- data/docs/api/yard/HTM/WorkingMemory.md +131 -0
- data/docs/api/yard/HTM.md +80 -0
- data/docs/api/yard/index.csv +179 -0
- data/docs/api/yard-reference.md +51 -0
- data/docs/database/README.md +128 -128
- data/docs/database/public.file_sources.md +42 -0
- data/docs/database/public.file_sources.svg +211 -0
- data/docs/database/public.node_tags.md +4 -4
- data/docs/database/public.node_tags.svg +212 -79
- data/docs/database/public.nodes.md +22 -12
- data/docs/database/public.nodes.svg +246 -127
- data/docs/database/public.robot_nodes.md +11 -9
- data/docs/database/public.robot_nodes.svg +220 -98
- data/docs/database/public.robots.md +2 -2
- data/docs/database/public.robots.svg +136 -81
- data/docs/database/public.tags.md +3 -3
- data/docs/database/public.tags.svg +118 -39
- data/docs/database/schema.json +850 -771
- data/docs/database/schema.svg +256 -197
- data/docs/development/schema.md +67 -2
- data/docs/guides/adding-memories.md +93 -7
- data/docs/guides/recalling-memories.md +36 -1
- data/examples/README.md +280 -0
- data/examples/cli_app/htm_cli.rb +65 -5
- data/examples/cli_app/temp.log +93 -0
- data/examples/file_loader_usage.rb +177 -0
- data/examples/robot_groups/lib/robot_group.rb +419 -0
- data/examples/robot_groups/lib/working_memory_channel.rb +140 -0
- data/examples/robot_groups/multi_process.rb +286 -0
- data/examples/robot_groups/robot_worker.rb +136 -0
- data/examples/robot_groups/same_process.rb +229 -0
- data/examples/timeframe_demo.rb +276 -0
- data/lib/htm/active_record_config.rb +1 -1
- data/lib/htm/circuit_breaker.rb +202 -0
- data/lib/htm/configuration.rb +59 -13
- data/lib/htm/database.rb +67 -36
- data/lib/htm/embedding_service.rb +39 -2
- data/lib/htm/errors.rb +131 -11
- data/lib/htm/jobs/generate_embedding_job.rb +5 -4
- data/lib/htm/jobs/generate_tags_job.rb +4 -0
- data/lib/htm/loaders/markdown_loader.rb +263 -0
- data/lib/htm/loaders/paragraph_chunker.rb +112 -0
- data/lib/htm/long_term_memory.rb +460 -343
- data/lib/htm/models/file_source.rb +99 -0
- data/lib/htm/models/node.rb +80 -5
- data/lib/htm/models/robot.rb +24 -1
- data/lib/htm/models/robot_node.rb +1 -0
- data/lib/htm/models/tag.rb +254 -4
- data/lib/htm/observability.rb +395 -0
- data/lib/htm/tag_service.rb +60 -3
- data/lib/htm/tasks.rb +26 -1
- data/lib/htm/timeframe.rb +194 -0
- data/lib/htm/timeframe_extractor.rb +307 -0
- data/lib/htm/version.rb +1 -1
- data/lib/htm/working_memory.rb +165 -70
- data/lib/htm.rb +328 -130
- data/lib/tasks/doc.rake +300 -0
- data/lib/tasks/files.rake +299 -0
- data/lib/tasks/htm.rake +158 -3
- data/lib/tasks/jobs.rake +3 -9
- data/lib/tasks/tags.rake +166 -6
- data/mkdocs.yml +36 -1
- data/notes/ARCHITECTURE_REVIEW.md +1167 -0
- data/notes/IMPLEMENTATION_SUMMARY.md +606 -0
- data/notes/MULTI_FRAMEWORK_IMPLEMENTATION.md +451 -0
- data/notes/next_steps.md +100 -0
- data/notes/plan.md +627 -0
- data/notes/tag_ontology_enhancement_ideas.md +222 -0
- data/notes/timescaledb_removal_summary.md +200 -0
- metadata +125 -15
- data/db/migrate/20250101000002_create_robots.rb +0 -14
- data/db/migrate/20250101000003_create_nodes.rb +0 -42
- data/db/migrate/20250101000005_create_tags.rb +0 -38
- data/db/migrate/20250101000007_add_node_vector_indexes.rb +0 -30
- data/db/migrate/20250125000001_add_content_hash_to_nodes.rb +0 -14
- data/db/migrate/20250125000002_create_robot_nodes.rb +0 -35
- data/db/migrate/20250125000003_remove_source_and_robot_id_from_nodes.rb +0 -28
- data/db/migrate/20250126000001_create_working_memories.rb +0 -19
- data/db/migrate/20250126000002_remove_unused_columns.rb +0 -12
- data/docs/database/public.working_memories.md +0 -40
- data/docs/database/public.working_memories.svg +0 -112
- data/lib/htm/models/working_memory_entry.rb +0 -88
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Class: HTM::TagService
|
|
2
|
+
**Inherits:** Object
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Tag Service - Processes and validates hierarchical tags
|
|
6
|
+
|
|
7
|
+
This service wraps the configured tag extractor and provides:
|
|
8
|
+
* Response parsing (string or array)
|
|
9
|
+
* Format validation (lowercase, alphanumeric, hyphens, colons)
|
|
10
|
+
* Depth validation (max 5 levels)
|
|
11
|
+
* Ontology consistency
|
|
12
|
+
* Circuit breaker protection for external LLM failures
|
|
13
|
+
|
|
14
|
+
The actual LLM call is delegated to HTM.configuration.tag_extractor
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Class Methods
|
|
18
|
+
## circuit_breaker() {: #method-c-circuit_breaker }
|
|
19
|
+
Get or create the circuit breaker for tag service
|
|
20
|
+
**`@return`** [HTM::CircuitBreaker] The circuit breaker instance
|
|
21
|
+
|
|
22
|
+
## extract(content , existing_ontology: []) {: #method-c-extract }
|
|
23
|
+
Extract tags with validation and processing
|
|
24
|
+
**`@param`** [String] Text to analyze
|
|
25
|
+
|
|
26
|
+
**`@param`** [Array<String>] Sample of existing tags for context
|
|
27
|
+
|
|
28
|
+
**`@raise`** [CircuitBreakerOpenError] If circuit breaker is open
|
|
29
|
+
|
|
30
|
+
**`@return`** [Array<String>] Validated tag names
|
|
31
|
+
|
|
32
|
+
## parse_hierarchy(tag ) {: #method-c-parse_hierarchy }
|
|
33
|
+
Parse hierarchical structure of a tag
|
|
34
|
+
**`@param`** [String] Hierarchical tag (e.g., "ai:llm:embedding")
|
|
35
|
+
|
|
36
|
+
**`@return`** [Hash] Hierarchy structure
|
|
37
|
+
{
|
|
38
|
+
full: "ai:llm:embedding",
|
|
39
|
+
root: "ai",
|
|
40
|
+
parent: "ai:llm",
|
|
41
|
+
levels: ["ai", "llm", "embedding"],
|
|
42
|
+
depth: 3
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
## parse_tags(raw_tags ) {: #method-c-parse_tags }
|
|
46
|
+
Parse tag response (handles string or array input)
|
|
47
|
+
**`@param`** [String, Array] Raw response from extractor
|
|
48
|
+
|
|
49
|
+
**`@return`** [Array<String>] Parsed tag strings
|
|
50
|
+
|
|
51
|
+
## reset_circuit_breaker!() {: #method-c-reset_circuit_breaker! }
|
|
52
|
+
Reset the circuit breaker (useful for testing)
|
|
53
|
+
**`@return`** [void]
|
|
54
|
+
|
|
55
|
+
## valid_tag?(tag ) {: #method-c-valid_tag? }
|
|
56
|
+
Validate single tag format
|
|
57
|
+
**`@param`** [String] Tag to validate
|
|
58
|
+
|
|
59
|
+
**`@return`** [Boolean] True if valid
|
|
60
|
+
|
|
61
|
+
## validate_and_filter_tags(tags ) {: #method-c-validate_and_filter_tags }
|
|
62
|
+
Validate and filter tags
|
|
63
|
+
**`@param`** [Array<String>] Parsed tags
|
|
64
|
+
|
|
65
|
+
**`@return`** [Array<String>] Valid tags only
|
|
66
|
+
|
|
67
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Class: HTM::Timeframe::Result
|
|
2
|
+
**Inherits:** Struct
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Result structure for :auto mode
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Attributes
|
|
9
|
+
## extracted[RW] {: #attribute-i-extracted }
|
|
10
|
+
Returns the value of attribute extracted
|
|
11
|
+
|
|
12
|
+
**`@return`** [Object] the current value of extracted
|
|
13
|
+
|
|
14
|
+
## query[RW] {: #attribute-i-query }
|
|
15
|
+
Returns the value of attribute query
|
|
16
|
+
|
|
17
|
+
**`@return`** [Object] the current value of query
|
|
18
|
+
|
|
19
|
+
## timeframe[RW] {: #attribute-i-timeframe }
|
|
20
|
+
Returns the value of attribute timeframe
|
|
21
|
+
|
|
22
|
+
**`@return`** [Object] the current value of timeframe
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Class: HTM::Timeframe
|
|
2
|
+
**Inherits:** Object
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Timeframe - Normalizes various timeframe inputs for database queries
|
|
6
|
+
|
|
7
|
+
Handles multiple input types and normalizes them to either:
|
|
8
|
+
* nil (no timeframe filter)
|
|
9
|
+
* Range (single time window)
|
|
10
|
+
* Array<Range> (multiple time windows, OR'd together)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
**`@example`**
|
|
14
|
+
```ruby
|
|
15
|
+
Timeframe.normalize(nil) # => nil (no filter)
|
|
16
|
+
Timeframe.normalize(Date.today) # => Range for entire day
|
|
17
|
+
Timeframe.normalize(Time.now) # => Range for entire day
|
|
18
|
+
Timeframe.normalize("last week") # => Range from chronic/extractor
|
|
19
|
+
Timeframe.normalize(:auto, query: "...") # => Extract from query text
|
|
20
|
+
Timeframe.normalize(range1..range2) # => Pass through
|
|
21
|
+
Timeframe.normalize([range1, range2]) # => Array of ranges
|
|
22
|
+
```
|
|
23
|
+
# Class Methods
|
|
24
|
+
## normalize(input , query: nil) {: #method-c-normalize }
|
|
25
|
+
Normalize a timeframe input to nil, Range, or Array<Range>
|
|
26
|
+
**`@param`** [nil, Range, Array, Date, DateTime, Time, String, Symbol] Timeframe specification
|
|
27
|
+
|
|
28
|
+
**`@param`** [String, nil] Query text (required when input is :auto)
|
|
29
|
+
|
|
30
|
+
**`@return`** [nil, Range, Array<Range>] Normalized timeframe
|
|
31
|
+
|
|
32
|
+
**`@return`** [Result] When input is :auto, returns Result with :timeframe, :query, :extracted
|
|
33
|
+
|
|
34
|
+
## valid?(input ) {: #method-c-valid? }
|
|
35
|
+
Check if a value is a valid timeframe input
|
|
36
|
+
**`@param`** [Object] Value to check
|
|
37
|
+
|
|
38
|
+
**`@return`** [Boolean]
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Class: HTM::TimeframeExtractor::Result
|
|
2
|
+
**Inherits:** Struct
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Result structure for extracted timeframe
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Attributes
|
|
9
|
+
## original_expression[RW] {: #attribute-i-original_expression }
|
|
10
|
+
Returns the value of attribute original_expression
|
|
11
|
+
|
|
12
|
+
**`@return`** [Object] the current value of original_expression
|
|
13
|
+
|
|
14
|
+
## query[RW] {: #attribute-i-query }
|
|
15
|
+
Returns the value of attribute query
|
|
16
|
+
|
|
17
|
+
**`@return`** [Object] the current value of query
|
|
18
|
+
|
|
19
|
+
## timeframe[RW] {: #attribute-i-timeframe }
|
|
20
|
+
Returns the value of attribute timeframe
|
|
21
|
+
|
|
22
|
+
**`@return`** [Object] the current value of timeframe
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Class: HTM::TimeframeExtractor
|
|
2
|
+
**Inherits:** Object
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Timeframe Extractor - Extracts temporal expressions from queries
|
|
6
|
+
|
|
7
|
+
This service parses natural language time expressions from recall queries and
|
|
8
|
+
returns both the timeframe and the cleaned query text.
|
|
9
|
+
|
|
10
|
+
Supports:
|
|
11
|
+
* Standard time expressions via Chronic gem ("yesterday", "last week", etc.)
|
|
12
|
+
* "few" keyword mapped to FEW constant (e.g., "few days ago" → "3 days ago")
|
|
13
|
+
* "recent/recently" without units defaults to FEW days
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
**`@example`**
|
|
17
|
+
```ruby
|
|
18
|
+
result = TimeframeExtractor.extract("what did we discuss last week about PostgreSQL")
|
|
19
|
+
result[:query] # => "what did we discuss about PostgreSQL"
|
|
20
|
+
result[:timeframe] # => #<Range: 2025-11-21..2025-11-28>
|
|
21
|
+
```
|
|
22
|
+
**`@example`**
|
|
23
|
+
```ruby
|
|
24
|
+
result = TimeframeExtractor.extract("show me notes from a few days ago")
|
|
25
|
+
result[:timeframe] # => Time object for 3 days ago
|
|
26
|
+
```
|
|
27
|
+
**`@example`**
|
|
28
|
+
```ruby
|
|
29
|
+
result = TimeframeExtractor.extract("what did we recently discuss")
|
|
30
|
+
result[:timeframe] # => Range from 3 days ago to now
|
|
31
|
+
```
|
|
32
|
+
# Class Methods
|
|
33
|
+
## extract(query ) {: #method-c-extract }
|
|
34
|
+
Extract timeframe from a query string
|
|
35
|
+
**`@param`** [String] The query to parse
|
|
36
|
+
|
|
37
|
+
**`@return`** [Result] Struct with :query (cleaned), :timeframe, :original_expression
|
|
38
|
+
|
|
39
|
+
## temporal?(query ) {: #method-c-temporal? }
|
|
40
|
+
Check if query contains a temporal expression
|
|
41
|
+
**`@param`** [String] The query to check
|
|
42
|
+
|
|
43
|
+
**`@return`** [Boolean]
|
|
44
|
+
|
|
45
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Exception: HTM::ValidationError
|
|
2
|
+
**Inherits:** HTM::Error
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Raised when input validation fails
|
|
6
|
+
|
|
7
|
+
Common causes:
|
|
8
|
+
* Empty or nil content for remember()
|
|
9
|
+
* Content exceeding maximum size limit
|
|
10
|
+
* Invalid tag format
|
|
11
|
+
* Invalid recall strategy
|
|
12
|
+
* Invalid timeframe format
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
**`@example`**
|
|
16
|
+
```ruby
|
|
17
|
+
htm.remember("") # => raises ValidationError
|
|
18
|
+
htm.remember("x", tags: ["INVALID!"]) # => raises ValidationError
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Class: HTM::WorkingMemory
|
|
2
|
+
**Inherits:** Object
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Working Memory - Token-limited active context for immediate LLM use
|
|
6
|
+
|
|
7
|
+
WorkingMemory manages the active conversation context within token limits.
|
|
8
|
+
When full, it evicts less important or older nodes back to long-term storage.
|
|
9
|
+
|
|
10
|
+
Thread Safety: All public methods are protected by a mutex to ensure safe
|
|
11
|
+
concurrent access from multiple threads.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Attributes
|
|
15
|
+
## max_tokens[RW] {: #attribute-i-max_tokens }
|
|
16
|
+
Returns the value of attribute max_tokens.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Instance Methods
|
|
20
|
+
## add(key, value, token_count:, access_count:0, last_accessed:nil, from_recall:false) {: #method-i-add }
|
|
21
|
+
Add a node to working memory
|
|
22
|
+
|
|
23
|
+
**`@param`** [String] Node identifier
|
|
24
|
+
|
|
25
|
+
**`@param`** [String] Node content
|
|
26
|
+
|
|
27
|
+
**`@param`** [Integer] Number of tokens in this node
|
|
28
|
+
|
|
29
|
+
**`@param`** [Integer] Access count from long-term memory (default: 0)
|
|
30
|
+
|
|
31
|
+
**`@param`** [Time, nil] Last access time from long-term memory
|
|
32
|
+
|
|
33
|
+
**`@param`** [Boolean] Whether this node was recalled from long-term memory
|
|
34
|
+
|
|
35
|
+
**`@return`** [void]
|
|
36
|
+
|
|
37
|
+
## add_from_sync(id:, content:, token_count:, created_at:) {: #method-i-add_from_sync }
|
|
38
|
+
Add a node from sync notification (bypasses normal add flow)
|
|
39
|
+
|
|
40
|
+
Called by RobotGroup when another robot adds to working memory. Does not
|
|
41
|
+
trigger notifications to avoid infinite loops.
|
|
42
|
+
|
|
43
|
+
**`@param`** [Integer] Node database ID
|
|
44
|
+
|
|
45
|
+
**`@param`** [String] Node content
|
|
46
|
+
|
|
47
|
+
**`@param`** [Integer] Token count
|
|
48
|
+
|
|
49
|
+
**`@param`** [Time] When node was created
|
|
50
|
+
|
|
51
|
+
**`@return`** [void]
|
|
52
|
+
|
|
53
|
+
## assemble_context(strategy:, max_tokens:nil) {: #method-i-assemble_context }
|
|
54
|
+
Assemble context string for LLM
|
|
55
|
+
|
|
56
|
+
**`@param`** [Symbol] Assembly strategy (:recent, :frequent, :balanced)
|
|
57
|
+
- :recent - Most recently accessed (LRU)
|
|
58
|
+
- :frequent - Most frequently accessed (LFU)
|
|
59
|
+
- :balanced - Combines frequency × recency
|
|
60
|
+
|
|
61
|
+
**`@param`** [Integer, nil] Optional token limit
|
|
62
|
+
|
|
63
|
+
**`@return`** [String] Assembled context
|
|
64
|
+
|
|
65
|
+
## clear() {: #method-i-clear }
|
|
66
|
+
Clear all nodes from working memory
|
|
67
|
+
|
|
68
|
+
**`@return`** [void]
|
|
69
|
+
|
|
70
|
+
## clear_from_sync() {: #method-i-clear_from_sync }
|
|
71
|
+
Clear all nodes from sync notification
|
|
72
|
+
|
|
73
|
+
Called by RobotGroup when another robot clears working memory.
|
|
74
|
+
|
|
75
|
+
**`@return`** [void]
|
|
76
|
+
|
|
77
|
+
## evict_to_make_space(needed_tokens) {: #method-i-evict_to_make_space }
|
|
78
|
+
Evict nodes to make space
|
|
79
|
+
|
|
80
|
+
Uses LFU + LRU strategy: Least Frequently Used + Least Recently Used Nodes
|
|
81
|
+
with low access count and old timestamps are evicted first
|
|
82
|
+
|
|
83
|
+
**`@param`** [Integer] Number of tokens needed
|
|
84
|
+
|
|
85
|
+
**`@return`** [Array<Hash>] Evicted nodes
|
|
86
|
+
|
|
87
|
+
## has_space?(token_count) {: #method-i-has_space? }
|
|
88
|
+
Check if there's space for a node
|
|
89
|
+
|
|
90
|
+
**`@param`** [Integer] Number of tokens needed
|
|
91
|
+
|
|
92
|
+
**`@return`** [Boolean] true if space available
|
|
93
|
+
|
|
94
|
+
## initialize(max_tokens:) {: #method-i-initialize }
|
|
95
|
+
Initialize working memory
|
|
96
|
+
|
|
97
|
+
**`@param`** [Integer] Maximum tokens allowed in working memory
|
|
98
|
+
|
|
99
|
+
**`@return`** [WorkingMemory] a new instance of WorkingMemory
|
|
100
|
+
|
|
101
|
+
## node_count() {: #method-i-node_count }
|
|
102
|
+
Get node count
|
|
103
|
+
|
|
104
|
+
**`@return`** [Integer] Number of nodes in working memory
|
|
105
|
+
|
|
106
|
+
## remove(key) {: #method-i-remove }
|
|
107
|
+
Remove a node from working memory
|
|
108
|
+
|
|
109
|
+
**`@param`** [String] Node identifier
|
|
110
|
+
|
|
111
|
+
**`@return`** [void]
|
|
112
|
+
|
|
113
|
+
## remove_from_sync(node_id) {: #method-i-remove_from_sync }
|
|
114
|
+
Remove a node from sync notification
|
|
115
|
+
|
|
116
|
+
Called by RobotGroup when another robot evicts from working memory.
|
|
117
|
+
|
|
118
|
+
**`@param`** [Integer] Node database ID
|
|
119
|
+
|
|
120
|
+
**`@return`** [void]
|
|
121
|
+
|
|
122
|
+
## token_count() {: #method-i-token_count }
|
|
123
|
+
Get current token count
|
|
124
|
+
|
|
125
|
+
**`@return`** [Integer] Total tokens in working memory
|
|
126
|
+
|
|
127
|
+
## utilization_percentage() {: #method-i-utilization_percentage }
|
|
128
|
+
Get utilization percentage
|
|
129
|
+
|
|
130
|
+
**`@return`** [Float] Percentage of working memory used
|
|
131
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Class: HTM
|
|
2
|
+
**Inherits:** Object
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
HTM (Hierarchical Temporary Memory) error classes
|
|
6
|
+
|
|
7
|
+
All HTM errors inherit from HTM::Error, allowing you to catch all HTM-related
|
|
8
|
+
errors with a single rescue clause.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
**`@example`**
|
|
12
|
+
```ruby
|
|
13
|
+
begin
|
|
14
|
+
htm.remember("some content")
|
|
15
|
+
rescue HTM::Error => e
|
|
16
|
+
logger.error "HTM error: #{e.message}"
|
|
17
|
+
end
|
|
18
|
+
```
|
|
19
|
+
**`@example`**
|
|
20
|
+
```ruby
|
|
21
|
+
begin
|
|
22
|
+
htm.forget(node_id, soft: false)
|
|
23
|
+
rescue HTM::NotFoundError
|
|
24
|
+
puts "Node not found"
|
|
25
|
+
rescue HTM::ValidationError
|
|
26
|
+
puts "Invalid input"
|
|
27
|
+
end
|
|
28
|
+
```
|
|
29
|
+
# Class Methods
|
|
30
|
+
## configure() {: #method-c-configure }
|
|
31
|
+
Configure HTM
|
|
32
|
+
**`@yield`** [config] Configuration object
|
|
33
|
+
|
|
34
|
+
**`@yieldparam`** [HTM::Configuration]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
**`@example`**
|
|
38
|
+
```ruby
|
|
39
|
+
HTM.configure do |config|
|
|
40
|
+
config.embedding_generator = ->(text) { MyEmbedder.embed(text) }
|
|
41
|
+
config.tag_extractor = ->(text, ontology) { MyTagger.extract(text, ontology) }
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
**`@example`**
|
|
45
|
+
```ruby
|
|
46
|
+
HTM.configure # Uses RubyLLM defaults
|
|
47
|
+
```
|
|
48
|
+
## count_tokens(text ) {: #method-c-count_tokens }
|
|
49
|
+
Count tokens using configured counter
|
|
50
|
+
**`@param`** [String] Text to count tokens for
|
|
51
|
+
|
|
52
|
+
**`@return`** [Integer] Token count
|
|
53
|
+
|
|
54
|
+
## embed(text ) {: #method-c-embed }
|
|
55
|
+
Generate embedding using EmbeddingService
|
|
56
|
+
**`@param`** [String] Text to embed
|
|
57
|
+
|
|
58
|
+
**`@return`** [Array<Float>] Embedding vector (original, not padded)
|
|
59
|
+
|
|
60
|
+
## extract_tags(text , existing_ontology: []) {: #method-c-extract_tags }
|
|
61
|
+
Extract tags using TagService
|
|
62
|
+
**`@param`** [String] Text to analyze
|
|
63
|
+
|
|
64
|
+
**`@param`** [Array<String>] Sample of existing tags for context
|
|
65
|
+
|
|
66
|
+
**`@return`** [Array<String>] Extracted and validated tag names
|
|
67
|
+
|
|
68
|
+
## logger() {: #method-c-logger }
|
|
69
|
+
Get configured logger
|
|
70
|
+
**`@return`** [Logger] Configured logger instance
|
|
71
|
+
|
|
72
|
+
## reset_configuration!() {: #method-c-reset_configuration! }
|
|
73
|
+
Reset configuration to defaults
|
|
74
|
+
# Attributes
|
|
75
|
+
## configuration[RW] {: #attribute-c-configuration }
|
|
76
|
+
Get current configuration
|
|
77
|
+
|
|
78
|
+
**`@return`** [HTM::Configuration]
|
|
79
|
+
|
|
80
|
+
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
name,type,path
|
|
2
|
+
HTM::JobAdapter,Module,HTM/JobAdapter.md
|
|
3
|
+
HTM::JobAdapter.enqueue,Method,HTM/JobAdapter.md#method-c-enqueue
|
|
4
|
+
HTM::Observability,Module,HTM/Observability.md
|
|
5
|
+
HTM::Observability.cache_stats,Method,HTM/Observability.md#method-c-cache_stats
|
|
6
|
+
HTM::Observability.circuit_breaker_stats,Method,HTM/Observability.md#method-c-circuit_breaker_stats
|
|
7
|
+
HTM::Observability.collect_all,Method,HTM/Observability.md#method-c-collect_all
|
|
8
|
+
HTM::Observability.connection_pool_stats,Method,HTM/Observability.md#method-c-connection_pool_stats
|
|
9
|
+
HTM::Observability.health_check,Method,HTM/Observability.md#method-c-health_check
|
|
10
|
+
HTM::Observability.healthy?,Method,HTM/Observability.md#method-c-healthy?
|
|
11
|
+
HTM::Observability.memory_stats,Method,HTM/Observability.md#method-c-memory_stats
|
|
12
|
+
HTM::Observability.query_timing_stats,Method,HTM/Observability.md#method-c-query_timing_stats
|
|
13
|
+
HTM::Observability.record_embedding_timing,Method,HTM/Observability.md#method-c-record_embedding_timing
|
|
14
|
+
HTM::Observability.record_query_timing,Method,HTM/Observability.md#method-c-record_query_timing
|
|
15
|
+
HTM::Observability.record_tag_timing,Method,HTM/Observability.md#method-c-record_tag_timing
|
|
16
|
+
HTM::Observability.reset_metrics!,Method,HTM/Observability.md#method-c-reset_metrics!
|
|
17
|
+
HTM::Observability.service_timing_stats,Method,HTM/Observability.md#method-c-service_timing_stats
|
|
18
|
+
HTM,Class,HTM.md
|
|
19
|
+
HTM.configure,Method,HTM.md#method-c-configure
|
|
20
|
+
HTM.count_tokens,Method,HTM.md#method-c-count_tokens
|
|
21
|
+
HTM.embed,Method,HTM.md#method-c-embed
|
|
22
|
+
HTM.extract_tags,Method,HTM.md#method-c-extract_tags
|
|
23
|
+
HTM.logger,Method,HTM.md#method-c-logger
|
|
24
|
+
HTM.reset_configuration!,Method,HTM.md#method-c-reset_configuration!
|
|
25
|
+
configuration,Attribute,HTM.md#attribute-c-configuration
|
|
26
|
+
HTM::ActiveRecordConfig,Class,HTM/ActiveRecordConfig.md
|
|
27
|
+
HTM::ActiveRecordConfig.connected?,Method,HTM/ActiveRecordConfig.md#method-c-connected?
|
|
28
|
+
HTM::ActiveRecordConfig.connection_stats,Method,HTM/ActiveRecordConfig.md#method-c-connection_stats
|
|
29
|
+
HTM::ActiveRecordConfig.disconnect!,Method,HTM/ActiveRecordConfig.md#method-c-disconnect!
|
|
30
|
+
HTM::ActiveRecordConfig.establish_connection!,Method,HTM/ActiveRecordConfig.md#method-c-establish_connection!
|
|
31
|
+
HTM::ActiveRecordConfig.load_database_config,Method,HTM/ActiveRecordConfig.md#method-c-load_database_config
|
|
32
|
+
HTM::ActiveRecordConfig.verify_extensions!,Method,HTM/ActiveRecordConfig.md#method-c-verify_extensions!
|
|
33
|
+
HTM::CircuitBreaker,Class,HTM/CircuitBreaker.md
|
|
34
|
+
HTM::CircuitBreaker.call,Method,HTM/CircuitBreaker.md#method-i-call
|
|
35
|
+
HTM::CircuitBreaker.closed?,Method,HTM/CircuitBreaker.md#method-i-closed?
|
|
36
|
+
HTM::CircuitBreaker.half_open?,Method,HTM/CircuitBreaker.md#method-i-half_open?
|
|
37
|
+
HTM::CircuitBreaker.initialize,Method,HTM/CircuitBreaker.md#method-i-initialize
|
|
38
|
+
HTM::CircuitBreaker.open?,Method,HTM/CircuitBreaker.md#method-i-open?
|
|
39
|
+
HTM::CircuitBreaker.reset!,Method,HTM/CircuitBreaker.md#method-i-reset!
|
|
40
|
+
HTM::CircuitBreaker.stats,Method,HTM/CircuitBreaker.md#method-i-stats
|
|
41
|
+
failure_count,Attribute,HTM/CircuitBreaker.md#attribute-i-failure_count
|
|
42
|
+
last_failure_time,Attribute,HTM/CircuitBreaker.md#attribute-i-last_failure_time
|
|
43
|
+
name,Attribute,HTM/CircuitBreaker.md#attribute-i-name
|
|
44
|
+
state,Attribute,HTM/CircuitBreaker.md#attribute-i-state
|
|
45
|
+
HTM::Configuration,Class,HTM/Configuration.md
|
|
46
|
+
HTM::Configuration.configure_ruby_llm,Method,HTM/Configuration.md#method-i-configure_ruby_llm
|
|
47
|
+
HTM::Configuration.initialize,Method,HTM/Configuration.md#method-i-initialize
|
|
48
|
+
HTM::Configuration.normalize_ollama_model,Method,HTM/Configuration.md#method-i-normalize_ollama_model
|
|
49
|
+
HTM::Configuration.reset_to_defaults,Method,HTM/Configuration.md#method-i-reset_to_defaults
|
|
50
|
+
HTM::Configuration.validate!,Method,HTM/Configuration.md#method-i-validate!
|
|
51
|
+
anthropic_api_key,Attribute,HTM/Configuration.md#attribute-i-anthropic_api_key
|
|
52
|
+
azure_api_key,Attribute,HTM/Configuration.md#attribute-i-azure_api_key
|
|
53
|
+
azure_api_version,Attribute,HTM/Configuration.md#attribute-i-azure_api_version
|
|
54
|
+
azure_endpoint,Attribute,HTM/Configuration.md#attribute-i-azure_endpoint
|
|
55
|
+
bedrock_access_key,Attribute,HTM/Configuration.md#attribute-i-bedrock_access_key
|
|
56
|
+
bedrock_region,Attribute,HTM/Configuration.md#attribute-i-bedrock_region
|
|
57
|
+
bedrock_secret_key,Attribute,HTM/Configuration.md#attribute-i-bedrock_secret_key
|
|
58
|
+
connection_timeout,Attribute,HTM/Configuration.md#attribute-i-connection_timeout
|
|
59
|
+
deepseek_api_key,Attribute,HTM/Configuration.md#attribute-i-deepseek_api_key
|
|
60
|
+
embedding_dimensions,Attribute,HTM/Configuration.md#attribute-i-embedding_dimensions
|
|
61
|
+
embedding_generator,Attribute,HTM/Configuration.md#attribute-i-embedding_generator
|
|
62
|
+
embedding_model,Attribute,HTM/Configuration.md#attribute-i-embedding_model
|
|
63
|
+
embedding_provider,Attribute,HTM/Configuration.md#attribute-i-embedding_provider
|
|
64
|
+
embedding_timeout,Attribute,HTM/Configuration.md#attribute-i-embedding_timeout
|
|
65
|
+
gemini_api_key,Attribute,HTM/Configuration.md#attribute-i-gemini_api_key
|
|
66
|
+
huggingface_api_key,Attribute,HTM/Configuration.md#attribute-i-huggingface_api_key
|
|
67
|
+
job_backend,Attribute,HTM/Configuration.md#attribute-i-job_backend
|
|
68
|
+
logger,Attribute,HTM/Configuration.md#attribute-i-logger
|
|
69
|
+
ollama_url,Attribute,HTM/Configuration.md#attribute-i-ollama_url
|
|
70
|
+
openai_api_key,Attribute,HTM/Configuration.md#attribute-i-openai_api_key
|
|
71
|
+
openai_organization,Attribute,HTM/Configuration.md#attribute-i-openai_organization
|
|
72
|
+
openai_project,Attribute,HTM/Configuration.md#attribute-i-openai_project
|
|
73
|
+
openrouter_api_key,Attribute,HTM/Configuration.md#attribute-i-openrouter_api_key
|
|
74
|
+
tag_extractor,Attribute,HTM/Configuration.md#attribute-i-tag_extractor
|
|
75
|
+
tag_model,Attribute,HTM/Configuration.md#attribute-i-tag_model
|
|
76
|
+
tag_provider,Attribute,HTM/Configuration.md#attribute-i-tag_provider
|
|
77
|
+
tag_timeout,Attribute,HTM/Configuration.md#attribute-i-tag_timeout
|
|
78
|
+
token_counter,Attribute,HTM/Configuration.md#attribute-i-token_counter
|
|
79
|
+
week_start,Attribute,HTM/Configuration.md#attribute-i-week_start
|
|
80
|
+
HTM::Database,Class,HTM/Database.md
|
|
81
|
+
HTM::Database.default_config,Method,HTM/Database.md#method-c-default_config
|
|
82
|
+
HTM::Database.drop,Method,HTM/Database.md#method-c-drop
|
|
83
|
+
HTM::Database.dump_schema,Method,HTM/Database.md#method-c-dump_schema
|
|
84
|
+
HTM::Database.generate_docs,Method,HTM/Database.md#method-c-generate_docs
|
|
85
|
+
HTM::Database.info,Method,HTM/Database.md#method-c-info
|
|
86
|
+
HTM::Database.load_schema,Method,HTM/Database.md#method-c-load_schema
|
|
87
|
+
HTM::Database.migrate,Method,HTM/Database.md#method-c-migrate
|
|
88
|
+
HTM::Database.migration_status,Method,HTM/Database.md#method-c-migration_status
|
|
89
|
+
HTM::Database.parse_connection_params,Method,HTM/Database.md#method-c-parse_connection_params
|
|
90
|
+
HTM::Database.parse_connection_url,Method,HTM/Database.md#method-c-parse_connection_url
|
|
91
|
+
HTM::Database.seed,Method,HTM/Database.md#method-c-seed
|
|
92
|
+
HTM::Database.setup,Method,HTM/Database.md#method-c-setup
|
|
93
|
+
HTM::EmbeddingService,Class,HTM/EmbeddingService.md
|
|
94
|
+
HTM::EmbeddingService.circuit_breaker,Method,HTM/EmbeddingService.md#method-c-circuit_breaker
|
|
95
|
+
HTM::EmbeddingService.format_for_storage,Method,HTM/EmbeddingService.md#method-c-format_for_storage
|
|
96
|
+
HTM::EmbeddingService.generate,Method,HTM/EmbeddingService.md#method-c-generate
|
|
97
|
+
HTM::EmbeddingService.pad_embedding,Method,HTM/EmbeddingService.md#method-c-pad_embedding
|
|
98
|
+
HTM::EmbeddingService.reset_circuit_breaker!,Method,HTM/EmbeddingService.md#method-c-reset_circuit_breaker!
|
|
99
|
+
HTM::EmbeddingService.validate_embedding!,Method,HTM/EmbeddingService.md#method-c-validate_embedding!
|
|
100
|
+
HTM::Error,Class,HTM/Error.md
|
|
101
|
+
HTM::ValidationError,Class,HTM/ValidationError.md
|
|
102
|
+
HTM::ResourceExhaustedError,Class,HTM/ResourceExhaustedError.md
|
|
103
|
+
HTM::NotFoundError,Class,HTM/NotFoundError.md
|
|
104
|
+
HTM::EmbeddingError,Class,HTM/EmbeddingError.md
|
|
105
|
+
HTM::TagError,Class,HTM/TagError.md
|
|
106
|
+
HTM::DatabaseError,Class,HTM/DatabaseError.md
|
|
107
|
+
HTM::QueryTimeoutError,Class,HTM/QueryTimeoutError.md
|
|
108
|
+
HTM::AuthorizationError,Class,HTM/AuthorizationError.md
|
|
109
|
+
HTM::CircuitBreakerOpenError,Class,HTM/CircuitBreakerOpenError.md
|
|
110
|
+
HTM::LongTermMemory,Class,HTM/LongTermMemory.md
|
|
111
|
+
HTM::LongTermMemory.add,Method,HTM/LongTermMemory.md#method-i-add
|
|
112
|
+
HTM::LongTermMemory.add_tag,Method,HTM/LongTermMemory.md#method-i-add_tag
|
|
113
|
+
HTM::LongTermMemory.batch_load_node_tags,Method,HTM/LongTermMemory.md#method-i-batch_load_node_tags
|
|
114
|
+
HTM::LongTermMemory.calculate_relevance,Method,HTM/LongTermMemory.md#method-i-calculate_relevance
|
|
115
|
+
HTM::LongTermMemory.clear_cache!,Method,HTM/LongTermMemory.md#method-i-clear_cache!
|
|
116
|
+
HTM::LongTermMemory.delete,Method,HTM/LongTermMemory.md#method-i-delete
|
|
117
|
+
HTM::LongTermMemory.exists?,Method,HTM/LongTermMemory.md#method-i-exists?
|
|
118
|
+
HTM::LongTermMemory.find_query_matching_tags,Method,HTM/LongTermMemory.md#method-i-find_query_matching_tags
|
|
119
|
+
HTM::LongTermMemory.get_node_tags,Method,HTM/LongTermMemory.md#method-i-get_node_tags
|
|
120
|
+
HTM::LongTermMemory.initialize,Method,HTM/LongTermMemory.md#method-i-initialize
|
|
121
|
+
HTM::LongTermMemory.link_robot_to_node,Method,HTM/LongTermMemory.md#method-i-link_robot_to_node
|
|
122
|
+
HTM::LongTermMemory.mark_evicted,Method,HTM/LongTermMemory.md#method-i-mark_evicted
|
|
123
|
+
HTM::LongTermMemory.node_topics,Method,HTM/LongTermMemory.md#method-i-node_topics
|
|
124
|
+
HTM::LongTermMemory.nodes_by_topic,Method,HTM/LongTermMemory.md#method-i-nodes_by_topic
|
|
125
|
+
HTM::LongTermMemory.ontology_structure,Method,HTM/LongTermMemory.md#method-i-ontology_structure
|
|
126
|
+
HTM::LongTermMemory.pool_size,Method,HTM/LongTermMemory.md#method-i-pool_size
|
|
127
|
+
HTM::LongTermMemory.popular_tags,Method,HTM/LongTermMemory.md#method-i-popular_tags
|
|
128
|
+
HTM::LongTermMemory.register_robot,Method,HTM/LongTermMemory.md#method-i-register_robot
|
|
129
|
+
HTM::LongTermMemory.retrieve,Method,HTM/LongTermMemory.md#method-i-retrieve
|
|
130
|
+
HTM::LongTermMemory.search,Method,HTM/LongTermMemory.md#method-i-search
|
|
131
|
+
HTM::LongTermMemory.search_by_tags,Method,HTM/LongTermMemory.md#method-i-search_by_tags
|
|
132
|
+
HTM::LongTermMemory.search_fulltext,Method,HTM/LongTermMemory.md#method-i-search_fulltext
|
|
133
|
+
HTM::LongTermMemory.search_hybrid,Method,HTM/LongTermMemory.md#method-i-search_hybrid
|
|
134
|
+
HTM::LongTermMemory.search_with_relevance,Method,HTM/LongTermMemory.md#method-i-search_with_relevance
|
|
135
|
+
HTM::LongTermMemory.shutdown,Method,HTM/LongTermMemory.md#method-i-shutdown
|
|
136
|
+
HTM::LongTermMemory.stats,Method,HTM/LongTermMemory.md#method-i-stats
|
|
137
|
+
HTM::LongTermMemory.topic_relationships,Method,HTM/LongTermMemory.md#method-i-topic_relationships
|
|
138
|
+
HTM::LongTermMemory.track_access,Method,HTM/LongTermMemory.md#method-i-track_access
|
|
139
|
+
HTM::LongTermMemory.update_last_accessed,Method,HTM/LongTermMemory.md#method-i-update_last_accessed
|
|
140
|
+
HTM::LongTermMemory.update_robot_activity,Method,HTM/LongTermMemory.md#method-i-update_robot_activity
|
|
141
|
+
query_timeout,Attribute,HTM/LongTermMemory.md#attribute-i-query_timeout
|
|
142
|
+
HTM::Railtie,Class,HTM/Railtie.md
|
|
143
|
+
HTM::TagService,Class,HTM/TagService.md
|
|
144
|
+
HTM::TagService.circuit_breaker,Method,HTM/TagService.md#method-c-circuit_breaker
|
|
145
|
+
HTM::TagService.extract,Method,HTM/TagService.md#method-c-extract
|
|
146
|
+
HTM::TagService.parse_hierarchy,Method,HTM/TagService.md#method-c-parse_hierarchy
|
|
147
|
+
HTM::TagService.parse_tags,Method,HTM/TagService.md#method-c-parse_tags
|
|
148
|
+
HTM::TagService.reset_circuit_breaker!,Method,HTM/TagService.md#method-c-reset_circuit_breaker!
|
|
149
|
+
HTM::TagService.valid_tag?,Method,HTM/TagService.md#method-c-valid_tag?
|
|
150
|
+
HTM::TagService.validate_and_filter_tags,Method,HTM/TagService.md#method-c-validate_and_filter_tags
|
|
151
|
+
HTM::TimeframeExtractor,Class,HTM/TimeframeExtractor.md
|
|
152
|
+
HTM::TimeframeExtractor.extract,Method,HTM/TimeframeExtractor.md#method-c-extract
|
|
153
|
+
HTM::TimeframeExtractor.temporal?,Method,HTM/TimeframeExtractor.md#method-c-temporal?
|
|
154
|
+
HTM::TimeframeExtractor::Result,Class,HTM/TimeframeExtractor/Result.md
|
|
155
|
+
original_expression,Attribute,HTM/TimeframeExtractor/Result.md#attribute-i-original_expression
|
|
156
|
+
query,Attribute,HTM/TimeframeExtractor/Result.md#attribute-i-query
|
|
157
|
+
timeframe,Attribute,HTM/TimeframeExtractor/Result.md#attribute-i-timeframe
|
|
158
|
+
HTM::Timeframe,Class,HTM/Timeframe.md
|
|
159
|
+
HTM::Timeframe.normalize,Method,HTM/Timeframe.md#method-c-normalize
|
|
160
|
+
HTM::Timeframe.valid?,Method,HTM/Timeframe.md#method-c-valid?
|
|
161
|
+
HTM::Timeframe::Result,Class,HTM/Timeframe/Result.md
|
|
162
|
+
extracted,Attribute,HTM/Timeframe/Result.md#attribute-i-extracted
|
|
163
|
+
query,Attribute,HTM/Timeframe/Result.md#attribute-i-query
|
|
164
|
+
timeframe,Attribute,HTM/Timeframe/Result.md#attribute-i-timeframe
|
|
165
|
+
HTM::WorkingMemory,Class,HTM/WorkingMemory.md
|
|
166
|
+
HTM::WorkingMemory.add,Method,HTM/WorkingMemory.md#method-i-add
|
|
167
|
+
HTM::WorkingMemory.add_from_sync,Method,HTM/WorkingMemory.md#method-i-add_from_sync
|
|
168
|
+
HTM::WorkingMemory.assemble_context,Method,HTM/WorkingMemory.md#method-i-assemble_context
|
|
169
|
+
HTM::WorkingMemory.clear,Method,HTM/WorkingMemory.md#method-i-clear
|
|
170
|
+
HTM::WorkingMemory.clear_from_sync,Method,HTM/WorkingMemory.md#method-i-clear_from_sync
|
|
171
|
+
HTM::WorkingMemory.evict_to_make_space,Method,HTM/WorkingMemory.md#method-i-evict_to_make_space
|
|
172
|
+
HTM::WorkingMemory.has_space?,Method,HTM/WorkingMemory.md#method-i-has_space?
|
|
173
|
+
HTM::WorkingMemory.initialize,Method,HTM/WorkingMemory.md#method-i-initialize
|
|
174
|
+
HTM::WorkingMemory.node_count,Method,HTM/WorkingMemory.md#method-i-node_count
|
|
175
|
+
HTM::WorkingMemory.remove,Method,HTM/WorkingMemory.md#method-i-remove
|
|
176
|
+
HTM::WorkingMemory.remove_from_sync,Method,HTM/WorkingMemory.md#method-i-remove_from_sync
|
|
177
|
+
HTM::WorkingMemory.token_count,Method,HTM/WorkingMemory.md#method-i-token_count
|
|
178
|
+
HTM::WorkingMemory.utilization_percentage,Method,HTM/WorkingMemory.md#method-i-utilization_percentage
|
|
179
|
+
max_tokens,Attribute,HTM/WorkingMemory.md#attribute-i-max_tokens
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# YARD API Reference
|
|
2
|
+
|
|
3
|
+
Complete API documentation generated by [YARD](https://yardoc.org/) with [yard-markdown](https://github.com/skatkov/yard-markdown).
|
|
4
|
+
|
|
5
|
+
<div class="grid cards" markdown>
|
|
6
|
+
|
|
7
|
+
- :material-book-open-variant:{ .lg .middle } **API Documentation**
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Browse the complete API reference with method signatures, parameters, and examples.
|
|
12
|
+
|
|
13
|
+
- :material-chart-bar:{ .lg .middle } **Documentation Coverage**
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Run `rake htm:doc:stats` to see documentation coverage statistics.
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
## Classes & Modules
|
|
22
|
+
|
|
23
|
+
| Class/Module | Description |
|
|
24
|
+
|--------------|-------------|
|
|
25
|
+
| [HTM](yard/HTM.md) | Main API class for memory operations |
|
|
26
|
+
| [HTM::CircuitBreaker](yard/HTM/CircuitBreaker.md) | Fault tolerance for external services |
|
|
27
|
+
| [HTM::Configuration](yard/HTM/Configuration.md) | Multi-provider LLM configuration |
|
|
28
|
+
| [HTM::Database](yard/HTM/Database.md) | Database schema and connection management |
|
|
29
|
+
| [HTM::EmbeddingService](yard/HTM/EmbeddingService.md) | Vector embedding generation service |
|
|
30
|
+
| [HTM::JobAdapter](yard/HTM/JobAdapter.md) | Background job abstraction layer |
|
|
31
|
+
| [HTM::LongTermMemory](yard/HTM/LongTermMemory.md) | PostgreSQL-backed permanent storage |
|
|
32
|
+
| [HTM::Observability](yard/HTM/Observability.md) | Metrics and logging instrumentation |
|
|
33
|
+
| [HTM::TagService](yard/HTM/TagService.md) | Hierarchical tag extraction service |
|
|
34
|
+
| [HTM::Timeframe](yard/HTM/Timeframe.md) | Time-based query filtering |
|
|
35
|
+
| [HTM::Timeframe::Result](yard/HTM/Timeframe/Result.md) | HTM::Timeframe::Result class |
|
|
36
|
+
| [HTM::TimeframeExtractor](yard/HTM/TimeframeExtractor.md) | Natural language time parsing |
|
|
37
|
+
| [HTM::TimeframeExtractor::Result](yard/HTM/TimeframeExtractor/Result.md) | HTM::TimeframeExtractor::Result class |
|
|
38
|
+
| [HTM::WorkingMemory](yard/HTM/WorkingMemory.md) | Token-limited in-memory cache |
|
|
39
|
+
|
|
40
|
+
## Generating Documentation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Build YARD documentation
|
|
44
|
+
rake htm:doc:yard
|
|
45
|
+
|
|
46
|
+
# Start live-reload server (HTML mode)
|
|
47
|
+
rake htm:doc:server
|
|
48
|
+
|
|
49
|
+
# Show coverage statistics
|
|
50
|
+
rake htm:doc:stats
|
|
51
|
+
```
|