htm 0.0.32 → 0.1.0
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/.architecture/decisions/adrs/005-rag-based-retrieval-with-hybrid-search.md +4 -0
- data/.architecture/decisions/adrs/017-bitemporal-event-time.md +78 -0
- data/.architecture/decisions/adrs/018-memory-timelines-and-node-links.md +64 -0
- data/.architecture/decisions/adrs/019-epistemic-status.md +66 -0
- data/.claude.json +11 -0
- data/.envrc +9 -7
- data/.irbrc +14 -14
- data/.reek.yml +104 -0
- data/.rubocop.yml +0 -11
- data/.ruby-version +1 -0
- data/CHANGELOG.md +160 -98
- data/README.md +22 -17
- data/SETUP.md +49 -46
- data/_typos.toml +17 -0
- data/bin/htm +18 -0
- data/db/migrate/00010_convert_embedding_to_sparsevec.rb +47 -0
- data/db/migrate/00011_strip_frontmatter_from_chunks.rb +66 -0
- data/db/migrate/00012_add_event_time_to_nodes.rb +110 -0
- data/db/migrate/00013_create_node_links.rb +158 -0
- data/db/migrate/00014_add_epistemic_status.rb +110 -0
- data/db/schema.sql +238 -7
- data/db/seed_data/README.md +11 -11
- data/db/seeds.rb +11 -11
- data/docs/api/database.md +8 -8
- data/docs/api/embedding-service.md +138 -262
- data/docs/api/htm.md +128 -12
- data/docs/api/index.md +8 -8
- data/docs/api/long-term-memory.md +8 -19
- data/docs/api/working-memory.md +34 -46
- data/docs/api/yard/HTM/Admin/Console.md +53 -0
- data/docs/api/yard/HTM/Admin/DatabaseCommands/Console.md +38 -0
- data/docs/api/yard/HTM/Admin/DatabaseCommands.md +127 -0
- data/docs/api/yard/HTM/Admin/EnrichCommands.md +85 -0
- data/docs/api/yard/HTM/Admin/Error.md +9 -0
- data/docs/api/yard/HTM/Admin/FileCommands/Console.md +50 -0
- data/docs/api/yard/HTM/Admin/FileCommands.md +83 -0
- data/docs/api/yard/HTM/Admin/MemoryCommands/Base.md +17 -0
- data/docs/api/yard/HTM/Admin/MemoryCommands/Edit.md +74 -0
- data/docs/api/yard/HTM/Admin/MemoryCommands/Search.md +77 -0
- data/docs/api/yard/HTM/Admin/MemoryCommands/TagSearch.md +46 -0
- data/docs/api/yard/HTM/Admin/MemoryCommands/WorkingMemory.md +36 -0
- data/docs/api/yard/HTM/Admin/MemoryCommands.md +67 -0
- data/docs/api/yard/HTM/Admin/TagCommands/Console.md +48 -0
- data/docs/api/yard/HTM/Admin/TagCommands.md +105 -0
- data/docs/api/yard/HTM/Admin/TagGraph.md +149 -0
- data/docs/api/yard/HTM/Admin/YardDocs.md +60 -0
- data/docs/api/yard/HTM/Admin.md +102 -0
- data/docs/api/yard/HTM/AuthorizationError.md +6 -6
- data/docs/api/yard/HTM/CLI/ConfigFile.md +40 -0
- data/docs/api/yard/HTM/CLI/Db.md +63 -0
- data/docs/api/yard/HTM/CLI/Enrich.md +39 -0
- data/docs/api/yard/HTM/CLI/ErrorSuggestion.md +56 -0
- data/docs/api/yard/HTM/CLI/Files.md +36 -0
- data/docs/api/yard/HTM/CLI/Group/ClassMethods.md +11 -0
- data/docs/api/yard/HTM/CLI/Group.md +13 -0
- data/docs/api/yard/HTM/CLI/MemoryCommand/ClassMethods.md +20 -0
- data/docs/api/yard/HTM/CLI/MemoryCommand.md +9 -0
- data/docs/api/yard/HTM/CLI/Robots.md +31 -0
- data/docs/api/yard/HTM/CLI/Support.md +9 -0
- data/docs/api/yard/HTM/CLI/Tags.md +57 -0
- data/docs/api/yard/HTM/CLI/WorkingMemory.md +24 -0
- data/docs/api/yard/HTM/CLI.md +84 -0
- data/docs/api/yard/HTM/CircuitBreaker/Guarded.md +29 -0
- data/docs/api/yard/HTM/CircuitBreaker/Settings.md +21 -0
- data/docs/api/yard/HTM/CircuitBreaker/Status.md +42 -0
- data/docs/api/yard/HTM/CircuitBreaker.md +54 -49
- data/docs/api/yard/HTM/CircuitBreakerOpenError.md +9 -9
- data/docs/api/yard/HTM/Config/Builder.md +87 -0
- data/docs/api/yard/HTM/Config/Coercion.md +59 -0
- data/docs/api/yard/HTM/Config/Database.md +102 -0
- data/docs/api/yard/HTM/Config/Readers.md +30 -0
- data/docs/api/yard/HTM/Config/RubyLlmSettings.md +32 -0
- data/docs/api/yard/HTM/Config/Validator.md +59 -0
- data/docs/api/yard/HTM/Config.md +224 -105
- data/docs/api/yard/HTM/ConfigurationError.md +20 -0
- data/docs/api/yard/HTM/Confirmation.md +22 -0
- data/docs/api/yard/HTM/Database/Connection.md +26 -0
- data/docs/api/yard/HTM/Database/Migrations.md +32 -0
- data/docs/api/yard/HTM/Database/Report.md +26 -0
- data/docs/api/yard/HTM/Database/SchemaFile.md +52 -0
- data/docs/api/yard/HTM/Database/Teardown.md +15 -0
- data/docs/api/yard/HTM/Database.md +58 -70
- data/docs/api/yard/HTM/DatabaseDocs.md +67 -0
- data/docs/api/yard/HTM/DatabaseError.md +6 -6
- data/docs/api/yard/HTM/Deletion.md +32 -0
- data/docs/api/yard/HTM/EmbeddingError.md +6 -6
- data/docs/api/yard/HTM/EmbeddingService.md +37 -38
- data/docs/api/yard/HTM/Epistemics.md +135 -0
- data/docs/api/yard/HTM/Error.md +6 -6
- data/docs/api/yard/HTM/EventTime.md +110 -0
- data/docs/api/yard/HTM/FileMemory.md +76 -0
- data/docs/api/yard/HTM/InputValidator.md +82 -0
- data/docs/api/yard/HTM/JobAdapter/Job.md +26 -0
- data/docs/api/yard/HTM/JobAdapter.md +35 -16
- data/docs/api/yard/HTM/Jobs/FailureLogging.md +14 -0
- data/docs/api/yard/HTM/Jobs/GenerateEmbeddingJob.md +16 -0
- data/docs/api/yard/HTM/Jobs/GeneratePropositionsJob.md +17 -0
- data/docs/api/yard/HTM/Jobs/GenerateRelationshipsJob.md +26 -0
- data/docs/api/yard/HTM/Jobs/GenerateTagsJob.md +17 -0
- data/docs/api/yard/HTM/Jobs/LlmCallTimer.md +58 -0
- data/docs/api/yard/HTM/Jobs/NodeLookup.md +14 -0
- data/docs/api/yard/HTM/Jobs.md +13 -0
- data/docs/api/yard/HTM/Loaders/ChunkSync/Chunk.md +22 -0
- data/docs/api/yard/HTM/Loaders/ChunkSync.md +50 -0
- data/docs/api/yard/HTM/Loaders/MarkdownChunker/Coalescer.md +24 -0
- data/docs/api/yard/HTM/Loaders/MarkdownChunker/Packer.md +20 -0
- data/docs/api/yard/HTM/Loaders/MarkdownChunker/Splitter.md +18 -0
- data/docs/api/yard/HTM/Loaders/MarkdownChunker.md +83 -0
- data/docs/api/yard/HTM/Loaders/MarkdownLoader/Document.md +43 -0
- data/docs/api/yard/HTM/Loaders/MarkdownLoader.md +62 -0
- data/docs/api/yard/HTM/Loaders.md +5 -0
- data/docs/api/yard/HTM/LongTermMemory/FulltextSearch.md +36 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch/RrfMerger.md +25 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch/RrfRows.md +30 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch/RrfSql/Query.md +79 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch/RrfSql/Source.md +45 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch/RrfSql.md +11 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch/TagDepth.md +52 -0
- data/docs/api/yard/HTM/LongTermMemory/HybridSearch.md +52 -0
- data/docs/api/yard/HTM/LongTermMemory/NodeOperations.md +95 -0
- data/docs/api/yard/HTM/LongTermMemory/RelevanceScorer/HierarchicalJaccard.md +58 -0
- data/docs/api/yard/HTM/LongTermMemory/RelevanceScorer/TagSearch.md +27 -0
- data/docs/api/yard/HTM/LongTermMemory/RelevanceScorer.md +81 -0
- data/docs/api/yard/HTM/LongTermMemory/RobotOperations.md +22 -0
- data/docs/api/yard/HTM/LongTermMemory/TagOperations/ExpiringValue.md +24 -0
- data/docs/api/yard/HTM/LongTermMemory/TagOperations/TagMatchSql.md +40 -0
- data/docs/api/yard/HTM/LongTermMemory/TagOperations.md +129 -0
- data/docs/api/yard/HTM/LongTermMemory/VectorSearch.md +30 -0
- data/docs/api/yard/HTM/LongTermMemory.md +279 -31
- data/docs/api/yard/HTM/MCP/AssembleContextTool.md +16 -0
- data/docs/api/yard/HTM/MCP/ClearGroupWorkingMemoryTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ClearWorkingMemoryTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ConfigResource.md +12 -0
- data/docs/api/yard/HTM/MCP/ConfirmTool.md +12 -0
- data/docs/api/yard/HTM/MCP/CreateGroupTool.md +12 -0
- data/docs/api/yard/HTM/MCP/EnrichPendingTool.md +16 -0
- data/docs/api/yard/HTM/MCP/ExtractPropositionsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/FailoverTool.md +12 -0
- data/docs/api/yard/HTM/MCP/FileInfoTool.md +13 -0
- data/docs/api/yard/HTM/MCP/FileSourcesResource.md +12 -0
- data/docs/api/yard/HTM/MCP/FileSupport.md +7 -0
- data/docs/api/yard/HTM/MCP/FindByTopicTool.md +12 -0
- data/docs/api/yard/HTM/MCP/FirstMentionTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ForgetContentTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ForgetTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GetGroupStatusTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GetGroupWorkingMemoryTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GetNodeTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GetRobotTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GetWorkingMemoryTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GroupRecallTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GroupRememberTool.md +12 -0
- data/docs/api/yard/HTM/MCP/GroupSession.md +23 -0
- data/docs/api/yard/HTM/MCP/JoinGroupTool.md +12 -0
- data/docs/api/yard/HTM/MCP/LeaveGroupTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ListDeletedTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ListFilesTool.md +13 -0
- data/docs/api/yard/HTM/MCP/ListGroupsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ListRobotsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ListTagsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/LoadDirectoryTool.md +13 -0
- data/docs/api/yard/HTM/MCP/LoadFileTool.md +13 -0
- data/docs/api/yard/HTM/MCP/MemoryStatsResource.md +13 -0
- data/docs/api/yard/HTM/MCP/PopularTagsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/PromoteRobotTool.md +12 -0
- data/docs/api/yard/HTM/MCP/PurgeDeletedTool.md +12 -0
- data/docs/api/yard/HTM/MCP/RecallTool.md +16 -0
- data/docs/api/yard/HTM/MCP/RecentMemoriesResource.md +13 -0
- data/docs/api/yard/HTM/MCP/RelatedNodesTool.md +12 -0
- data/docs/api/yard/HTM/MCP/RememberTool.md +12 -0
- data/docs/api/yard/HTM/MCP/RestoreTool.md +12 -0
- data/docs/api/yard/HTM/MCP/RobotGroupsResource.md +13 -0
- data/docs/api/yard/HTM/MCP/RobotTeamsStatusTool.md +13 -0
- data/docs/api/yard/HTM/MCP/RunRobotTeamsTool.md +13 -0
- data/docs/api/yard/HTM/MCP/SearchByTagsTool.md +16 -0
- data/docs/api/yard/HTM/MCP/SearchTagsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/Server.md +37 -0
- data/docs/api/yard/HTM/MCP/Session.md +32 -0
- data/docs/api/yard/HTM/MCP/SetRobotTool.md +12 -0
- data/docs/api/yard/HTM/MCP/ShutdownGroupTool.md +12 -0
- data/docs/api/yard/HTM/MCP/StartupPromptResource.md +16 -0
- data/docs/api/yard/HTM/MCP/StatsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/SyncFilesTool.md +13 -0
- data/docs/api/yard/HTM/MCP/SyncGroupTool.md +12 -0
- data/docs/api/yard/HTM/MCP/TagHierarchyResource.md +16 -0
- data/docs/api/yard/HTM/MCP/TagNodeTool.md +12 -0
- data/docs/api/yard/HTM/MCP/TagTreeTool.md +22 -0
- data/docs/api/yard/HTM/MCP/TeamNames.md +7 -0
- data/docs/api/yard/HTM/MCP/TimelineTool.md +12 -0
- data/docs/api/yard/HTM/MCP/Tool.md +24 -0
- data/docs/api/yard/HTM/MCP/ToolSupport.md +17 -0
- data/docs/api/yard/HTM/MCP/TopicRelationshipsTool.md +12 -0
- data/docs/api/yard/HTM/MCP/TransferWorkingMemoryTool.md +12 -0
- data/docs/api/yard/HTM/MCP/UnloadFileTool.md +13 -0
- data/docs/api/yard/HTM/MCP/UntagNodeTool.md +12 -0
- data/docs/api/yard/HTM/MCP.md +30 -0
- data/docs/api/yard/HTM/Migration.md +44 -0
- data/docs/api/yard/HTM/Models/FileSource.md +66 -0
- data/docs/api/yard/HTM/Models/Node/Scopes.md +74 -0
- data/docs/api/yard/HTM/Models/Node/SoftDeletion.md +22 -0
- data/docs/api/yard/HTM/Models/Node/VectorSimilarity.md +28 -0
- data/docs/api/yard/HTM/Models/Node.md +113 -0
- data/docs/api/yard/HTM/Models/NodeLink.md +65 -0
- data/docs/api/yard/HTM/Models/NodeRelationship.md +31 -0
- data/docs/api/yard/HTM/Models/NodeTag.md +38 -0
- data/docs/api/yard/HTM/Models/Robot.md +50 -0
- data/docs/api/yard/HTM/Models/RobotNode.md +35 -0
- data/docs/api/yard/HTM/Models/Tag/Scopes.md +32 -0
- data/docs/api/yard/HTM/Models/Tag.md +112 -0
- data/docs/api/yard/HTM/Models.md +5 -0
- data/docs/api/yard/HTM/NodeEnrichment.md +36 -0
- data/docs/api/yard/HTM/NodeView.md +113 -0
- data/docs/api/yard/HTM/NotFoundError.md +6 -5
- data/docs/api/yard/HTM/Observability.md +58 -40
- data/docs/api/yard/HTM/PropositionError.md +6 -6
- data/docs/api/yard/HTM/PropositionService.md +63 -29
- data/docs/api/yard/HTM/QueryCache/KeyNormalizer.md +25 -0
- data/docs/api/yard/HTM/QueryCache/NullStore.md +19 -0
- data/docs/api/yard/HTM/QueryCache/Store.md +43 -0
- data/docs/api/yard/HTM/QueryCache.md +41 -46
- data/docs/api/yard/HTM/QueryTimeoutError.md +9 -8
- data/docs/api/yard/HTM/Railtie.md +11 -7
- data/docs/api/yard/HTM/RecallQuery.md +111 -0
- data/docs/api/yard/HTM/ResourceExhaustedError.md +6 -6
- data/docs/api/yard/HTM/RobotGroup/CacheSync.md +35 -0
- data/docs/api/yard/HTM/RobotGroup/Membership.md +96 -0
- data/docs/api/yard/HTM/RobotGroup/TransferOptions.md +14 -0
- data/docs/api/yard/HTM/RobotGroup/WorkingMemoryLedger.md +65 -0
- data/docs/api/yard/HTM/RobotGroup.md +116 -360
- data/docs/api/yard/HTM/Robots/Actions/TagMove.md +31 -0
- data/docs/api/yard/HTM/Robots/Actions.md +153 -0
- data/docs/api/yard/HTM/Robots/Neighbors.md +20 -0
- data/docs/api/yard/HTM/Robots/Supervisor/Idler.md +26 -0
- data/docs/api/yard/HTM/Robots/Supervisor/Roster.md +26 -0
- data/docs/api/yard/HTM/Robots/Supervisor.md +42 -0
- data/docs/api/yard/HTM/Robots/Team.md +60 -0
- data/docs/api/yard/HTM/Robots/Teams/Archivist.md +43 -0
- data/docs/api/yard/HTM/Robots/Teams/Consolidator.md +29 -0
- data/docs/api/yard/HTM/Robots/Teams/ContradictionDetector.md +33 -0
- data/docs/api/yard/HTM/Robots/Teams/TagCurator.md +37 -0
- data/docs/api/yard/HTM/Robots/Teams.md +5 -0
- data/docs/api/yard/HTM/Robots/Tools/ArchiveNodes.md +12 -0
- data/docs/api/yard/HTM/Robots/Tools/Base.md +16 -0
- data/docs/api/yard/HTM/Robots/Tools/MergeNodes.md +12 -0
- data/docs/api/yard/HTM/Robots/Tools/MergeTags.md +12 -0
- data/docs/api/yard/HTM/Robots/Tools/Pass.md +12 -0
- data/docs/api/yard/HTM/Robots/Tools/RecordConflict.md +12 -0
- data/docs/api/yard/HTM/Robots/Tools/SupersedeNode.md +12 -0
- data/docs/api/yard/HTM/Robots/Tools.md +14 -0
- data/docs/api/yard/HTM/Robots.md +72 -0
- data/docs/api/yard/HTM/SearchFilters.md +82 -0
- data/docs/api/yard/HTM/SequelConfig.md +97 -0
- data/docs/api/yard/HTM/Settings.md +39 -0
- data/docs/api/yard/HTM/Sinatra/Helpers.md +37 -0
- data/docs/api/yard/HTM/Sinatra/Middleware.md +29 -0
- data/docs/api/yard/HTM/Sinatra.md +44 -0
- data/docs/api/yard/HTM/SqlBuilder/Sparsevec.md +69 -0
- data/docs/api/yard/HTM/SqlBuilder.md +62 -75
- data/docs/api/yard/HTM/StartupPrompt.md +45 -0
- data/docs/api/yard/HTM/TagError.md +6 -6
- data/docs/api/yard/HTM/TagService.md +100 -37
- data/docs/api/yard/HTM/TagTree/Branch.md +43 -0
- data/docs/api/yard/HTM/TagTree/SvgRenderer/Layout.md +51 -0
- data/docs/api/yard/HTM/TagTree/SvgRenderer.md +25 -0
- data/docs/api/yard/HTM/TagTree.md +65 -0
- data/docs/api/yard/HTM/Telemetry/NullInstrument.md +12 -9
- data/docs/api/yard/HTM/Telemetry/NullMeter.md +17 -9
- data/docs/api/yard/HTM/Telemetry.md +53 -50
- data/docs/api/yard/HTM/Timeframe/Result.md +13 -16
- data/docs/api/yard/HTM/Timeframe.md +17 -20
- data/docs/api/yard/HTM/TimeframeExtractor/Patterns.md +18 -0
- data/docs/api/yard/HTM/TimeframeExtractor/Result.md +13 -16
- data/docs/api/yard/HTM/TimeframeExtractor.md +27 -16
- data/docs/api/yard/HTM/Timeline.md +113 -0
- data/docs/api/yard/HTM/ValidationError.md +6 -5
- data/docs/api/yard/HTM/Workflows/RememberWorkflow/NodeState.md +73 -0
- data/docs/api/yard/HTM/Workflows/RememberWorkflow.md +80 -0
- data/docs/api/yard/HTM/Workflows.md +5 -0
- data/docs/api/yard/HTM/WorkingMemory/Entry.md +67 -0
- data/docs/api/yard/HTM/WorkingMemory/Store.md +54 -0
- data/docs/api/yard/HTM/WorkingMemory.md +113 -87
- data/docs/api/yard/HTM/WorkingMemoryChannel/Subscribers.md +28 -0
- data/docs/api/yard/HTM/WorkingMemoryChannel.md +108 -102
- data/docs/api/yard/HTM.md +483 -5
- data/docs/api/yard/README.md +211 -0
- data/docs/api/yard/Sinatra/Base.md +30 -0
- data/docs/api/yard/Sinatra.md +7 -0
- data/docs/api/yard/index.csv +1834 -181
- data/docs/api/yard-reference.md +228 -9
- data/docs/architecture/adrs/005-rag-retrieval.md +3 -0
- data/docs/architecture/adrs/index.md +1 -1
- data/docs/architecture/index.md +2 -2
- data/docs/architecture/overview.md +3 -3
- data/docs/assets/images/project-structure.svg +2 -2
- data/docs/database/INDEX.md +113 -0
- data/docs/database/README.md +60 -176
- data/docs/database/file_sources.md +51 -0
- data/docs/database/file_sources.svg +120 -0
- data/docs/database/naming-convention.md +12 -12
- data/docs/database/node_links.md +65 -0
- data/docs/database/node_links.svg +171 -0
- data/docs/database/node_relationships.md +62 -0
- data/docs/database/node_relationships.svg +124 -0
- data/docs/database/node_tags.md +50 -0
- data/docs/database/node_tags.svg +125 -0
- data/docs/database/nodes.md +120 -0
- data/docs/database/nodes.svg +394 -0
- data/docs/database/robot_nodes.md +57 -0
- data/docs/database/robot_nodes.svg +155 -0
- data/docs/database/robots.md +40 -0
- data/docs/database/robots.svg +131 -0
- data/docs/database/schema.svg +384 -275
- data/docs/database/schema_migrations.md +19 -0
- data/docs/database/schema_migrations.svg +31 -0
- data/docs/database/tags.md +47 -0
- data/docs/database/tags.svg +90 -0
- data/docs/development/asgard-tasks.md +114 -0
- data/docs/development/contributing.md +6 -6
- data/docs/development/index.md +15 -17
- data/docs/development/schema.md +43 -14
- data/docs/development/setup.md +60 -70
- data/docs/development/testing.md +57 -65
- data/docs/examples/basic-usage.md +9 -9
- data/docs/examples/config-files.md +8 -8
- data/docs/examples/file-loading.md +12 -12
- data/docs/examples/index.md +15 -8
- data/docs/examples/llm-configuration.md +13 -9
- data/docs/examples/mcp-client.md +61 -59
- data/docs/examples/rails-integration.md +5 -4
- data/docs/examples/sinatra-integration.md +5 -4
- data/docs/examples/standalone-app.md +17 -16
- data/docs/getting-started/index.md +3 -3
- data/docs/getting-started/installation.md +76 -83
- data/docs/getting-started/quick-start.md +24 -22
- data/docs/guides/adding-memories.md +14 -3
- data/docs/guides/cli.md +458 -0
- data/docs/guides/configuration.md +72 -37
- data/docs/guides/epistemic-status.md +138 -0
- data/docs/guides/event-time.md +106 -0
- data/docs/guides/file-loading.md +26 -22
- data/docs/guides/getting-started.md +21 -17
- data/docs/guides/long-term-memory.md +1 -1
- data/docs/guides/mcp-server.md +416 -173
- data/docs/guides/propositions.md +18 -29
- data/docs/guides/recalling-memories.md +22 -7
- data/docs/guides/robot-teams.md +96 -0
- data/docs/guides/search-strategies.md +10 -7
- data/docs/guides/tags.md +19 -19
- data/docs/guides/timeline.md +106 -0
- data/docs/index.md +7 -7
- data/docs/llms.txt +35 -0
- data/docs/multi_framework_support.md +13 -13
- data/docs/robots/robot-groups.md +9 -9
- data/docs/robots/two-tier-memory.md +13 -26
- data/docs/setup_local_database.md +33 -31
- data/examples/00_create_examples_db.rb +20 -7
- data/examples/01_basic_usage.rb +20 -18
- data/examples/02_config_file_example/README.md +13 -12
- data/examples/02_config_file_example/config/htm.local.yml +8 -8
- data/examples/02_config_file_example/show_config.rb +3 -4
- data/examples/03_custom_llm_configuration.rb +12 -12
- data/examples/04_file_loader_usage.rb +15 -21
- data/examples/05_timeframe_demo.rb +282 -234
- data/examples/06_example_app/.loki +36 -0
- data/examples/06_example_app/app.rb +21 -33
- data/examples/07_cli_app/README.md +18 -18
- data/examples/07_cli_app/htm_cli.rb +25 -19
- data/examples/08_sinatra_app/Gemfile +1 -0
- data/examples/08_sinatra_app/Gemfile.lock +101 -67
- data/examples/08_sinatra_app/app.rb +64 -62
- data/examples/09_mcp_client.rb +92 -119
- data/examples/10_telemetry/README.md +3 -3
- data/examples/10_telemetry/SETUP_README.md +2 -2
- data/examples/10_telemetry/demo.rb +5 -5
- data/examples/11_robot_groups/README.md +5 -4
- data/examples/11_robot_groups/lib/robot_worker.rb +0 -5
- data/examples/11_robot_groups/multi_process.rb +5 -4
- data/examples/11_robot_groups/same_process.rb +18 -17
- data/examples/12_rails_app/Gemfile +1 -1
- data/examples/12_rails_app/Gemfile.lock +146 -97
- data/examples/12_rails_app/README.md +21 -17
- data/examples/12_rails_app/app/controllers/chats_controller.rb +33 -63
- data/examples/12_rails_app/app/controllers/memories_controller.rb +7 -1
- data/examples/12_rails_app/app/controllers/messages_controller.rb +21 -58
- data/examples/12_rails_app/app/controllers/search_controller.rb +7 -2
- data/examples/12_rails_app/app/models/chat.rb +0 -33
- data/examples/12_rails_app/app/models/message.rb +0 -2
- data/examples/12_rails_app/app/views/chats/show.html.erb +2 -2
- data/examples/12_rails_app/app/views/files/new.html.erb +1 -1
- data/examples/12_rails_app/app/views/memories/_memory_card.html.erb +1 -1
- data/examples/12_rails_app/app/views/memories/new.html.erb +12 -0
- data/examples/12_rails_app/app/views/memories/show.html.erb +13 -0
- data/examples/12_rails_app/app/views/search/index.html.erb +18 -2
- data/examples/12_rails_app/config/initializers/ruby_llm.rb +11 -15
- data/examples/12_rails_app/db/migrate/20261205061932_create_ruby_llm_records.rb +160 -0
- data/examples/12_rails_app/db/migrate/20261205061933_create_chats.rb +13 -0
- data/examples/12_rails_app/db/migrate/20261205061934_create_messages.rb +23 -0
- data/examples/12_rails_app/db/schema.rb +163 -20
- data/examples/README.md +53 -44
- data/examples/examples_helper.rb +29 -5
- data/htm.gemspec +68 -0
- data/lib/htm/admin/database_commands.rb +454 -0
- data/lib/htm/admin/enrich_commands.rb +209 -0
- data/lib/htm/admin/file_commands.rb +323 -0
- data/lib/htm/admin/memory_commands/edit.rb +157 -0
- data/lib/htm/admin/memory_commands/search.rb +178 -0
- data/lib/htm/admin/memory_commands/tag_search.rb +98 -0
- data/lib/htm/admin/memory_commands/text.rb +164 -0
- data/lib/htm/admin/memory_commands/working_memory.rb +71 -0
- data/lib/htm/admin/memory_commands.rb +179 -0
- data/lib/htm/admin/tag_commands.rb +352 -0
- data/lib/htm/admin/tag_graph.rb +290 -0
- data/lib/htm/admin/templates/tag_graph.html +295 -0
- data/lib/htm/admin/yard_docs.rb +206 -0
- data/lib/htm/admin.rb +253 -0
- data/lib/htm/circuit_breaker.rb +142 -68
- data/lib/htm/class_methods.rb +136 -0
- data/lib/htm/cli/config_file.rb +86 -0
- data/lib/htm/cli/db.rb +77 -0
- data/lib/htm/cli/enrich.rb +44 -0
- data/lib/htm/cli/environment.rb +74 -0
- data/lib/htm/cli/error_suggestion.rb +97 -0
- data/lib/htm/cli/files.rb +41 -0
- data/lib/htm/cli/group.rb +32 -0
- data/lib/htm/cli/memory.rb +320 -0
- data/lib/htm/cli/memory_command.rb +71 -0
- data/lib/htm/cli/robots.rb +71 -0
- data/lib/htm/cli/support.rb +46 -0
- data/lib/htm/cli/tags.rb +103 -0
- data/lib/htm/cli/working_memory.rb +41 -0
- data/lib/htm/cli.rb +75 -0
- data/lib/htm/config/builder.rb +99 -68
- data/lib/htm/config/coercion.rb +91 -0
- data/lib/htm/config/database.rb +81 -52
- data/lib/htm/config/defaults.yml +52 -16
- data/lib/htm/config/readers.rb +85 -0
- data/lib/htm/config/ruby_llm_settings.rb +58 -0
- data/lib/htm/config/validator.rb +45 -26
- data/lib/htm/config.rb +112 -297
- data/lib/htm/database.rb +305 -396
- data/lib/htm/database_docs.rb +149 -0
- data/lib/htm/embedding_service.rb +26 -66
- data/lib/htm/epistemics.rb +254 -0
- data/lib/htm/errors.rb +4 -4
- data/lib/htm/event_time.rb +201 -0
- data/lib/htm/file_memory.rb +106 -0
- data/lib/htm/input_validator.rb +158 -0
- data/lib/htm/integrations/sinatra.rb +43 -31
- data/lib/htm/job_adapter.rb +78 -83
- data/lib/htm/jobs/failure_logging.rb +49 -0
- data/lib/htm/jobs/generate_embedding_job.rb +21 -28
- data/lib/htm/jobs/generate_propositions_job.rb +56 -28
- data/lib/htm/jobs/generate_relationships_job.rb +28 -24
- data/lib/htm/jobs/generate_tags_job.rb +32 -37
- data/lib/htm/jobs/llm_call_timer.rb +53 -0
- data/lib/htm/jobs/node_lookup.rb +27 -0
- data/lib/htm/knowledge_memory.rb +153 -0
- data/lib/htm/loaders/chunk_sync.rb +168 -0
- data/lib/htm/loaders/markdown_chunker.rb +207 -36
- data/lib/htm/loaders/markdown_loader.rb +76 -120
- data/lib/htm/long_term_memory/fulltext_search.rb +15 -36
- data/lib/htm/long_term_memory/hybrid_search.rb +471 -544
- data/lib/htm/long_term_memory/node_operations.rb +110 -81
- data/lib/htm/long_term_memory/relevance_scorer.rb +232 -237
- data/lib/htm/long_term_memory/tag_operations.rb +201 -130
- data/lib/htm/long_term_memory/vector_search.rb +33 -61
- data/lib/htm/long_term_memory.rb +5 -17
- data/lib/htm/mcp/file_tools.rb +190 -0
- data/lib/htm/mcp/group_tools.rb +223 -233
- data/lib/htm/mcp/node_tools.rb +350 -0
- data/lib/htm/mcp/resources.rb +102 -28
- data/lib/htm/mcp/robot_team_tools.rb +119 -0
- data/lib/htm/mcp/server.rb +26 -14
- data/lib/htm/mcp/tag_tools.rb +130 -0
- data/lib/htm/mcp/tool.rb +40 -0
- data/lib/htm/mcp/tool_support.rb +88 -0
- data/lib/htm/mcp/tools.rb +232 -283
- data/lib/htm/models/file_source.rb +35 -20
- data/lib/htm/models/node.rb +287 -193
- data/lib/htm/models/node_link.rb +97 -0
- data/lib/htm/models/node_relationship.rb +3 -2
- data/lib/htm/models/node_tag.rb +22 -2
- data/lib/htm/models/robot.rb +4 -8
- data/lib/htm/models/robot_node.rb +5 -2
- data/lib/htm/models/tag.rb +53 -207
- data/lib/htm/node_enrichment.rb +75 -0
- data/lib/htm/node_view.rb +295 -0
- data/lib/htm/observability.rb +114 -98
- data/lib/htm/proposition_service.rb +38 -74
- data/lib/htm/query_cache.rb +145 -91
- data/lib/htm/railtie.rb +3 -7
- data/lib/htm/request_options.rb +149 -0
- data/lib/htm/robot_group/cache_sync.rb +69 -0
- data/lib/htm/robot_group/membership.rb +147 -0
- data/lib/htm/robot_group/working_memory_ledger.rb +111 -0
- data/lib/htm/robot_group.rb +128 -521
- data/lib/htm/robots/actions.rb +371 -0
- data/lib/htm/robots/neighbors.rb +63 -0
- data/lib/htm/robots/node_brief.rb +49 -0
- data/lib/htm/robots/supervisor.rb +140 -0
- data/lib/htm/robots/team.rb +124 -0
- data/lib/htm/robots/teams/archivist.rb +88 -0
- data/lib/htm/robots/teams/consolidator.rb +52 -0
- data/lib/htm/robots/teams/contradiction_detector.rb +67 -0
- data/lib/htm/robots/teams/tag_curator.rb +75 -0
- data/lib/htm/robots/tools.rb +127 -0
- data/lib/htm/robots.rb +125 -0
- data/lib/htm/search_filters.rb +116 -0
- data/lib/htm/sequel_config.rb +95 -59
- data/lib/htm/sql_builder.rb +162 -53
- data/lib/htm/startup_prompt.rb +73 -0
- data/lib/htm/tag_service.rb +104 -109
- data/lib/htm/tag_tree.rb +206 -0
- data/lib/htm/telemetry.rb +15 -16
- data/lib/htm/timeframe.rb +27 -9
- data/lib/htm/timeframe_extractor.rb +77 -55
- data/lib/htm/timeline.rb +230 -0
- data/lib/htm/version.rb +1 -1
- data/lib/htm/workflows/remember_workflow.rb +145 -136
- data/lib/htm/working_memory/entry.rb +53 -0
- data/lib/htm/working_memory/store.rb +97 -0
- data/lib/htm/working_memory.rb +137 -139
- data/lib/htm/working_memory_channel.rb +90 -40
- data/lib/htm.rb +177 -501
- data/mkdocs.yml +100 -23
- data/scripts/install_local_database.sh +7 -6
- metadata +1032 -594
- data/.tbls.yml +0 -31
- data/Rakefile +0 -240
- data/bin/htm_mcp +0 -27
- data/docs/api/yard/HTM/ActiveRecordConfig.md +0 -29
- data/docs/api/yard/HTM/ConfigSection.md +0 -28
- data/docs/database/public.file_sources.md +0 -42
- data/docs/database/public.file_sources.svg +0 -219
- data/docs/database/public.node_stats.md +0 -48
- data/docs/database/public.node_stats.svg +0 -41
- data/docs/database/public.node_tags.md +0 -41
- data/docs/database/public.node_tags.svg +0 -251
- data/docs/database/public.nodes.md +0 -61
- data/docs/database/public.nodes.svg +0 -283
- data/docs/database/public.nodes_tags.md +0 -39
- data/docs/database/public.nodes_tags.svg +0 -112
- data/docs/database/public.ontology_structure.md +0 -48
- data/docs/database/public.ontology_structure.svg +0 -38
- data/docs/database/public.operations_log.md +0 -42
- data/docs/database/public.operations_log.svg +0 -130
- data/docs/database/public.relationships.md +0 -39
- data/docs/database/public.relationships.svg +0 -41
- data/docs/database/public.robot_activity.md +0 -46
- data/docs/database/public.robot_activity.svg +0 -35
- data/docs/database/public.robot_nodes.md +0 -48
- data/docs/database/public.robot_nodes.svg +0 -251
- data/docs/database/public.robots.md +0 -34
- data/docs/database/public.robots.svg +0 -165
- data/docs/database/public.schema_migrations.md +0 -29
- data/docs/database/public.schema_migrations.svg +0 -26
- data/docs/database/public.tags.md +0 -38
- data/docs/database/public.tags.svg +0 -147
- data/docs/database/public.topic_relationships.md +0 -45
- data/docs/database/public.topic_relationships.svg +0 -32
- data/docs/database/schema.json +0 -1814
- data/docs/database_rake_tasks.md +0 -345
- data/docs/development/rake-tasks.md +0 -1113
- data/docs/using_rake_tasks_in_your_app.md +0 -383
- data/examples/06_example_app/Rakefile +0 -71
- data/examples/12_rails_app/app/models/model.rb +0 -5
- data/examples/12_rails_app/app/models/tool_call.rb +0 -5
- data/examples/12_rails_app/db/migrate/20250124000001_create_ruby_llm_tables.rb +0 -34
- data/examples/12_rails_app/db/migrate/20250124000002_create_models_table.rb +0 -28
- data/lib/htm/mcp/cli.rb +0 -583
- data/lib/htm/tasks.rb +0 -79
- data/lib/tasks/db.rake +0 -15
- data/lib/tasks/doc.rake +0 -301
- data/lib/tasks/files.rake +0 -285
- data/lib/tasks/htm.rake +0 -703
- data/lib/tasks/jobs.rake +0 -429
- data/lib/tasks/tags.rake +0 -184
- data/scripts/backfill_parent_tags.rb +0 -376
- data/scripts/normalize_plural_tags.rb +0 -335
data/lib/htm/mcp/tools.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'tool'
|
|
4
4
|
|
|
5
5
|
class HTM
|
|
6
6
|
module MCP
|
|
@@ -10,15 +10,20 @@ class HTM
|
|
|
10
10
|
DEFAULT_ROBOT_NAME = "mcp_default"
|
|
11
11
|
|
|
12
12
|
class << self
|
|
13
|
-
|
|
13
|
+
attr_reader :logger
|
|
14
|
+
|
|
15
|
+
# Use the given logger for all MCP session logging
|
|
16
|
+
def attach_logger(logger)
|
|
17
|
+
@logger = logger
|
|
18
|
+
end
|
|
14
19
|
|
|
15
20
|
def htm_instance
|
|
16
|
-
@htm_instance ||=
|
|
21
|
+
@htm_instance ||= build(DEFAULT_ROBOT_NAME)
|
|
17
22
|
end
|
|
18
23
|
|
|
19
24
|
def set_robot(name)
|
|
20
25
|
@robot_name = name
|
|
21
|
-
@htm_instance =
|
|
26
|
+
@htm_instance = build(name)
|
|
22
27
|
logger&.info "Robot set: #{name} (id=#{@htm_instance.robot_id})"
|
|
23
28
|
@htm_instance
|
|
24
29
|
end
|
|
@@ -30,243 +35,227 @@ class HTM
|
|
|
30
35
|
def robot_initialized?
|
|
31
36
|
@robot_name != nil
|
|
32
37
|
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
# An HTM instance for the robot, its working memory refilled from the
|
|
42
|
+
# database so context survives a server restart
|
|
43
|
+
def build(name)
|
|
44
|
+
HTM.new(robot_name: name).tap { it.working_memory.restore(it.robot_id) }
|
|
45
|
+
end
|
|
33
46
|
end
|
|
34
47
|
end
|
|
35
48
|
|
|
36
49
|
# Tool: Set the robot identity for this session
|
|
37
|
-
class SetRobotTool <
|
|
38
|
-
description "Set the robot identity for this session. Call this first to establish your robot name."
|
|
50
|
+
class SetRobotTool < Tool
|
|
51
|
+
description "Set the robot identity for this session. Call this first to establish your robot name. " \
|
|
52
|
+
"The robot's working memory from earlier sessions is restored."
|
|
39
53
|
|
|
40
54
|
arguments do
|
|
41
55
|
required(:name).filled(:string).description("The robot name (will be created if it doesn't exist)")
|
|
42
56
|
end
|
|
43
57
|
|
|
44
58
|
def call(name:)
|
|
45
|
-
|
|
59
|
+
log_info "SetRobotTool called: name=#{name.inspect}"
|
|
46
60
|
|
|
47
|
-
htm
|
|
48
|
-
robot = HTM::Models::Robot[htm.robot_id]
|
|
61
|
+
htm = Session.set_robot(name)
|
|
49
62
|
|
|
50
63
|
{
|
|
51
|
-
success:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
message:
|
|
64
|
+
success: true,
|
|
65
|
+
**robot_identity(htm),
|
|
66
|
+
node_count: robot_record(htm).node_count,
|
|
67
|
+
working_memory_nodes: htm.working_memory.node_count,
|
|
68
|
+
message: "Robot '#{name}' is now active for this session"
|
|
56
69
|
}.to_json
|
|
57
70
|
end
|
|
58
71
|
end
|
|
59
72
|
|
|
60
73
|
# Tool: Get current robot info
|
|
61
|
-
class GetRobotTool <
|
|
74
|
+
class GetRobotTool < Tool
|
|
75
|
+
read_only!
|
|
62
76
|
description "Get information about the current robot for this session"
|
|
63
77
|
|
|
64
78
|
arguments do
|
|
65
79
|
end
|
|
66
80
|
|
|
67
81
|
def call
|
|
68
|
-
|
|
82
|
+
log_info "GetRobotTool called"
|
|
69
83
|
|
|
70
|
-
htm
|
|
71
|
-
robot = HTM::Models::Robot[htm.robot_id]
|
|
84
|
+
htm = session_htm
|
|
72
85
|
|
|
73
86
|
{
|
|
74
87
|
success: true,
|
|
75
|
-
|
|
76
|
-
robot_name: htm.robot_name,
|
|
88
|
+
**robot_identity(htm),
|
|
77
89
|
initialized: Session.robot_initialized?,
|
|
78
|
-
memory_summary:
|
|
90
|
+
memory_summary: robot_record(htm).memory_summary
|
|
79
91
|
}.to_json
|
|
80
92
|
end
|
|
81
93
|
end
|
|
82
94
|
|
|
83
95
|
# Tool: Get working memory contents for session restore
|
|
84
|
-
class GetWorkingMemoryTool <
|
|
96
|
+
class GetWorkingMemoryTool < Tool
|
|
97
|
+
read_only!
|
|
85
98
|
description "Get all working memory contents for the current robot. Use this to restore a previous session."
|
|
86
99
|
|
|
87
100
|
arguments do
|
|
88
101
|
end
|
|
89
102
|
|
|
90
103
|
def call
|
|
91
|
-
htm
|
|
92
|
-
|
|
93
|
-
Session.logger&.info "GetWorkingMemoryTool called for robot=#{htm.robot_name}"
|
|
94
|
-
|
|
95
|
-
nodes = robot.robot_nodes_dataset
|
|
96
|
-
.in_working_memory
|
|
97
|
-
.eager(node: :tags)
|
|
98
|
-
.order(Sequel.desc(:last_remembered_at))
|
|
99
|
-
.all
|
|
100
|
-
.filter_map { |rn| format_working_memory_entry(rn) }
|
|
101
|
-
|
|
102
|
-
Session.logger&.info "GetWorkingMemoryTool complete: #{nodes.length} nodes in working memory"
|
|
103
|
-
{ success: true, robot_id: htm.robot_id, robot_name: htm.robot_name, count: nodes.length, working_memory: nodes }.to_json
|
|
104
|
-
rescue StandardError => e
|
|
105
|
-
Session.logger&.error "GetWorkingMemoryTool error: #{e.message}"
|
|
106
|
-
{ success: false, error: e.message, count: 0, working_memory: [] }.to_json
|
|
107
|
-
end
|
|
104
|
+
htm = session_htm
|
|
105
|
+
log_info "GetWorkingMemoryTool called for robot=#{htm.robot_name}"
|
|
108
106
|
|
|
109
|
-
|
|
107
|
+
nodes = working_memory_entries(robot_record(htm))
|
|
108
|
+
count = nodes.length
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
content: node.content,
|
|
117
|
-
tags: node.tags.map(&:name),
|
|
118
|
-
remember_count: rn.remember_count,
|
|
119
|
-
last_remembered_at: rn.last_remembered_at&.iso8601,
|
|
120
|
-
created_at: node.created_at.iso8601
|
|
121
|
-
}
|
|
110
|
+
log_info "GetWorkingMemoryTool complete: #{count} nodes in working memory"
|
|
111
|
+
{ success: true, **robot_identity(htm), count:, working_memory: nodes }.to_json
|
|
112
|
+
rescue StandardError => e
|
|
113
|
+
log_error "GetWorkingMemoryTool error: #{e.message}"
|
|
114
|
+
{ success: false, error: e.message, count: 0, working_memory: [] }.to_json
|
|
122
115
|
end
|
|
123
116
|
end
|
|
124
117
|
|
|
125
118
|
# Tool: Remember information
|
|
126
|
-
class RememberTool <
|
|
127
|
-
description "Store information in HTM long-term memory with optional tags"
|
|
119
|
+
class RememberTool < Tool
|
|
120
|
+
description "Store information in HTM long-term memory with optional tags and metadata. " \
|
|
121
|
+
"Embeddings, tags (and propositions, when enabled) are added in the background."
|
|
128
122
|
|
|
129
123
|
arguments do
|
|
130
124
|
required(:content).filled(:string).description("The content to remember")
|
|
131
125
|
optional(:tags).array(:string).description("Optional tags for categorization (e.g., ['database:postgresql', 'config'])")
|
|
132
126
|
optional(:metadata).hash.description("Optional metadata key-value pairs")
|
|
127
|
+
optional(:occurred_at).filled(:string).description(
|
|
128
|
+
"When it happened (ISO8601 or natural language like 'yesterday'). Default: a time the content " \
|
|
129
|
+
"states ('3 days ago', 'March 3, 2025'), else now"
|
|
130
|
+
)
|
|
131
|
+
optional(:occurred_until).filled(:string).description("When it stopped happening, for an event span")
|
|
132
|
+
optional(:valid_from).filled(:string).description("When the stated state became true (default: occurred_at)")
|
|
133
|
+
optional(:valid_until).filled(:string).description("When the stated state stopped being true")
|
|
134
|
+
optional(:supersedes).array(:integer).description(
|
|
135
|
+
"IDs of memories this one replaces. They are retired (soft-deleted, validity ended) in the same " \
|
|
136
|
+
"transaction and stay in this memory's timeline"
|
|
137
|
+
)
|
|
138
|
+
optional(:reason).filled(:string).description("Why the superseded memories are wrong now")
|
|
139
|
+
optional(:transition).filled(:string).description("Kind of change: 'removed', 'restored' or 'changed'")
|
|
140
|
+
optional(:status).filled(:string).description(
|
|
141
|
+
"How it is known: 'asserted' (default; stated directly), 'extracted' (copied from a source), " \
|
|
142
|
+
"'inferred' (concluded from other memories) or 'hypothesis' (unconfirmed)"
|
|
143
|
+
)
|
|
144
|
+
optional(:confidence).filled(:float).description("Confidence in it, 0.0-1.0 (default: unrated)")
|
|
145
|
+
optional(:evidence).array(:integer).description(
|
|
146
|
+
"IDs of memories it rests on (give them for inferred memories and hypotheses)"
|
|
147
|
+
)
|
|
133
148
|
end
|
|
134
149
|
|
|
135
|
-
def call(content:, tags: [], metadata: {}
|
|
136
|
-
|
|
150
|
+
def call(content:, tags: [], metadata: {}, supersedes: [], status: 'asserted', confidence: nil, evidence: [],
|
|
151
|
+
**event_time)
|
|
152
|
+
log_info "RememberTool called: content=#{content[0..50].inspect}..."
|
|
137
153
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
154
|
+
guarded do
|
|
155
|
+
htm = session_htm
|
|
156
|
+
node_id = htm.remember(content, tags:, metadata:, supersedes:, status:, confidence:, evidence:, **event_time)
|
|
157
|
+
node = HTM::Models::Node.eager(:tags).first!(id: node_id)
|
|
158
|
+
names = tag_names(node)
|
|
141
159
|
|
|
142
|
-
|
|
160
|
+
log_info "Memory stored: node_id=#{node_id}, robot=#{htm.robot_name}, tags=#{names}"
|
|
143
161
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
{
|
|
163
|
+
success: true,
|
|
164
|
+
node_id:,
|
|
165
|
+
**robot_identity(htm),
|
|
166
|
+
content: node.content,
|
|
167
|
+
superseded: supersedes,
|
|
168
|
+
**knowledge(node).except(:conflicts),
|
|
169
|
+
tags: names,
|
|
170
|
+
occurred_at: node.occurred_at&.iso8601,
|
|
171
|
+
time_source: node.time_source,
|
|
172
|
+
created_at: node.created_at.iso8601
|
|
173
|
+
}.to_json
|
|
174
|
+
end
|
|
153
175
|
end
|
|
154
176
|
end
|
|
155
177
|
|
|
156
178
|
# Tool: Recall memories
|
|
157
|
-
class RecallTool <
|
|
158
|
-
|
|
179
|
+
class RecallTool < Tool
|
|
180
|
+
STATUS_FILTER = "Only memories known these ways: any of 'asserted', 'extracted', 'inferred', 'hypothesis' " \
|
|
181
|
+
"(['asserted', 'extracted'] keeps direct evidence only). Each result carries its " \
|
|
182
|
+
'epistemic_status, confidence, evidence and conflicts'
|
|
183
|
+
|
|
184
|
+
read_only!
|
|
185
|
+
description "Search and retrieve memories from HTM using semantic (vector), full-text, or hybrid search, " \
|
|
186
|
+
"optionally filtered by time and metadata. Found memories join the robot's working memory."
|
|
159
187
|
|
|
160
188
|
arguments do
|
|
161
189
|
required(:query).filled(:string).description("Search query - can be natural language or keywords")
|
|
162
190
|
optional(:limit).filled(:integer).description("Maximum number of results (default: 10)")
|
|
163
191
|
optional(:strategy).filled(:string).description("Search strategy: 'vector', 'fulltext', or 'hybrid' (default: 'hybrid')")
|
|
164
|
-
optional(:timeframe).filled(:string).description(
|
|
192
|
+
optional(:timeframe).filled(:string).description(
|
|
193
|
+
"Time filter: natural language ('today', 'yesterday', 'last week', 'few days ago', 'last month'), " \
|
|
194
|
+
"'auto' to extract it from the query, an ISO8601 range 'start..end', or an ISO8601 date (since then)"
|
|
195
|
+
)
|
|
196
|
+
optional(:metadata).hash.description("Only memories whose metadata contains these key-value pairs")
|
|
197
|
+
optional(:time_axis).filled(:string).description(
|
|
198
|
+
"What timeframe filters on: 'event' (default; when the memory happened, any overlap with its span) " \
|
|
199
|
+
"or 'recorded' (when HTM stored it)"
|
|
200
|
+
)
|
|
201
|
+
optional(:as_of).filled(:string).description(
|
|
202
|
+
"Only memories whose state was true at this moment (ISO8601 or natural language)"
|
|
203
|
+
)
|
|
204
|
+
optional(:query_tags).array(:string).description("Tags that boost relevance (used with with_relevance)")
|
|
205
|
+
optional(:with_relevance).filled(:bool).description(
|
|
206
|
+
"Rank by a composite relevance score (semantic, tag, recency, access) and return it (default: false)"
|
|
207
|
+
)
|
|
208
|
+
optional(:include_history).filled(:bool).description(
|
|
209
|
+
"Follow each result with the earlier states it replaced (superseded, merged or archived), each with " \
|
|
210
|
+
"a status and a history_note saying what changed and when (default: false)"
|
|
211
|
+
)
|
|
212
|
+
optional(:status).array(:string).description(STATUS_FILTER)
|
|
213
|
+
optional(:min_confidence).filled(:float).description("Only memories at least this confident, 0.0-1.0 (unrated = 1.0)")
|
|
165
214
|
end
|
|
166
215
|
|
|
167
|
-
def call(query:, limit: 10, strategy: 'hybrid',
|
|
168
|
-
htm
|
|
169
|
-
|
|
216
|
+
def call(query:, limit: 10, strategy: 'hybrid', **)
|
|
217
|
+
htm = session_htm
|
|
218
|
+
robot_name = htm.robot_name
|
|
219
|
+
log_info "RecallTool called: query=#{query.inspect}, strategy=#{strategy}, limit=#{limit}, robot=#{robot_name}"
|
|
170
220
|
|
|
171
|
-
|
|
172
|
-
limit
|
|
173
|
-
strategy: strategy.to_sym,
|
|
174
|
-
raw: true
|
|
175
|
-
}
|
|
221
|
+
guarded do
|
|
222
|
+
results = recall_results(htm, query, "Recall", limit:, strategy:, **)
|
|
176
223
|
|
|
177
|
-
|
|
178
|
-
if timeframe
|
|
179
|
-
recall_opts[:timeframe] = parse_timeframe(timeframe)
|
|
224
|
+
{ success: true, query:, strategy:, robot_name:, count: results.length, results: }.to_json
|
|
180
225
|
end
|
|
181
|
-
|
|
182
|
-
memories = htm.recall(query, **recall_opts)
|
|
183
|
-
|
|
184
|
-
results = memories.map do |memory|
|
|
185
|
-
node = HTM::Models::Node.eager(:tags).first(id: memory['id'])
|
|
186
|
-
next unless node
|
|
187
|
-
{
|
|
188
|
-
id: memory['id'],
|
|
189
|
-
content: memory['content'],
|
|
190
|
-
tags: node.tags.map(&:name),
|
|
191
|
-
created_at: memory['created_at'],
|
|
192
|
-
score: memory['combined_score'] || memory['similarity']
|
|
193
|
-
}
|
|
194
|
-
end.compact
|
|
195
|
-
|
|
196
|
-
Session.logger&.info "Recall complete: found #{results.length} memories"
|
|
197
|
-
|
|
198
|
-
{
|
|
199
|
-
success: true,
|
|
200
|
-
query: query,
|
|
201
|
-
strategy: strategy,
|
|
202
|
-
robot_name: htm.robot_name,
|
|
203
|
-
count: results.length,
|
|
204
|
-
results: results
|
|
205
|
-
}.to_json
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
private
|
|
209
|
-
|
|
210
|
-
def parse_timeframe(timeframe)
|
|
211
|
-
now = Time.now
|
|
212
|
-
case timeframe.downcase
|
|
213
|
-
when 'today'
|
|
214
|
-
# Beginning of today
|
|
215
|
-
Time.new(now.year, now.month, now.day)..now
|
|
216
|
-
when 'this week'
|
|
217
|
-
# 7 days ago
|
|
218
|
-
(now - (7 * 24 * 60 * 60))..now
|
|
219
|
-
when 'this month'
|
|
220
|
-
# 30 days ago
|
|
221
|
-
(now - (30 * 24 * 60 * 60))..now
|
|
222
|
-
else
|
|
223
|
-
# Try to parse as ISO8601 range (start..end)
|
|
224
|
-
if timeframe.include?('..')
|
|
225
|
-
parts = timeframe.split('..')
|
|
226
|
-
Time.parse(parts[0])..Time.parse(parts[1])
|
|
227
|
-
else
|
|
228
|
-
# Single date - from that date to now
|
|
229
|
-
Time.parse(timeframe)..now
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
rescue ArgumentError
|
|
233
|
-
nil # Invalid timeframe, skip filtering
|
|
234
226
|
end
|
|
235
227
|
end
|
|
236
228
|
|
|
237
229
|
# Tool: Forget a memory
|
|
238
|
-
class ForgetTool <
|
|
239
|
-
|
|
230
|
+
class ForgetTool < Tool
|
|
231
|
+
destructive!
|
|
232
|
+
description "Forget a memory. Soft-deletes by default (recoverable with restore); " \
|
|
233
|
+
"permanent: true deletes it for good and requires confirm: 'confirmed'."
|
|
240
234
|
|
|
241
235
|
arguments do
|
|
242
236
|
required(:node_id).filled(:integer).description("The ID of the node to forget")
|
|
237
|
+
optional(:permanent).filled(:bool).description("Delete permanently instead of soft-deleting (default: false)")
|
|
238
|
+
optional(:confirm).filled(:string).description("Must be 'confirmed' when permanent is true")
|
|
243
239
|
end
|
|
244
240
|
|
|
245
|
-
def call(node_id:)
|
|
246
|
-
htm
|
|
247
|
-
|
|
241
|
+
def call(node_id:, permanent: false, confirm: nil)
|
|
242
|
+
htm = session_htm
|
|
243
|
+
robot_name = htm.robot_name
|
|
244
|
+
log_info "ForgetTool called: node_id=#{node_id}, permanent=#{permanent}, robot=#{robot_name}"
|
|
248
245
|
|
|
249
|
-
|
|
246
|
+
guarded do
|
|
247
|
+
htm.forget(node_id, soft: !permanent, confirm: htm_confirmation(confirm))
|
|
250
248
|
|
|
251
|
-
|
|
249
|
+
log_info "Memory #{permanent ? 'permanently deleted' : 'soft-deleted'}: node_id=#{node_id}"
|
|
252
250
|
|
|
253
|
-
|
|
254
|
-
success:
|
|
255
|
-
|
|
256
|
-
robot_name: htm.robot_name,
|
|
257
|
-
message: "Memory soft-deleted. Use restore to recover."
|
|
258
|
-
}.to_json
|
|
259
|
-
rescue HTM::NotFoundError, Sequel::NoMatchingRow
|
|
260
|
-
Session.logger&.warn "ForgetTool failed: node #{node_id} not found"
|
|
261
|
-
{
|
|
262
|
-
success: false,
|
|
263
|
-
error: "Node #{node_id} not found"
|
|
264
|
-
}.to_json
|
|
251
|
+
message = permanent ? "Memory permanently deleted." : "Memory soft-deleted. Use restore to recover."
|
|
252
|
+
{ success: true, node_id:, robot_name:, permanent:, message: }.to_json
|
|
253
|
+
end
|
|
265
254
|
end
|
|
266
255
|
end
|
|
267
256
|
|
|
268
257
|
# Tool: Restore a forgotten memory
|
|
269
|
-
class RestoreTool <
|
|
258
|
+
class RestoreTool < Tool
|
|
270
259
|
description "Restore a soft-deleted memory"
|
|
271
260
|
|
|
272
261
|
arguments do
|
|
@@ -274,30 +263,23 @@ class HTM
|
|
|
274
263
|
end
|
|
275
264
|
|
|
276
265
|
def call(node_id:)
|
|
277
|
-
htm
|
|
278
|
-
|
|
266
|
+
htm = session_htm
|
|
267
|
+
robot_name = htm.robot_name
|
|
268
|
+
log_info "RestoreTool called: node_id=#{node_id}, robot=#{robot_name}"
|
|
279
269
|
|
|
280
|
-
|
|
270
|
+
guarded do
|
|
271
|
+
htm.restore(node_id)
|
|
281
272
|
|
|
282
|
-
|
|
273
|
+
log_info "Memory restored: node_id=#{node_id}"
|
|
283
274
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
node_id: node_id,
|
|
287
|
-
robot_name: htm.robot_name,
|
|
288
|
-
message: "Memory restored successfully"
|
|
289
|
-
}.to_json
|
|
290
|
-
rescue HTM::NotFoundError, Sequel::NoMatchingRow
|
|
291
|
-
Session.logger&.warn "RestoreTool failed: node #{node_id} not found"
|
|
292
|
-
{
|
|
293
|
-
success: false,
|
|
294
|
-
error: "Node #{node_id} not found"
|
|
295
|
-
}.to_json
|
|
275
|
+
{ success: true, node_id:, robot_name:, message: "Memory restored successfully" }.to_json
|
|
276
|
+
end
|
|
296
277
|
end
|
|
297
278
|
end
|
|
298
279
|
|
|
299
280
|
# Tool: List tags
|
|
300
|
-
class ListTagsTool <
|
|
281
|
+
class ListTagsTool < Tool
|
|
282
|
+
read_only!
|
|
301
283
|
description "List all tags in HTM, optionally filtered by prefix"
|
|
302
284
|
|
|
303
285
|
arguments do
|
|
@@ -305,31 +287,28 @@ class HTM
|
|
|
305
287
|
end
|
|
306
288
|
|
|
307
289
|
def call(prefix: nil)
|
|
308
|
-
|
|
290
|
+
log_info "ListTagsTool called: prefix=#{prefix.inspect}"
|
|
309
291
|
|
|
310
|
-
|
|
311
|
-
|
|
292
|
+
tags = tags_dataset(prefix).map { { name: it.name, node_count: it.nodes.count } }
|
|
293
|
+
count = tags.length
|
|
312
294
|
|
|
313
|
-
|
|
314
|
-
{
|
|
315
|
-
name: tag.name,
|
|
316
|
-
node_count: tag.nodes.count
|
|
317
|
-
}
|
|
318
|
-
end
|
|
295
|
+
log_info "ListTagsTool complete: found #{count} tags"
|
|
319
296
|
|
|
320
|
-
|
|
297
|
+
{ success: true, prefix:, count:, tags: }.to_json
|
|
298
|
+
end
|
|
321
299
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
300
|
+
private
|
|
301
|
+
|
|
302
|
+
# All tags ordered by name, narrowed to a prefix when one is given
|
|
303
|
+
def tags_dataset(prefix)
|
|
304
|
+
dataset = HTM::Models::Tag.order(:name)
|
|
305
|
+
prefix ? dataset.with_prefix(prefix) : dataset
|
|
328
306
|
end
|
|
329
307
|
end
|
|
330
308
|
|
|
331
309
|
# Tool: Search tags with fuzzy matching
|
|
332
|
-
class SearchTagsTool <
|
|
310
|
+
class SearchTagsTool < Tool
|
|
311
|
+
read_only!
|
|
333
312
|
description "Search for tags using fuzzy matching (typo-tolerant). Use this when you're unsure of exact tag names."
|
|
334
313
|
|
|
335
314
|
arguments do
|
|
@@ -339,37 +318,34 @@ class HTM
|
|
|
339
318
|
end
|
|
340
319
|
|
|
341
320
|
def call(query:, limit: 20, min_similarity: 0.3)
|
|
342
|
-
|
|
321
|
+
log_info "SearchTagsTool called: query=#{query.inspect}, limit=#{limit}, min_similarity=#{min_similarity}"
|
|
343
322
|
|
|
344
|
-
|
|
345
|
-
|
|
323
|
+
results = session_htm.long_term_memory.search_tags(query, limit:, min_similarity:)
|
|
324
|
+
tags = results.map { tag_match(it) }
|
|
325
|
+
count = tags.length
|
|
346
326
|
|
|
347
|
-
|
|
327
|
+
log_info "SearchTagsTool complete: found #{count} tags"
|
|
348
328
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
tag = HTM::Models::Tag.first(name: result[:name])
|
|
352
|
-
{
|
|
353
|
-
name: result[:name],
|
|
354
|
-
similarity: result[:similarity].round(3),
|
|
355
|
-
node_count: tag&.nodes&.count || 0
|
|
356
|
-
}
|
|
357
|
-
end
|
|
329
|
+
{ success: true, query:, min_similarity:, count:, tags: }.to_json
|
|
330
|
+
end
|
|
358
331
|
|
|
359
|
-
|
|
332
|
+
private
|
|
360
333
|
|
|
334
|
+
# A search_tags row enriched with the tag's node count
|
|
335
|
+
def tag_match(result)
|
|
336
|
+
name = result[:name]
|
|
337
|
+
tag = HTM::Models::Tag.first(name:)
|
|
361
338
|
{
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
tags: tags
|
|
367
|
-
}.to_json
|
|
339
|
+
name:,
|
|
340
|
+
similarity: result[:similarity].round(3),
|
|
341
|
+
node_count: tag&.nodes&.count || 0
|
|
342
|
+
}
|
|
368
343
|
end
|
|
369
344
|
end
|
|
370
345
|
|
|
371
346
|
# Tool: Find nodes by topic with fuzzy option
|
|
372
|
-
class FindByTopicTool <
|
|
347
|
+
class FindByTopicTool < Tool
|
|
348
|
+
read_only!
|
|
373
349
|
description "Find memory nodes by topic/tag with optional fuzzy matching for typo tolerance"
|
|
374
350
|
|
|
375
351
|
arguments do
|
|
@@ -380,96 +356,69 @@ class HTM
|
|
|
380
356
|
optional(:min_similarity).filled(:float).description("Minimum similarity for fuzzy mode (default: 0.3)")
|
|
381
357
|
end
|
|
382
358
|
|
|
383
|
-
|
|
384
|
-
|
|
359
|
+
# fuzzy and exact are optional flags; an omitted flag means false
|
|
360
|
+
def call(topic:, fuzzy: nil, exact: nil, limit: 20, min_similarity: 0.3)
|
|
361
|
+
flags = { fuzzy: fuzzy == true, exact: exact == true }
|
|
362
|
+
log_info "FindByTopicTool called: topic=#{topic.inspect}, fuzzy=#{flags[:fuzzy]}, exact=#{flags[:exact]}"
|
|
385
363
|
|
|
386
|
-
|
|
387
|
-
|
|
364
|
+
nodes = session_htm.long_term_memory.nodes_by_topic(topic, **flags, min_similarity:, limit:)
|
|
365
|
+
results = nodes.filter_map { topic_result(it) }
|
|
366
|
+
count = results.length
|
|
388
367
|
|
|
389
|
-
|
|
390
|
-
topic,
|
|
391
|
-
fuzzy: fuzzy,
|
|
392
|
-
exact: exact,
|
|
393
|
-
min_similarity: min_similarity,
|
|
394
|
-
limit: limit
|
|
395
|
-
)
|
|
396
|
-
|
|
397
|
-
# Enrich with tags
|
|
398
|
-
results = nodes.map do |node_attrs|
|
|
399
|
-
node = HTM::Models::Node.eager(:tags).first(id: node_attrs['id'])
|
|
400
|
-
next unless node
|
|
368
|
+
log_info "FindByTopicTool complete: found #{count} nodes"
|
|
401
369
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
content: node.content[0..200],
|
|
405
|
-
tags: node.tags.map(&:name),
|
|
406
|
-
created_at: node.created_at.iso8601
|
|
407
|
-
}
|
|
408
|
-
end.compact
|
|
370
|
+
{ success: true, topic:, **flags, count:, results: }.to_json
|
|
371
|
+
end
|
|
409
372
|
|
|
410
|
-
|
|
373
|
+
private
|
|
411
374
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
exact: exact,
|
|
417
|
-
count: results.length,
|
|
418
|
-
results: results
|
|
419
|
-
}.to_json
|
|
375
|
+
# A nodes_by_topic row as a truncated node summary, or nil when the node is gone
|
|
376
|
+
def topic_result(node_attrs)
|
|
377
|
+
node = node_with_tags(node_attrs['id'])
|
|
378
|
+
node && node_summary(node, content_limit: 200)
|
|
420
379
|
end
|
|
421
380
|
end
|
|
422
381
|
|
|
423
382
|
# Tool: Get memory statistics
|
|
424
|
-
class StatsTool <
|
|
425
|
-
|
|
383
|
+
class StatsTool < Tool
|
|
384
|
+
read_only!
|
|
385
|
+
description "Get statistics about HTM memory: nodes, enrichment coverage (embeddings, tags, propositions), " \
|
|
386
|
+
"tags, robots, loaded files, relationships, and this session's working memory"
|
|
426
387
|
|
|
427
388
|
arguments do
|
|
428
389
|
end
|
|
429
390
|
|
|
430
391
|
def call
|
|
431
|
-
htm =
|
|
432
|
-
|
|
433
|
-
Session.logger&.info "StatsTool called for robot=#{htm.robot_name}"
|
|
434
|
-
|
|
435
|
-
# NOTE: Node uses set_dataset to exclude deleted, so .count returns active nodes
|
|
436
|
-
total_nodes = HTM::Models::Node.count
|
|
437
|
-
deleted_nodes = HTM::Models::Node.deleted.count
|
|
438
|
-
nodes_with_embeddings = HTM::Models::Node.with_embeddings.count
|
|
439
|
-
nodes_with_tags = HTM::Models::Node
|
|
440
|
-
.join(:node_tags, node_id: :id)
|
|
441
|
-
.distinct
|
|
442
|
-
.count
|
|
443
|
-
total_tags = HTM::Models::Tag.count
|
|
444
|
-
total_robots = HTM::Models::Robot.count
|
|
445
|
-
|
|
446
|
-
Session.logger&.info "StatsTool complete: #{total_nodes} active nodes, #{total_tags} tags"
|
|
392
|
+
htm = session_htm
|
|
393
|
+
log_info "StatsTool called for robot=#{htm.robot_name}"
|
|
447
394
|
|
|
395
|
+
robot = current_robot(htm)
|
|
396
|
+
statistics = memory_statistics
|
|
397
|
+
|
|
398
|
+
log_info "StatsTool complete: #{statistics.dig(:nodes, :active)} active nodes, #{statistics.dig(:tags, :total)} tags"
|
|
399
|
+
|
|
400
|
+
{ success: true, current_robot: robot, statistics: }.to_json
|
|
401
|
+
rescue StandardError => e
|
|
402
|
+
log_error "StatsTool error: #{e.message}"
|
|
403
|
+
failure(e.message)
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
private
|
|
407
|
+
|
|
408
|
+
def current_robot(htm)
|
|
409
|
+
id = htm.robot_id
|
|
410
|
+
working_memory = htm.working_memory
|
|
448
411
|
{
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
active: total_nodes,
|
|
458
|
-
deleted: deleted_nodes,
|
|
459
|
-
with_embeddings: nodes_with_embeddings,
|
|
460
|
-
with_tags: nodes_with_tags
|
|
461
|
-
},
|
|
462
|
-
tags: {
|
|
463
|
-
total: total_tags
|
|
464
|
-
},
|
|
465
|
-
robots: {
|
|
466
|
-
total: total_robots
|
|
467
|
-
}
|
|
412
|
+
name: htm.robot_name,
|
|
413
|
+
id:,
|
|
414
|
+
memory_summary: HTM::Models::Robot[id].memory_summary,
|
|
415
|
+
working_memory: {
|
|
416
|
+
nodes: working_memory.node_count,
|
|
417
|
+
tokens: working_memory.token_count,
|
|
418
|
+
max_tokens: working_memory.max_tokens,
|
|
419
|
+
utilization: working_memory.utilization_percentage
|
|
468
420
|
}
|
|
469
|
-
}
|
|
470
|
-
rescue StandardError => e
|
|
471
|
-
Session.logger&.error "StatsTool error: #{e.message}"
|
|
472
|
-
{ success: false, error: e.message }.to_json
|
|
421
|
+
}
|
|
473
422
|
end
|
|
474
423
|
end
|
|
475
424
|
|