cogmem 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BENCHMARKS.md +62 -0
- package/CHANGELOG.md +215 -0
- package/CONCURRENT_ACCESS.md +27 -0
- package/CONTRIBUTING.md +32 -0
- package/LICENSE +21 -0
- package/MEMORY_ATLAS.md +101 -0
- package/MEMORY_MODEL.md +179 -0
- package/README.md +751 -0
- package/RECALL_EXPLAINABILITY.md +152 -0
- package/RELEASE_CHECKLIST.md +92 -0
- package/SECURITY.md +21 -0
- package/dist/adapters/MarkdownSourceLoader.d.ts +5 -0
- package/dist/adapters/MarkdownSourceLoader.js +19 -0
- package/dist/adapters/conversation/ConversationMarkdownAdapter.d.ts +9 -0
- package/dist/adapters/conversation/ConversationMarkdownAdapter.js +233 -0
- package/dist/adapters/hermes/HermesStateDbAdapter.d.ts +10 -0
- package/dist/adapters/hermes/HermesStateDbAdapter.js +268 -0
- package/dist/adapters/hermes/HermesWorkspaceProfile.d.ts +15 -0
- package/dist/adapters/hermes/HermesWorkspaceProfile.js +82 -0
- package/dist/adapters/index.d.ts +15 -0
- package/dist/adapters/index.js +12 -0
- package/dist/adapters/openclaw/OpenClawAdapterSupport.d.ts +14 -0
- package/dist/adapters/openclaw/OpenClawAdapterSupport.js +29 -0
- package/dist/adapters/openclaw/OpenClawDailyMemoryAdapter.d.ts +8 -0
- package/dist/adapters/openclaw/OpenClawDailyMemoryAdapter.js +35 -0
- package/dist/adapters/openclaw/OpenClawMemoryIndexAdapter.d.ts +8 -0
- package/dist/adapters/openclaw/OpenClawMemoryIndexAdapter.js +23 -0
- package/dist/adapters/openclaw/OpenClawPersonaAdapter.d.ts +8 -0
- package/dist/adapters/openclaw/OpenClawPersonaAdapter.js +24 -0
- package/dist/adapters/openclaw/OpenClawSessionAdapter.d.ts +8 -0
- package/dist/adapters/openclaw/OpenClawSessionAdapter.js +15 -0
- package/dist/adapters/openclaw/OpenClawUserProfileAdapter.d.ts +8 -0
- package/dist/adapters/openclaw/OpenClawUserProfileAdapter.js +24 -0
- package/dist/adapters/openclaw/OpenClawWorkspaceProfile.d.ts +38 -0
- package/dist/adapters/openclaw/OpenClawWorkspaceProfile.js +199 -0
- package/dist/adapters/soul/SoulMarkdownAdapter.d.ts +14 -0
- package/dist/adapters/soul/SoulMarkdownAdapter.js +255 -0
- package/dist/adapters/types.d.ts +97 -0
- package/dist/adapters/types.js +185 -0
- package/dist/agent/AgentMemoryBackend.d.ts +291 -0
- package/dist/agent/AgentMemoryBackend.js +1272 -0
- package/dist/agent/AgentRecallQueryCompiler.d.ts +20 -0
- package/dist/agent/AgentRecallQueryCompiler.js +289 -0
- package/dist/agent/ContextHygiene.d.ts +9 -0
- package/dist/agent/ContextHygiene.js +20 -0
- package/dist/agent/MemoryUsageReceipt.d.ts +35 -0
- package/dist/agent/MemoryUsageReceipt.js +136 -0
- package/dist/agent/SessionWorkingState.d.ts +20 -0
- package/dist/agent/SessionWorkingState.js +94 -0
- package/dist/agent/index.d.ts +6 -0
- package/dist/agent/index.js +5 -0
- package/dist/algorithm/AlgorithmReviewBackend.d.ts +84 -0
- package/dist/algorithm/AlgorithmReviewBackend.js +261 -0
- package/dist/algorithm/AlgorithmReviewMetrics.d.ts +23 -0
- package/dist/algorithm/AlgorithmReviewMetrics.js +25 -0
- package/dist/algorithm/Phase2ModelAlgorithmReviewBackend.d.ts +38 -0
- package/dist/algorithm/Phase2ModelAlgorithmReviewBackend.js +372 -0
- package/dist/assets/FileAssetIngestionService.d.ts +32 -0
- package/dist/assets/FileAssetIngestionService.js +133 -0
- package/dist/assets/FileAssetStore.d.ts +36 -0
- package/dist/assets/FileAssetStore.js +152 -0
- package/dist/assets/FileBlockStore.d.ts +12 -0
- package/dist/assets/FileBlockStore.js +110 -0
- package/dist/assets/FileChunkStore.d.ts +23 -0
- package/dist/assets/FileChunkStore.js +179 -0
- package/dist/assets/FileChunker.d.ts +10 -0
- package/dist/assets/FileChunker.js +69 -0
- package/dist/assets/FileLoaderRegistry.d.ts +8 -0
- package/dist/assets/FileLoaderRegistry.js +21 -0
- package/dist/assets/FileLoaders.d.ts +37 -0
- package/dist/assets/FileLoaders.js +268 -0
- package/dist/assets/index.d.ts +10 -0
- package/dist/assets/index.js +7 -0
- package/dist/assets/providers/types.d.ts +47 -0
- package/dist/assets/providers/types.js +1 -0
- package/dist/assets/types.d.ts +159 -0
- package/dist/assets/types.js +1 -0
- package/dist/atlas/ActionFrameExtractor.d.ts +15 -0
- package/dist/atlas/ActionFrameExtractor.js +135 -0
- package/dist/atlas/MemoryAtlasIndexer.d.ts +32 -0
- package/dist/atlas/MemoryAtlasIndexer.js +74 -0
- package/dist/atlas/MemoryAtlasQueryCompiler.d.ts +23 -0
- package/dist/atlas/MemoryAtlasQueryCompiler.js +55 -0
- package/dist/atlas/MemoryAtlasService.d.ts +25 -0
- package/dist/atlas/MemoryAtlasService.js +216 -0
- package/dist/atlas/MemoryAtlasTypes.d.ts +107 -0
- package/dist/atlas/MemoryAtlasTypes.js +1 -0
- package/dist/atlas/index.d.ts +6 -0
- package/dist/atlas/index.js +5 -0
- package/dist/backend/SemanticBackend.d.ts +40 -0
- package/dist/backend/SemanticBackend.js +107 -0
- package/dist/batch/IngestionCursorStore.d.ts +52 -0
- package/dist/batch/IngestionCursorStore.js +153 -0
- package/dist/batch/InstalledBatchProcessor.d.ts +88 -0
- package/dist/batch/InstalledBatchProcessor.js +179 -0
- package/dist/batch/SourceOnboarding.d.ts +56 -0
- package/dist/batch/SourceOnboarding.js +366 -0
- package/dist/belief/BeliefGovernanceService.d.ts +59 -0
- package/dist/belief/BeliefGovernanceService.js +183 -0
- package/dist/belief/BeliefStore.d.ts +78 -0
- package/dist/belief/BeliefStore.js +898 -0
- package/dist/benchmark/BenchmarkRegistry.d.ts +16 -0
- package/dist/benchmark/BenchmarkRegistry.js +97 -0
- package/dist/benchmark/BenchmarkReport.d.ts +23 -0
- package/dist/benchmark/BenchmarkReport.js +62 -0
- package/dist/benchmark/BenchmarkRunner.d.ts +27 -0
- package/dist/benchmark/BenchmarkRunner.js +64 -0
- package/dist/benchmark/BrainEval.d.ts +134 -0
- package/dist/benchmark/BrainEval.js +252 -0
- package/dist/benchmark/ExternalBenchmarkRunner.d.ts +8 -0
- package/dist/benchmark/ExternalBenchmarkRunner.js +12 -0
- package/dist/benchmark/LongMemEvalAdapter.d.ts +46 -0
- package/dist/benchmark/LongMemEvalAdapter.js +88 -0
- package/dist/benchmark/LongMemEvalCli.d.ts +6 -0
- package/dist/benchmark/LongMemEvalCli.js +26 -0
- package/dist/bin/CliJson.d.ts +17 -0
- package/dist/bin/CliJson.js +20 -0
- package/dist/bin/brain-eval.d.ts +3 -0
- package/dist/bin/brain-eval.js +46 -0
- package/dist/bin/cogmem.d.ts +3 -0
- package/dist/bin/cogmem.js +95 -0
- package/dist/bin/compact.d.ts +3 -0
- package/dist/bin/compact.js +96 -0
- package/dist/bin/connect.d.ts +3 -0
- package/dist/bin/connect.js +398 -0
- package/dist/bin/doctor.d.ts +3 -0
- package/dist/bin/doctor.js +171 -0
- package/dist/bin/dream.d.ts +3 -0
- package/dist/bin/dream.js +65 -0
- package/dist/bin/episode.d.ts +3 -0
- package/dist/bin/episode.js +268 -0
- package/dist/bin/explain-recall.d.ts +3 -0
- package/dist/bin/explain-recall.js +139 -0
- package/dist/bin/import-hermes.d.ts +3 -0
- package/dist/bin/import-hermes.js +6 -0
- package/dist/bin/import-openclaw.d.ts +3 -0
- package/dist/bin/import-openclaw.js +6 -0
- package/dist/bin/import-support.d.ts +43 -0
- package/dist/bin/import-support.js +528 -0
- package/dist/bin/init.d.ts +30 -0
- package/dist/bin/init.js +761 -0
- package/dist/bin/mcp.d.ts +3 -0
- package/dist/bin/mcp.js +52 -0
- package/dist/bin/memory.d.ts +3 -0
- package/dist/bin/memory.js +803 -0
- package/dist/bin/migrate-vectors.d.ts +3 -0
- package/dist/bin/migrate-vectors.js +74 -0
- package/dist/bin/migrate.d.ts +3 -0
- package/dist/bin/migrate.js +95 -0
- package/dist/bin/normalize-transcript.d.ts +16 -0
- package/dist/bin/normalize-transcript.js +153 -0
- package/dist/bin/openclaw.d.ts +3 -0
- package/dist/bin/openclaw.js +78 -0
- package/dist/bin/prospective.d.ts +3 -0
- package/dist/bin/prospective.js +115 -0
- package/dist/bin/re-embed.d.ts +3 -0
- package/dist/bin/re-embed.js +46 -0
- package/dist/bin/repair.d.ts +3 -0
- package/dist/bin/repair.js +118 -0
- package/dist/bin/snapshot.d.ts +3 -0
- package/dist/bin/snapshot.js +100 -0
- package/dist/bin/strategy.d.ts +3 -0
- package/dist/bin/strategy.js +66 -0
- package/dist/bin/update-release.d.ts +15 -0
- package/dist/bin/update-release.js +62 -0
- package/dist/bin/update.d.ts +3 -0
- package/dist/bin/update.js +215 -0
- package/dist/binding/BindingClassifier.d.ts +19 -0
- package/dist/binding/BindingClassifier.js +270 -0
- package/dist/binding/BindingDecisionEngine.d.ts +11 -0
- package/dist/binding/BindingDecisionEngine.js +13 -0
- package/dist/binding/ClaimKeyGenerator.d.ts +4 -0
- package/dist/binding/ClaimKeyGenerator.js +21 -0
- package/dist/binding/MemoryBindingService.d.ts +28 -0
- package/dist/binding/MemoryBindingService.js +283 -0
- package/dist/binding/MemoryBindingTypes.d.ts +140 -0
- package/dist/binding/MemoryBindingTypes.js +1 -0
- package/dist/binding/TopicPathRegistry.d.ts +5 -0
- package/dist/binding/TopicPathRegistry.js +33 -0
- package/dist/binding/index.d.ts +12 -0
- package/dist/binding/index.js +6 -0
- package/dist/boards/ApprovalBoard.d.ts +14 -0
- package/dist/boards/ApprovalBoard.js +32 -0
- package/dist/boards/Board.d.ts +23 -0
- package/dist/boards/Board.js +1 -0
- package/dist/boards/BoardEventBuffer.d.ts +10 -0
- package/dist/boards/BoardEventBuffer.js +22 -0
- package/dist/boards/BoardEventBus.d.ts +15 -0
- package/dist/boards/BoardEventBus.js +38 -0
- package/dist/boards/BoardEventFilter.d.ts +5 -0
- package/dist/boards/BoardEventFilter.js +1 -0
- package/dist/boards/BoardRegistry.d.ts +11 -0
- package/dist/boards/BoardRegistry.js +15 -0
- package/dist/boards/ContextBoard.d.ts +15 -0
- package/dist/boards/ContextBoard.js +33 -0
- package/dist/boards/MemoryBoard.d.ts +13 -0
- package/dist/boards/MemoryBoard.js +30 -0
- package/dist/boards/ProcessBoard.d.ts +16 -0
- package/dist/boards/ProcessBoard.js +56 -0
- package/dist/boards/ProposalBoard.d.ts +13 -0
- package/dist/boards/ProposalBoard.js +37 -0
- package/dist/boards/ReasoningTraceBoard.d.ts +11 -0
- package/dist/boards/ReasoningTraceBoard.js +34 -0
- package/dist/boards/TaskBoard.d.ts +14 -0
- package/dist/boards/TaskBoard.js +37 -0
- package/dist/boards/index.d.ts +13 -0
- package/dist/boards/index.js +12 -0
- package/dist/config/CogmemConfig.d.ts +43 -0
- package/dist/config/CogmemConfig.js +247 -0
- package/dist/config/VectorDimension.d.ts +13 -0
- package/dist/config/VectorDimension.js +53 -0
- package/dist/context/ContextCortex.d.ts +71 -0
- package/dist/context/ContextCortex.js +156 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +1 -0
- package/dist/core/ImportanceLevels.d.ts +4 -0
- package/dist/core/ImportanceLevels.js +6 -0
- package/dist/core/IntentParser.d.ts +12 -0
- package/dist/core/IntentParser.js +211 -0
- package/dist/core/MemoryGraph.d.ts +100 -0
- package/dist/core/MemoryGraph.js +860 -0
- package/dist/core/Metabolism.d.ts +43 -0
- package/dist/core/Metabolism.js +196 -0
- package/dist/core/Neuron.d.ts +20 -0
- package/dist/core/Neuron.js +51 -0
- package/dist/core/QueryClassifier.d.ts +36 -0
- package/dist/core/QueryClassifier.js +161 -0
- package/dist/core/Reflection.d.ts +42 -0
- package/dist/core/Reflection.js +183 -0
- package/dist/core/ResonanceCore.d.ts +26 -0
- package/dist/core/ResonanceCore.js +115 -0
- package/dist/core/Synapse.d.ts +10 -0
- package/dist/core/Synapse.js +27 -0
- package/dist/core/TwoStagePulseRanker.d.ts +16 -0
- package/dist/core/TwoStagePulseRanker.js +120 -0
- package/dist/dream/DreamScheduler.d.ts +47 -0
- package/dist/dream/DreamScheduler.js +156 -0
- package/dist/dream/index.d.ts +2 -0
- package/dist/dream/index.js +1 -0
- package/dist/embedding/EmbeddingProvider.d.ts +16 -0
- package/dist/embedding/EmbeddingProvider.js +12 -0
- package/dist/embedding/NeuronEmbeddingStore.d.ts +38 -0
- package/dist/embedding/NeuronEmbeddingStore.js +193 -0
- package/dist/embedding/OllamaEmbeddingProvider.d.ts +21 -0
- package/dist/embedding/OllamaEmbeddingProvider.js +65 -0
- package/dist/embedding/QwenAPIEmbeddingProvider.d.ts +26 -0
- package/dist/embedding/QwenAPIEmbeddingProvider.js +53 -0
- package/dist/embedding/ReEmbeddingPipeline.d.ts +30 -0
- package/dist/embedding/ReEmbeddingPipeline.js +119 -0
- package/dist/embedding/ReEmbeddingStatus.d.ts +10 -0
- package/dist/embedding/ReEmbeddingStatus.js +1 -0
- package/dist/embedding/index.d.ts +11 -0
- package/dist/embedding/index.js +5 -0
- package/dist/encryption/AesGcmEncryptionProvider.d.ts +9 -0
- package/dist/encryption/AesGcmEncryptionProvider.js +42 -0
- package/dist/encryption/EncryptionProvider.d.ts +6 -0
- package/dist/encryption/EncryptionProvider.js +3 -0
- package/dist/encryption/index.d.ts +4 -0
- package/dist/encryption/index.js +2 -0
- package/dist/engine/BeliefExtractor.d.ts +48 -0
- package/dist/engine/BeliefExtractor.js +1189 -0
- package/dist/engine/CognitiveGraphCompiler.d.ts +24 -0
- package/dist/engine/CognitiveGraphCompiler.js +243 -0
- package/dist/engine/ConsolidationPipeline.d.ts +66 -0
- package/dist/engine/ConsolidationPipeline.js +376 -0
- package/dist/engine/ConsolidationTrigger.d.ts +18 -0
- package/dist/engine/ConsolidationTrigger.js +41 -0
- package/dist/engine/CrossTopicSynthesizer.d.ts +28 -0
- package/dist/engine/CrossTopicSynthesizer.js +70 -0
- package/dist/engine/CrossTopicTrigger.d.ts +17 -0
- package/dist/engine/CrossTopicTrigger.js +29 -0
- package/dist/engine/DeepWriteConfig.d.ts +14 -0
- package/dist/engine/DeepWriteConfig.js +37 -0
- package/dist/engine/DeepWriteMemoryCompiler.d.ts +43 -0
- package/dist/engine/DeepWriteMemoryCompiler.js +42 -0
- package/dist/engine/DeepWriteMemoryOrchestrator.d.ts +60 -0
- package/dist/engine/DeepWriteMemoryOrchestrator.js +175 -0
- package/dist/engine/DeepWritePromotionPolicy.d.ts +48 -0
- package/dist/engine/DeepWritePromotionPolicy.js +514 -0
- package/dist/engine/DeepWriteRedactor.d.ts +14 -0
- package/dist/engine/DeepWriteRedactor.js +53 -0
- package/dist/engine/DreamCuratorSchedule.d.ts +18 -0
- package/dist/engine/DreamCuratorSchedule.js +95 -0
- package/dist/engine/DreamCuratorWorker.d.ts +67 -0
- package/dist/engine/DreamCuratorWorker.js +908 -0
- package/dist/engine/EntityResolutionEngine.d.ts +45 -0
- package/dist/engine/EntityResolutionEngine.js +105 -0
- package/dist/engine/EpisodicSemanticDistiller.d.ts +25 -0
- package/dist/engine/EpisodicSemanticDistiller.js +68 -0
- package/dist/engine/EvolutionVerifier.d.ts +39 -0
- package/dist/engine/EvolutionVerifier.js +104 -0
- package/dist/engine/FactCompiler.d.ts +41 -0
- package/dist/engine/FactCompiler.js +820 -0
- package/dist/engine/GraphCommunityEngine.d.ts +20 -0
- package/dist/engine/GraphCommunityEngine.js +91 -0
- package/dist/engine/ImportanceSignalDetector.d.ts +11 -0
- package/dist/engine/ImportanceSignalDetector.js +51 -0
- package/dist/engine/IngestionEngine.d.ts +44 -0
- package/dist/engine/IngestionEngine.js +182 -0
- package/dist/engine/InteractionBinder.d.ts +16 -0
- package/dist/engine/InteractionBinder.js +87 -0
- package/dist/engine/LocalSemanticCompiler.d.ts +40 -0
- package/dist/engine/LocalSemanticCompiler.js +111 -0
- package/dist/engine/MemoryConsolidationEngine.d.ts +11 -0
- package/dist/engine/MemoryConsolidationEngine.js +21 -0
- package/dist/engine/MemoryGate.d.ts +10 -0
- package/dist/engine/MemoryGate.js +34 -0
- package/dist/engine/OfflineConsolidationPipeline.d.ts +148 -0
- package/dist/engine/OfflineConsolidationPipeline.js +670 -0
- package/dist/engine/OrphanCleaner.d.ts +15 -0
- package/dist/engine/OrphanCleaner.js +27 -0
- package/dist/engine/PipelineMetrics.d.ts +32 -0
- package/dist/engine/PipelineMetrics.js +126 -0
- package/dist/engine/PrincipleDecayPolicy.d.ts +17 -0
- package/dist/engine/PrincipleDecayPolicy.js +64 -0
- package/dist/engine/TopologyCompiler.d.ts +25 -0
- package/dist/engine/TopologyCompiler.js +276 -0
- package/dist/engine/WorkingMemoryDelta.d.ts +23 -0
- package/dist/engine/WorkingMemoryDelta.js +63 -0
- package/dist/entity/EntityGovernanceService.d.ts +47 -0
- package/dist/entity/EntityGovernanceService.js +215 -0
- package/dist/entity/index.d.ts +3 -0
- package/dist/entity/index.js +1 -0
- package/dist/episode/CogmemBlockStripper.d.ts +11 -0
- package/dist/episode/CogmemBlockStripper.js +58 -0
- package/dist/episode/CorrectionResolver.d.ts +30 -0
- package/dist/episode/CorrectionResolver.js +17 -0
- package/dist/episode/EpisodeAssembler.d.ts +54 -0
- package/dist/episode/EpisodeAssembler.js +203 -0
- package/dist/episode/EpisodeImportIdentity.d.ts +7 -0
- package/dist/episode/EpisodeImportIdentity.js +17 -0
- package/dist/episode/EpisodeSemanticSummarizer.d.ts +4 -0
- package/dist/episode/EpisodeSemanticSummarizer.js +31 -0
- package/dist/episode/EpisodeStore.d.ts +189 -0
- package/dist/episode/EpisodeStore.js +680 -0
- package/dist/episode/EpisodeTypes.d.ts +96 -0
- package/dist/episode/EpisodeTypes.js +1 -0
- package/dist/episode/TurnRelationClassifier.d.ts +40 -0
- package/dist/episode/TurnRelationClassifier.js +205 -0
- package/dist/episode/index.d.ts +9 -0
- package/dist/episode/index.js +8 -0
- package/dist/eval/datasets/contradiction_injection.d.ts +3 -0
- package/dist/eval/datasets/contradiction_injection.js +56 -0
- package/dist/eval/datasets/noisy_tool_output_corpus.d.ts +16 -0
- package/dist/eval/datasets/noisy_tool_output_corpus.js +59 -0
- package/dist/eval/datasets/synthetic_long_conversation.d.ts +40 -0
- package/dist/eval/datasets/synthetic_long_conversation.js +136 -0
- package/dist/eval/runners/EvalRunner.d.ts +12 -0
- package/dist/eval/runners/EvalRunner.js +66 -0
- package/dist/eval/runners/ReportFormatter.d.ts +13 -0
- package/dist/eval/runners/ReportFormatter.js +59 -0
- package/dist/eval/strategy/ContextOutcomeStore.d.ts +12 -0
- package/dist/eval/strategy/ContextOutcomeStore.js +44 -0
- package/dist/eval/strategy/ContextPolicyScorer.d.ts +25 -0
- package/dist/eval/strategy/ContextPolicyScorer.js +58 -0
- package/dist/eval/strategy/MemoryUseJudge.d.ts +49 -0
- package/dist/eval/strategy/MemoryUseJudge.js +75 -0
- package/dist/eval/strategy/StrategyDiversitySelector.d.ts +8 -0
- package/dist/eval/strategy/StrategyDiversitySelector.js +44 -0
- package/dist/eval/strategy/StrategyRolloutEvaluator.d.ts +15 -0
- package/dist/eval/strategy/StrategyRolloutEvaluator.js +30 -0
- package/dist/eval/strategy/index.d.ts +6 -0
- package/dist/eval/strategy/index.js +5 -0
- package/dist/factory.d.ts +726 -0
- package/dist/factory.js +2118 -0
- package/dist/governance/CandidateReviewService.d.ts +33 -0
- package/dist/governance/CandidateReviewService.js +126 -0
- package/dist/governance/ContradictionResolver.d.ts +22 -0
- package/dist/governance/ContradictionResolver.js +54 -0
- package/dist/governance/CredibilityScorer.d.ts +10 -0
- package/dist/governance/CredibilityScorer.js +29 -0
- package/dist/governance/DecayPolicy.d.ts +18 -0
- package/dist/governance/DecayPolicy.js +28 -0
- package/dist/governance/MemoryExplain.d.ts +46 -0
- package/dist/governance/MemoryExplain.js +62 -0
- package/dist/governance/MemoryGovernanceExecutor.d.ts +18 -0
- package/dist/governance/MemoryGovernanceExecutor.js +37 -0
- package/dist/governance/MemoryGovernancePlan.d.ts +36 -0
- package/dist/governance/MemoryGovernancePlan.js +1 -0
- package/dist/governance/MemoryGovernanceValidator.d.ts +13 -0
- package/dist/governance/MemoryGovernanceValidator.js +53 -0
- package/dist/governance/ObservationHygieneRules.d.ts +17 -0
- package/dist/governance/ObservationHygieneRules.js +28 -0
- package/dist/governance/PiiRedactor.d.ts +20 -0
- package/dist/governance/PiiRedactor.js +37 -0
- package/dist/governance/SupersedeChain.d.ts +21 -0
- package/dist/governance/SupersedeChain.js +107 -0
- package/dist/governance/index.d.ts +14 -0
- package/dist/governance/index.js +6 -0
- package/dist/graph/BrainGraphView.d.ts +20 -0
- package/dist/graph/BrainGraphView.js +45 -0
- package/dist/host/openclaw/AutoMemoryPluginInstaller.d.ts +45 -0
- package/dist/host/openclaw/AutoMemoryPluginInstaller.js +1904 -0
- package/dist/internal.d.ts +148 -0
- package/dist/internal.js +144 -0
- package/dist/lexicon/coreMemoryLexicon.d.ts +96 -0
- package/dist/lexicon/coreMemoryLexicon.js +525 -0
- package/dist/lexicon/language-packs/en.d.ts +42 -0
- package/dist/lexicon/language-packs/en.js +41 -0
- package/dist/lexicon/language-packs/zh.d.ts +42 -0
- package/dist/lexicon/language-packs/zh.js +41 -0
- package/dist/lexicon/zh/entities.d.ts +2 -0
- package/dist/lexicon/zh/entities.js +17 -0
- package/dist/lexicon/zh/index.d.ts +5 -0
- package/dist/lexicon/zh/index.js +3 -0
- package/dist/lexicon/zh/stopwords.d.ts +2 -0
- package/dist/lexicon/zh/stopwords.js +22 -0
- package/dist/lexicon/zh/topics.d.ts +6 -0
- package/dist/lexicon/zh/topics.js +52 -0
- package/dist/mcp/CoreMcpTools.d.ts +33 -0
- package/dist/mcp/CoreMcpTools.js +832 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.js +29 -0
- package/dist/meta/MetaObservationCollector.d.ts +37 -0
- package/dist/meta/MetaObservationCollector.js +348 -0
- package/dist/meta/PolicyProposalGenerator.d.ts +11 -0
- package/dist/meta/PolicyProposalGenerator.js +159 -0
- package/dist/meta/ProposalApplier.d.ts +18 -0
- package/dist/meta/ProposalApplier.js +91 -0
- package/dist/meta/ProposalConfigOverlay.d.ts +13 -0
- package/dist/meta/ProposalConfigOverlay.js +27 -0
- package/dist/meta/ProposalEvalRunner.d.ts +31 -0
- package/dist/meta/ProposalEvalRunner.js +62 -0
- package/dist/meta/ProposalLedger.d.ts +34 -0
- package/dist/meta/ProposalLedger.js +242 -0
- package/dist/meta/types.d.ts +63 -0
- package/dist/meta/types.js +1 -0
- package/dist/migrations/0001_init.d.ts +4 -0
- package/dist/migrations/0001_init.js +67 -0
- package/dist/migrations/0002_v06_platform.d.ts +10 -0
- package/dist/migrations/0002_v06_platform.js +103 -0
- package/dist/migrations/0003_v07_dialogues.d.ts +9 -0
- package/dist/migrations/0003_v07_dialogues.js +53 -0
- package/dist/migrations/0004_v09_self_improvement.d.ts +9 -0
- package/dist/migrations/0004_v09_self_improvement.js +100 -0
- package/dist/migrations/0005_dialogue_buffer.d.ts +8 -0
- package/dist/migrations/0005_dialogue_buffer.js +44 -0
- package/dist/migrations/0006_deep_write_memory.d.ts +3 -0
- package/dist/migrations/0006_deep_write_memory.js +54 -0
- package/dist/migrations/0007_deep_write_summaries.d.ts +3 -0
- package/dist/migrations/0007_deep_write_summaries.js +24 -0
- package/dist/migrations/0009_memory_importance.d.ts +3 -0
- package/dist/migrations/0009_memory_importance.js +18 -0
- package/dist/migrations/0010_skill_neurons.d.ts +3 -0
- package/dist/migrations/0010_skill_neurons.js +19 -0
- package/dist/migrations/0011_topic_path.d.ts +3 -0
- package/dist/migrations/0011_topic_path.js +19 -0
- package/dist/migrations/0012_governance_security.d.ts +3 -0
- package/dist/migrations/0012_governance_security.js +23 -0
- package/dist/migrations/0015_memory_governance.d.ts +3 -0
- package/dist/migrations/0015_memory_governance.js +74 -0
- package/dist/migrations/0016_entity_governance.d.ts +3 -0
- package/dist/migrations/0016_entity_governance.js +40 -0
- package/dist/migrations/0017_belief_graph.d.ts +3 -0
- package/dist/migrations/0017_belief_graph.js +41 -0
- package/dist/migrations/0018_temporal_memory.d.ts +3 -0
- package/dist/migrations/0018_temporal_memory.js +25 -0
- package/dist/migrations/0019_context_cortex.d.ts +3 -0
- package/dist/migrations/0019_context_cortex.js +19 -0
- package/dist/migrations/0020_prospective_memory.d.ts +3 -0
- package/dist/migrations/0020_prospective_memory.js +42 -0
- package/dist/migrations/0021_strategy_cortex.d.ts +3 -0
- package/dist/migrations/0021_strategy_cortex.js +23 -0
- package/dist/migrations/0022_episode_dream_engine.d.ts +3 -0
- package/dist/migrations/0022_episode_dream_engine.js +74 -0
- package/dist/migrations/0023_episode_dream_hardening.d.ts +3 -0
- package/dist/migrations/0023_episode_dream_hardening.js +65 -0
- package/dist/migrations/0024_episode_ontology_reliability.d.ts +3 -0
- package/dist/migrations/0024_episode_ontology_reliability.js +70 -0
- package/dist/migrations/0025_memory_atlas.d.ts +6 -0
- package/dist/migrations/0025_memory_atlas.js +268 -0
- package/dist/migrations/0026_runtime_governance_atlas_reliability.d.ts +3 -0
- package/dist/migrations/0026_runtime_governance_atlas_reliability.js +72 -0
- package/dist/migrations/0027_openclaw_upgrade_hotfix.d.ts +3 -0
- package/dist/migrations/0027_openclaw_upgrade_hotfix.js +21 -0
- package/dist/migrations/SchemaMigrationRunner.d.ts +21 -0
- package/dist/migrations/SchemaMigrationRunner.js +67 -0
- package/dist/migrations/index.d.ts +36 -0
- package/dist/migrations/index.js +57 -0
- package/dist/models/ModelCapabilityRouter.d.ts +17 -0
- package/dist/models/ModelCapabilityRouter.js +75 -0
- package/dist/models/ModelRegistry.d.ts +15 -0
- package/dist/models/ModelRegistry.js +132 -0
- package/dist/models/ModelRole.d.ts +19 -0
- package/dist/models/ModelRole.js +1 -0
- package/dist/models/UserInsight.d.ts +16 -0
- package/dist/models/UserInsight.js +9 -0
- package/dist/models/UserInsightExtractor.d.ts +19 -0
- package/dist/models/UserInsightExtractor.js +99 -0
- package/dist/models/UserModelManager.d.ts +21 -0
- package/dist/models/UserModelManager.js +41 -0
- package/dist/models/UserModelStore.d.ts +20 -0
- package/dist/models/UserModelStore.js +136 -0
- package/dist/models/WorkingMemoryReporter.d.ts +16 -0
- package/dist/models/WorkingMemoryReporter.js +38 -0
- package/dist/models/adapters/MemoryReviewAdapter.d.ts +12 -0
- package/dist/models/adapters/MemoryReviewAdapter.js +77 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +5 -0
- package/dist/models/providers/AnthropicClient.d.ts +17 -0
- package/dist/models/providers/AnthropicClient.js +40 -0
- package/dist/models/providers/OpenAICompatibleClient.d.ts +24 -0
- package/dist/models/providers/OpenAICompatibleClient.js +76 -0
- package/dist/observability/DecisionExplainer.d.ts +5 -0
- package/dist/observability/DecisionExplainer.js +62 -0
- package/dist/observability/TraceEvent.d.ts +11 -0
- package/dist/observability/TraceEvent.js +1 -0
- package/dist/observability/TraceQuery.d.ts +15 -0
- package/dist/observability/TraceQuery.js +28 -0
- package/dist/observability/TraceStore.d.ts +15 -0
- package/dist/observability/TraceStore.js +110 -0
- package/dist/observability/TraceWriter.d.ts +8 -0
- package/dist/observability/TraceWriter.js +14 -0
- package/dist/ontology/MemoryOntology.d.ts +4 -0
- package/dist/ontology/MemoryOntology.js +7 -0
- package/dist/prospective/ProspectiveMemoryService.d.ts +79 -0
- package/dist/prospective/ProspectiveMemoryService.js +258 -0
- package/dist/prospective/index.d.ts +2 -0
- package/dist/prospective/index.js +1 -0
- package/dist/public.d.ts +160 -0
- package/dist/public.js +115 -0
- package/dist/recall/BrainRecall.d.ts +96 -0
- package/dist/recall/BrainRecall.js +574 -0
- package/dist/recall/HierarchicalRecallRouter.d.ts +24 -0
- package/dist/recall/HierarchicalRecallRouter.js +62 -0
- package/dist/recall/RecallExplanation.d.ts +59 -0
- package/dist/recall/RecallExplanation.js +244 -0
- package/dist/recall/RecallGovernance.d.ts +10 -0
- package/dist/recall/RecallGovernance.js +83 -0
- package/dist/recall/RecallSufficiencyGate.d.ts +40 -0
- package/dist/recall/RecallSufficiencyGate.js +208 -0
- package/dist/recall/SourceContextMetadata.d.ts +49 -0
- package/dist/recall/SourceContextMetadata.js +134 -0
- package/dist/recall/TopicClassifier.d.ts +33 -0
- package/dist/recall/TopicClassifier.js +138 -0
- package/dist/recall/TopicDecayPolicy.d.ts +15 -0
- package/dist/recall/TopicDecayPolicy.js +46 -0
- package/dist/recall/TopicRegistry.d.ts +12 -0
- package/dist/recall/TopicRegistry.js +26 -0
- package/dist/recall/TopicSummaryBoard.d.ts +27 -0
- package/dist/recall/TopicSummaryBoard.js +139 -0
- package/dist/recall/VectorCandidateFilter.d.ts +50 -0
- package/dist/recall/VectorCandidateFilter.js +78 -0
- package/dist/retrieval/ConditionDslEvaluator.d.ts +33 -0
- package/dist/retrieval/ConditionDslEvaluator.js +160 -0
- package/dist/retrieval/EntityActivationIndex.d.ts +14 -0
- package/dist/retrieval/EntityActivationIndex.js +19 -0
- package/dist/retrieval/EvidenceFusionPolicy.d.ts +30 -0
- package/dist/retrieval/EvidenceFusionPolicy.js +112 -0
- package/dist/retrieval/EvidenceFusionRanker.d.ts +13 -0
- package/dist/retrieval/EvidenceFusionRanker.js +17 -0
- package/dist/retrieval/NarrativeRecallAssembler.d.ts +32 -0
- package/dist/retrieval/NarrativeRecallAssembler.js +27 -0
- package/dist/retrieval/NativeQueryParser.d.ts +23 -0
- package/dist/retrieval/NativeQueryParser.js +135 -0
- package/dist/retrieval/PlanDslExecutor.d.ts +67 -0
- package/dist/retrieval/PlanDslExecutor.js +194 -0
- package/dist/retrieval/PolicyRuntimeEvaluator.d.ts +48 -0
- package/dist/retrieval/PolicyRuntimeEvaluator.js +96 -0
- package/dist/retrieval/PolicySideEffectExecutor.d.ts +50 -0
- package/dist/retrieval/PolicySideEffectExecutor.js +202 -0
- package/dist/retrieval/PulseRetrievalEngine.d.ts +37 -0
- package/dist/retrieval/PulseRetrievalEngine.js +51 -0
- package/dist/retrieval/QueryCompiler.d.ts +18 -0
- package/dist/retrieval/QueryCompiler.js +97 -0
- package/dist/retrieval/QueryTimePendingEntityResolver.d.ts +67 -0
- package/dist/retrieval/QueryTimePendingEntityResolver.js +260 -0
- package/dist/retrieval/RetrievalPlanner.d.ts +42 -0
- package/dist/retrieval/RetrievalPlanner.js +209 -0
- package/dist/retrieval/TemporalBranchSearch.d.ts +38 -0
- package/dist/retrieval/TemporalBranchSearch.js +109 -0
- package/dist/retrieval/UniverseNavigator.d.ts +43 -0
- package/dist/retrieval/UniverseNavigator.js +75 -0
- package/dist/retrieval/UniverseTraversalExecutor.d.ts +21 -0
- package/dist/retrieval/UniverseTraversalExecutor.js +77 -0
- package/dist/routing/AnswerEvidenceTrace.d.ts +18 -0
- package/dist/routing/AnswerEvidenceTrace.js +1 -0
- package/dist/routing/BrainToolDispatcher.d.ts +37 -0
- package/dist/routing/BrainToolDispatcher.js +163 -0
- package/dist/routing/ConfidenceGate.d.ts +26 -0
- package/dist/routing/ConfidenceGate.js +40 -0
- package/dist/routing/ConfirmationPhraseMatcher.d.ts +9 -0
- package/dist/routing/ConfirmationPhraseMatcher.js +43 -0
- package/dist/routing/DirectReplyFormatter.d.ts +5 -0
- package/dist/routing/DirectReplyFormatter.js +55 -0
- package/dist/routing/EvidenceBudgetManager.d.ts +30 -0
- package/dist/routing/EvidenceBudgetManager.js +55 -0
- package/dist/routing/ExecutionLoop.d.ts +79 -0
- package/dist/routing/ExecutionLoop.js +234 -0
- package/dist/routing/IntentClassifier.d.ts +15 -0
- package/dist/routing/IntentClassifier.js +97 -0
- package/dist/routing/IntentPatternMatcher.d.ts +12 -0
- package/dist/routing/IntentPatternMatcher.js +206 -0
- package/dist/routing/IterativeLLMClarifier.d.ts +80 -0
- package/dist/routing/IterativeLLMClarifier.js +408 -0
- package/dist/routing/LLMToolSchema.d.ts +60 -0
- package/dist/routing/LLMToolSchema.js +143 -0
- package/dist/routing/MessageRouter.d.ts +20 -0
- package/dist/routing/MessageRouter.js +58 -0
- package/dist/routing/SessionContextSelector.d.ts +12 -0
- package/dist/routing/SessionContextSelector.js +86 -0
- package/dist/routing/SystemIntentClassifier.d.ts +15 -0
- package/dist/routing/SystemIntentClassifier.js +50 -0
- package/dist/routing/TaskPlan.d.ts +31 -0
- package/dist/routing/TaskPlan.js +1 -0
- package/dist/routing/TaskRouter.d.ts +13 -0
- package/dist/routing/TaskRouter.js +111 -0
- package/dist/routing/ToolCallParser.d.ts +16 -0
- package/dist/routing/ToolCallParser.js +123 -0
- package/dist/routing/ToolEvidenceNormalizer.d.ts +13 -0
- package/dist/routing/ToolEvidenceNormalizer.js +96 -0
- package/dist/routing/ToolEvidencePack.d.ts +36 -0
- package/dist/routing/ToolEvidencePack.js +84 -0
- package/dist/routing/ToolResultSanitizer.d.ts +19 -0
- package/dist/routing/ToolResultSanitizer.js +58 -0
- package/dist/routing/ToolUsePolicy.d.ts +78 -0
- package/dist/routing/ToolUsePolicy.js +163 -0
- package/dist/routing/index.d.ts +32 -0
- package/dist/routing/index.js +19 -0
- package/dist/routing/templates/ability_template.d.ts +2 -0
- package/dist/routing/templates/ability_template.js +34 -0
- package/dist/routing/templates/approvals_template.d.ts +2 -0
- package/dist/routing/templates/approvals_template.js +43 -0
- package/dist/routing/templates/context_template.d.ts +2 -0
- package/dist/routing/templates/context_template.js +25 -0
- package/dist/routing/templates/contradictions_template.d.ts +2 -0
- package/dist/routing/templates/contradictions_template.js +36 -0
- package/dist/routing/templates/importance_template.d.ts +2 -0
- package/dist/routing/templates/importance_template.js +23 -0
- package/dist/routing/templates/memory_template.d.ts +2 -0
- package/dist/routing/templates/memory_template.js +37 -0
- package/dist/routing/templates/self_manifest_template.d.ts +5 -0
- package/dist/routing/templates/self_manifest_template.js +64 -0
- package/dist/routing/templates/tasks_template.d.ts +2 -0
- package/dist/routing/templates/tasks_template.js +41 -0
- package/dist/routing/templates/trace_template.d.ts +2 -0
- package/dist/routing/templates/trace_template.js +37 -0
- package/dist/routing/tools/EntityExpandTool.d.ts +25 -0
- package/dist/routing/tools/EntityExpandTool.js +59 -0
- package/dist/routing/tools/NeuronContextTool.d.ts +32 -0
- package/dist/routing/tools/NeuronContextTool.js +66 -0
- package/dist/routing/tools/SecondaryRecallTool.d.ts +27 -0
- package/dist/routing/tools/SecondaryRecallTool.js +30 -0
- package/dist/routing/tools/SkillDiscoveryTool.d.ts +13 -0
- package/dist/routing/tools/SkillDiscoveryTool.js +11 -0
- package/dist/snapshot/SnapshotExporter.d.ts +13 -0
- package/dist/snapshot/SnapshotExporter.js +70 -0
- package/dist/snapshot/SnapshotHeader.d.ts +15 -0
- package/dist/snapshot/SnapshotHeader.js +1 -0
- package/dist/snapshot/SnapshotImporter.d.ts +20 -0
- package/dist/snapshot/SnapshotImporter.js +40 -0
- package/dist/snapshot/errors.d.ts +18 -0
- package/dist/snapshot/errors.js +34 -0
- package/dist/snapshot/index.d.ts +5 -0
- package/dist/snapshot/index.js +3 -0
- package/dist/storage/StorageCompactor.d.ts +30 -0
- package/dist/storage/StorageCompactor.js +95 -0
- package/dist/store/ActivationStore.d.ts +45 -0
- package/dist/store/ActivationStore.js +135 -0
- package/dist/store/BackgroundJobStore.d.ts +49 -0
- package/dist/store/BackgroundJobStore.js +156 -0
- package/dist/store/CandidateReviewStore.d.ts +33 -0
- package/dist/store/CandidateReviewStore.js +67 -0
- package/dist/store/CognitiveGraphStore.d.ts +42 -0
- package/dist/store/CognitiveGraphStore.js +193 -0
- package/dist/store/CompilerConfidenceStore.d.ts +20 -0
- package/dist/store/CompilerConfidenceStore.js +76 -0
- package/dist/store/DeepWriteCandidateStore.d.ts +94 -0
- package/dist/store/DeepWriteCandidateStore.js +290 -0
- package/dist/store/DeterministicEmbedder.d.ts +10 -0
- package/dist/store/DeterministicEmbedder.js +24 -0
- package/dist/store/DreamLedgerStore.d.ts +22 -0
- package/dist/store/DreamLedgerStore.js +84 -0
- package/dist/store/Embedder.d.ts +14 -0
- package/dist/store/Embedder.js +52 -0
- package/dist/store/EmbedderFactory.d.ts +12 -0
- package/dist/store/EmbedderFactory.js +51 -0
- package/dist/store/EntityStore.d.ts +195 -0
- package/dist/store/EntityStore.js +941 -0
- package/dist/store/EventStore.d.ts +118 -0
- package/dist/store/EventStore.js +699 -0
- package/dist/store/FactStore.d.ts +76 -0
- package/dist/store/FactStore.js +356 -0
- package/dist/store/HnswlibVectorStore.d.ts +2 -0
- package/dist/store/HnswlibVectorStore.js +1 -0
- package/dist/store/IVectorStore.d.ts +32 -0
- package/dist/store/IVectorStore.js +1 -0
- package/dist/store/InteractionUnitStore.d.ts +52 -0
- package/dist/store/InteractionUnitStore.js +167 -0
- package/dist/store/MemoryAtlasStore.d.ts +60 -0
- package/dist/store/MemoryAtlasStore.js +500 -0
- package/dist/store/MemoryBindingStore.d.ts +77 -0
- package/dist/store/MemoryBindingStore.js +608 -0
- package/dist/store/MemoryGovernanceStore.d.ts +23 -0
- package/dist/store/MemoryGovernanceStore.js +103 -0
- package/dist/store/MemoryInspectionStore.d.ts +61 -0
- package/dist/store/MemoryInspectionStore.js +215 -0
- package/dist/store/PlanRuntimeStore.d.ts +83 -0
- package/dist/store/PlanRuntimeStore.js +257 -0
- package/dist/store/PolicyExecutionProjector.d.ts +17 -0
- package/dist/store/PolicyExecutionProjector.js +115 -0
- package/dist/store/PolicyExecutionStore.d.ts +62 -0
- package/dist/store/PolicyExecutionStore.js +290 -0
- package/dist/store/PolicyProjectionStore.d.ts +18 -0
- package/dist/store/PolicyProjectionStore.js +61 -0
- package/dist/store/ProjectionObservabilityStore.d.ts +38 -0
- package/dist/store/ProjectionObservabilityStore.js +310 -0
- package/dist/store/ReasoningChainStore.d.ts +13 -0
- package/dist/store/ReasoningChainStore.js +74 -0
- package/dist/store/RuntimeProjectionStore.d.ts +18 -0
- package/dist/store/RuntimeProjectionStore.js +61 -0
- package/dist/store/RuntimeProjector.d.ts +17 -0
- package/dist/store/RuntimeProjector.js +119 -0
- package/dist/store/SqliteVecStore.d.ts +25 -0
- package/dist/store/SqliteVecStore.js +126 -0
- package/dist/store/SummaryStore.d.ts +56 -0
- package/dist/store/SummaryStore.js +225 -0
- package/dist/store/TemporalAdjacencyStore.d.ts +49 -0
- package/dist/store/TemporalAdjacencyStore.js +300 -0
- package/dist/store/TopologyStore.d.ts +89 -0
- package/dist/store/TopologyStore.js +657 -0
- package/dist/store/VectorProjector.d.ts +22 -0
- package/dist/store/VectorProjector.js +125 -0
- package/dist/store/VectorStore.d.ts +35 -0
- package/dist/store/VectorStore.js +201 -0
- package/dist/strategy/StrategyCapsule.d.ts +44 -0
- package/dist/strategy/StrategyCapsule.js +1 -0
- package/dist/strategy/StrategyConditionedCandidateBuilder.d.ts +9 -0
- package/dist/strategy/StrategyConditionedCandidateBuilder.js +11 -0
- package/dist/strategy/StrategyContextFormatter.d.ts +3 -0
- package/dist/strategy/StrategyContextFormatter.js +25 -0
- package/dist/strategy/StrategyCortex.d.ts +28 -0
- package/dist/strategy/StrategyCortex.js +78 -0
- package/dist/strategy/StrategyTemplateRegistry.d.ts +9 -0
- package/dist/strategy/StrategyTemplateRegistry.js +78 -0
- package/dist/strategy/index.d.ts +6 -0
- package/dist/strategy/index.js +5 -0
- package/dist/temporal/TemporalMemoryService.d.ts +62 -0
- package/dist/temporal/TemporalMemoryService.js +128 -0
- package/dist/temporal/index.d.ts +2 -0
- package/dist/temporal/index.js +1 -0
- package/dist/topic/TopicAliasRegistry.d.ts +21 -0
- package/dist/topic/TopicAliasRegistry.js +67 -0
- package/dist/topic/TopicGovernance.d.ts +21 -0
- package/dist/topic/TopicGovernance.js +173 -0
- package/dist/topic/TopicPathRegistry.d.ts +36 -0
- package/dist/topic/TopicPathRegistry.js +105 -0
- package/dist/topic/TopicRelationGraph.d.ts +23 -0
- package/dist/topic/TopicRelationGraph.js +55 -0
- package/dist/topic/TopicTypes.d.ts +73 -0
- package/dist/topic/TopicTypes.js +1 -0
- package/dist/topic/index.d.ts +6 -0
- package/dist/topic/index.js +5 -0
- package/dist/types/AsyncEnrichment.d.ts +62 -0
- package/dist/types/AsyncEnrichment.js +7 -0
- package/dist/types/BrainRecallResult.d.ts +66 -0
- package/dist/types/BrainRecallResult.js +1 -0
- package/dist/types/ExtensionPoints.d.ts +116 -0
- package/dist/types/ExtensionPoints.js +1 -0
- package/dist/types/Migration.d.ts +22 -0
- package/dist/types/Migration.js +1 -0
- package/dist/types/QueryTimePendingEntityResolution.d.ts +11 -0
- package/dist/types/QueryTimePendingEntityResolution.js +23 -0
- package/dist/types/index.d.ts +855 -0
- package/dist/types/index.js +24 -0
- package/dist/types/query-ir.d.ts +71 -0
- package/dist/types/query-ir.js +4 -0
- package/dist/types/reasoning.d.ts +16 -0
- package/dist/types/reasoning.js +4 -0
- package/dist/utils/AAAKGenerator.d.ts +57 -0
- package/dist/utils/AAAKGenerator.js +212 -0
- package/dist/utils/Config.d.ts +78 -0
- package/dist/utils/Config.js +91 -0
- package/dist/utils/ConversationMarkdownNormalization.d.ts +88 -0
- package/dist/utils/ConversationMarkdownNormalization.js +567 -0
- package/dist/utils/Logger.d.ts +22 -0
- package/dist/utils/Logger.js +77 -0
- package/dist/utils/hash.d.ts +33 -0
- package/dist/utils/hash.js +53 -0
- package/dist/utils/text.d.ts +2 -0
- package/dist/utils/text.js +19 -0
- package/dist/utils/vector.d.ts +26 -0
- package/dist/utils/vector.js +38 -0
- package/examples/hermes-backend/AGENTS.md +218 -0
- package/examples/hermes-backend/README.md +153 -0
- package/examples/hermes-backend/SKILL.md +365 -0
- package/examples/hermes-backend/references/operations.md +202 -0
- package/examples/openclaw-backend/AGENTS.md +195 -0
- package/examples/openclaw-backend/README.md +228 -0
- package/examples/openclaw-backend/SKILL.md +464 -0
- package/examples/openclaw-backend/references/operations.md +269 -0
- package/install.sh +84 -0
- package/package.json +90 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare class HashUtils {
|
|
2
|
+
/**
|
|
3
|
+
* 计算字符串的 SHA-256 哈希
|
|
4
|
+
*/
|
|
5
|
+
static sha256(content: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* 计算神经元的 self_hash
|
|
8
|
+
* 基于内容、时间坐标和空间坐标生成唯一哈希
|
|
9
|
+
*/
|
|
10
|
+
static computeSelfHash(content: string, timestamp: number, spatialCoords: [number, number, number]): string;
|
|
11
|
+
/**
|
|
12
|
+
* 计算 prev_hash(区块链风格链接)
|
|
13
|
+
* 新神经元的 prev_hash 指向前一个神经元的 self_hash
|
|
14
|
+
*/
|
|
15
|
+
static computePrevHash(prevNeuronSelfHash: string | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* 验证神经元的哈希完整性
|
|
18
|
+
*/
|
|
19
|
+
static verifyNeuronHash(neuron: {
|
|
20
|
+
content: string;
|
|
21
|
+
prev_hash: string;
|
|
22
|
+
self_hash: string;
|
|
23
|
+
coordinates: {
|
|
24
|
+
T: number;
|
|
25
|
+
S: [number, number, number];
|
|
26
|
+
};
|
|
27
|
+
}): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 计算记忆锚点的摘要哈希
|
|
30
|
+
*/
|
|
31
|
+
static computeAnchorSummary(neuronIds: string[], projectId?: string): string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// 哈希工具 - 区块链风格链接
|
|
3
|
+
// ============================================
|
|
4
|
+
import { createHash } from 'crypto';
|
|
5
|
+
export class HashUtils {
|
|
6
|
+
/**
|
|
7
|
+
* 计算字符串的 SHA-256 哈希
|
|
8
|
+
*/
|
|
9
|
+
static sha256(content) {
|
|
10
|
+
return createHash('sha256').update(content).digest('hex');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 计算神经元的 self_hash
|
|
14
|
+
* 基于内容、时间坐标和空间坐标生成唯一哈希
|
|
15
|
+
*/
|
|
16
|
+
static computeSelfHash(content, timestamp, spatialCoords) {
|
|
17
|
+
const payload = JSON.stringify({
|
|
18
|
+
content,
|
|
19
|
+
T: timestamp,
|
|
20
|
+
S: spatialCoords
|
|
21
|
+
});
|
|
22
|
+
return this.sha256(payload);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 计算 prev_hash(区块链风格链接)
|
|
26
|
+
* 新神经元的 prev_hash 指向前一个神经元的 self_hash
|
|
27
|
+
*/
|
|
28
|
+
static computePrevHash(prevNeuronSelfHash) {
|
|
29
|
+
if (!prevNeuronSelfHash) {
|
|
30
|
+
// 创世区块:使用固定前缀
|
|
31
|
+
return this.sha256('GENESIS');
|
|
32
|
+
}
|
|
33
|
+
return prevNeuronSelfHash;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 验证神经元的哈希完整性
|
|
37
|
+
*/
|
|
38
|
+
static verifyNeuronHash(neuron) {
|
|
39
|
+
const computedSelfHash = this.computeSelfHash(neuron.content, neuron.coordinates.T, neuron.coordinates.S);
|
|
40
|
+
return computedSelfHash === neuron.self_hash;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 计算记忆锚点的摘要哈希
|
|
44
|
+
*/
|
|
45
|
+
static computeAnchorSummary(neuronIds, projectId) {
|
|
46
|
+
const payload = JSON.stringify({
|
|
47
|
+
neuronIds: neuronIds.sort(),
|
|
48
|
+
projectId,
|
|
49
|
+
timestamp: Date.now()
|
|
50
|
+
});
|
|
51
|
+
return this.sha256(payload);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function lexicalSimilarity(a, b) {
|
|
2
|
+
const aTokens = tokenSet(a);
|
|
3
|
+
const bTokens = tokenSet(b);
|
|
4
|
+
if (aTokens.size === 0 || bTokens.size === 0)
|
|
5
|
+
return 0;
|
|
6
|
+
let overlap = 0;
|
|
7
|
+
for (const token of aTokens) {
|
|
8
|
+
if (bTokens.has(token))
|
|
9
|
+
overlap++;
|
|
10
|
+
}
|
|
11
|
+
return overlap / Math.max(aTokens.size, bTokens.size);
|
|
12
|
+
}
|
|
13
|
+
function tokenSet(text) {
|
|
14
|
+
return new Set(text
|
|
15
|
+
.toLowerCase()
|
|
16
|
+
.split(/[\s,,。!?、::/._-]+/)
|
|
17
|
+
.map((token) => token.trim())
|
|
18
|
+
.filter(Boolean));
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 序列化向量:Float32Array → Buffer
|
|
3
|
+
* @param vector 浮点数组(384 维)
|
|
4
|
+
* @returns Buffer(1536 字节,384 * 4)
|
|
5
|
+
*/
|
|
6
|
+
export declare function serializeVector(vector: number[]): Buffer;
|
|
7
|
+
/**
|
|
8
|
+
* 反序列化向量:Buffer → Float32Array
|
|
9
|
+
* @param blob SQLite BLOB 数据
|
|
10
|
+
* @returns 浮点数组
|
|
11
|
+
*/
|
|
12
|
+
export declare function deserializeVector(blob: Buffer): number[];
|
|
13
|
+
/**
|
|
14
|
+
* 计算向量大小(字节)
|
|
15
|
+
* @param dimension 向量维度
|
|
16
|
+
* @returns 字节数
|
|
17
|
+
*/
|
|
18
|
+
export declare function getVectorByteSize(dimension: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* 验证向量维度
|
|
21
|
+
* @param vector 向量
|
|
22
|
+
* @param expectedDimension 期望维度
|
|
23
|
+
* @returns 是否匹配
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateVectorDimension(vector: number[], expectedDimension: number): boolean;
|
|
26
|
+
//# sourceMappingURL=vector.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// 向量序列化工具 - Float32Array ↔ Buffer
|
|
3
|
+
// ============================================
|
|
4
|
+
/**
|
|
5
|
+
* 序列化向量:Float32Array → Buffer
|
|
6
|
+
* @param vector 浮点数组(384 维)
|
|
7
|
+
* @returns Buffer(1536 字节,384 * 4)
|
|
8
|
+
*/
|
|
9
|
+
export function serializeVector(vector) {
|
|
10
|
+
const float32Array = new Float32Array(vector);
|
|
11
|
+
return Buffer.from(float32Array.buffer);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 反序列化向量:Buffer → Float32Array
|
|
15
|
+
* @param blob SQLite BLOB 数据
|
|
16
|
+
* @returns 浮点数组
|
|
17
|
+
*/
|
|
18
|
+
export function deserializeVector(blob) {
|
|
19
|
+
const float32Array = new Float32Array(blob.buffer, blob.byteOffset, blob.byteLength / 4);
|
|
20
|
+
return Array.from(float32Array);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 计算向量大小(字节)
|
|
24
|
+
* @param dimension 向量维度
|
|
25
|
+
* @returns 字节数
|
|
26
|
+
*/
|
|
27
|
+
export function getVectorByteSize(dimension) {
|
|
28
|
+
return dimension * 4; // Float32 = 4 bytes
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 验证向量维度
|
|
32
|
+
* @param vector 向量
|
|
33
|
+
* @param expectedDimension 期望维度
|
|
34
|
+
* @returns 是否匹配
|
|
35
|
+
*/
|
|
36
|
+
export function validateVectorDimension(vector, expectedDimension) {
|
|
37
|
+
return vector.length === expectedDimension;
|
|
38
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Hermes Agent Memory Backend Runbook
|
|
2
|
+
|
|
3
|
+
You are configuring Hermes to use `cogmem` as its durable memory backend.
|
|
4
|
+
|
|
5
|
+
For a portable one-file skill, read `SKILL.md` or install it into the workspace with:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cogmem connect hermes --workspace .
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This writes `~/.hermes/skills/cogmem-memory/SKILL.md`, which Hermes discovers as a local skill.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
Run from the Hermes workspace root:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
COGMEM_SKIP_INIT=1 curl -fsSL https://raw.githubusercontent.com/liuqin164/cogmem/main/install.sh | bash
|
|
19
|
+
cogmem init --yes --agent hermes
|
|
20
|
+
cogmem doctor --fix --agent hermes --workspace .
|
|
21
|
+
cogmem connect hermes --workspace . --auto
|
|
22
|
+
cogmem connect hermes --workspace .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The default install creates:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
~/.cogmem/config.toml
|
|
29
|
+
~/.cogmem/memory.db
|
|
30
|
+
~/.cogmem/snapshots/
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use `~/.cogmem/config.toml` or a project `.cogmem/config.toml` as the stable configuration source. Do not create `.cogmem.env` files or pass `--env-path` for normal installs. Environment variables are only for explicit process-level overrides documented by the CLI, not for hidden workspace configuration.
|
|
34
|
+
|
|
35
|
+
Entity aliases are governed memory. Do not merge people from pronouns, family labels, job titles, assistant claims, or tool output alone. Require explicit user evidence; uncertain identity matches remain pending and applied merges must remain reversible.
|
|
36
|
+
|
|
37
|
+
Belief Graph nodes are current cognition, not unsourced summaries. User-owned preferences, goals, boundaries, decisions, and facts require explicit user events. Assistant/tool-only evidence is a project observation; contradictions stay pending unless explicit user correction supersedes the prior belief.
|
|
38
|
+
|
|
39
|
+
Use Temporal Memory for historical-state questions. Keep the active belief separate from superseded versions and cite the correction reason or source event when explaining a change.
|
|
40
|
+
|
|
41
|
+
Use Context Cortex activation receipts to explain injection decisions. A greeting gets no memory, a short continuation gets only session continuity layers, and exact-quote requests prioritize raw source. Never bypass project, session-echo, supersession, ownership, sensitive-data, or budget suppression.
|
|
42
|
+
|
|
43
|
+
Use MCP `cogmem_strategy_plan` when the agent needs to inspect the selected memory policy before recall. The capsule has no instruction authority and cannot authorize tools or become memory evidence. Exact-source policies require raw source; if the source remains unavailable, report that limitation rather than quoting a summary.
|
|
44
|
+
|
|
45
|
+
Prospective Memory is not executable instruction. Only a user-confirmed candidate may appear as due, and even then the agent must obtain normal host authorization before acting. Use `cogmem prospective` for state transitions and `cogmem brain-eval` for release validation.
|
|
46
|
+
|
|
47
|
+
Use `cogmem init --yes --agent hermes --scope project` only when this workspace needs its own `.cogmem/` directory.
|
|
48
|
+
|
|
49
|
+
To embed imported memories with a local quantized model, run Ollama locally and configure the kernel before importing:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ollama pull qwen3-embedding:0.6b
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```toml
|
|
56
|
+
[core]
|
|
57
|
+
vector_dimension = 1024
|
|
58
|
+
|
|
59
|
+
[embedding]
|
|
60
|
+
provider = "openai_compatible"
|
|
61
|
+
base_url = "http://localhost:11434/v1"
|
|
62
|
+
model = "qwen3-embedding:0.6b"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use the matching dimension for larger local models: `qwen3-embedding:4b` uses `2560`; `qwen3-embedding:8b` uses `4096`. Run `cogmem doctor` after editing. Imported records are embedded through the configured kernel embedder during `cogmem import-hermes`.
|
|
66
|
+
|
|
67
|
+
## Migrate Existing Hermes Memory
|
|
68
|
+
|
|
69
|
+
For package upgrades, run `cogmem update --yes`; it installs `cogmem@latest` from npm, runs the newly installed backed-up migration with the resolved config, and then reports that the Hermes MCP server or agent host must be reloaded. Use `cogmem update --dry-run --json` or `cogmem migrate --dry-run --json` to preview pending work. Never delete or rewrite Raw Ledger events during migration.
|
|
70
|
+
|
|
71
|
+
Default Hermes memory contract:
|
|
72
|
+
|
|
73
|
+
- `state.db` may contain the real chronological conversation history in SQLite `messages`.
|
|
74
|
+
- `profile.md` contains durable profile/persona memory.
|
|
75
|
+
- `sessions/**/*.md` contains conversation/session memory.
|
|
76
|
+
|
|
77
|
+
Preview first:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cogmem import-hermes --workspace . --project hermes --dry-run
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If `state.db` exists, default import scans it automatically. If the database is elsewhere:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cogmem import-hermes --workspace . --project hermes --state-db ./state.db --dry-run
|
|
87
|
+
cogmem import-hermes --workspace . --project hermes --state-db ./state.db
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The SQLite importer prefers message-level `occurredAt`, `timestamp`, or `createdAt`; numeric `timestamp` values below millisecond range are epoch seconds. It can read WAL-mode `state.db` through SQLite immutable mode. `InsertTime` is only a fallback. Do not use `InsertTime` as proof of the original conversation date when better message timestamps exist.
|
|
91
|
+
|
|
92
|
+
Then migrate:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cogmem import-hermes --workspace . --project hermes
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use `--json` when another agent needs structured output:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cogmem import-hermes --workspace . --project hermes --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If Hermes stores memory somewhere else, pass explicit paths:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
cogmem import-hermes --workspace . --project hermes --profile ./memory/profile.md --sessions ./memory/sessions
|
|
108
|
+
cogmem import-hermes --workspace . --project hermes --session ./one.md
|
|
109
|
+
cogmem import-hermes --workspace . --project hermes --session ./one.md --session ./two.md
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For Hermes JSONL session exports where each line has a `messages[]` array:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
cogmem normalize-transcript --input ./hermes-sessions.jsonl --output ./hermes.normalized.md --family jsonl --dry-run --json
|
|
116
|
+
cogmem normalize-transcript --input ./hermes-sessions.jsonl --output ./hermes.normalized.md --family jsonl
|
|
117
|
+
cogmem import-hermes --workspace . --project hermes --session ./hermes.normalized.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
After import, inspect the batch-sealed episodes, run one conditional curation tick, then invoke CPU governance separately:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cogmem episode status --project hermes --json
|
|
124
|
+
cogmem dream tick --project hermes --mode auto --json
|
|
125
|
+
cogmem memory govern --project hermes --json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Active Memory Search
|
|
129
|
+
|
|
130
|
+
If the current prompt does not include enough Cogmem memory context, query Cogmem directly before searching legacy files:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
cogmem memory recall --query "<user question>" --project hermes --agent hermes --json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For inventory or product questions, use recall first and raw search as a forensic fallback:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cogmem memory recall --query "我们记录过哪些库存" --project hermes --agent hermes --json
|
|
140
|
+
cogmem memory search --query "エルビ 库存" --project hermes --json
|
|
141
|
+
cogmem memory show --event <event-id> --before 2 --after 2 --json
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`vectors: 0` does not mean Cogmem has no memory. It means the dense vector index has no hot vectors yet. `memory recall` still falls back to governed raw ledger search and returns `sourceContext` locators. Broad inventory questions are expanded into structured cues such as `库存管理`, `在库`, `产品コード`, and `数量`; if compiled-memory candidates miss those cues, raw ledger evidence is preferred.
|
|
145
|
+
|
|
146
|
+
`sourceContext` and `memory show --json` now share the same replay contract: each event has a `label`, optional `charRange` / `sourceRange`, and `sourceContext.window` / `window` metadata with requested counts, actual counts, `excludesAnchor`, `ordering`, `roleFilter`, and `overlapHandling`. Use those fields before quoting exact wording or explaining what happened before/after a recalled point.
|
|
147
|
+
|
|
148
|
+
Check status with:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
cogmem memory status --project hermes --json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
For automation, read the top-level fields `rawEvents`, `vectors`, `dreamedRawCount`, `undreamedRawCount`, and `dreamCoverageRate`.
|
|
155
|
+
|
|
156
|
+
## Runtime Wiring
|
|
157
|
+
|
|
158
|
+
Use `KernelAgentMemoryBackend` for turn storage and recall:
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
import {
|
|
162
|
+
KernelAgentMemoryBackend,
|
|
163
|
+
createMemoryKernelFromConfig,
|
|
164
|
+
} from 'cogmem';
|
|
165
|
+
|
|
166
|
+
const kernel = createMemoryKernelFromConfig();
|
|
167
|
+
const memory = new KernelAgentMemoryBackend(kernel);
|
|
168
|
+
|
|
169
|
+
await memory.rememberTurn({
|
|
170
|
+
agentId: 'hermes',
|
|
171
|
+
projectId: 'hermes',
|
|
172
|
+
sessionId: 'current',
|
|
173
|
+
userText,
|
|
174
|
+
assistantText,
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const recall = memory.recall({
|
|
178
|
+
agentId: 'hermes',
|
|
179
|
+
projectId: 'hermes',
|
|
180
|
+
query: userText,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const preparedContext = {
|
|
184
|
+
mode: recall.recallMode,
|
|
185
|
+
narrative: recall.narrative,
|
|
186
|
+
pulseTrace: recall.pulseTrace,
|
|
187
|
+
temporalLabels: recall.temporalTraversal?.labels,
|
|
188
|
+
memories: recall.items,
|
|
189
|
+
};
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Recall behavior:
|
|
193
|
+
|
|
194
|
+
- `recall.recallMode === 'universe_navigation'` means core already ran pulse activation, temporal branch search, graph traversal, and narrative assembly.
|
|
195
|
+
- Use `recall.narrative` as the compact context summary for the next model prompt.
|
|
196
|
+
- Use `recall.items` as cited memory evidence.
|
|
197
|
+
- Use `recall.temporalTraversal?.labels` when the user refers to a day, session, or adjacent work period.
|
|
198
|
+
- Do not run a separate vector search before calling `memory.recall()`. The backend is the first-class memory retrieval path.
|
|
199
|
+
|
|
200
|
+
The migration command is idempotent. Re-running it skips records already imported into the same memory database.
|
|
201
|
+
|
|
202
|
+
Hermes integration is currently a skill plus MCP bridge. It does not replace a native Hermes memory provider and it does not patch Hermes runtime internals. `cogmem connect hermes --workspace . --auto` writes or updates the `mcp_servers.cogmem` entry in the Hermes config. Restart or reload Hermes after patching MCP config.
|
|
203
|
+
|
|
204
|
+
For active memory search through MCP, call `cogmem_recall` with `projectId: "hermes"` and `query`. `agentId` is optional for project-scoped Hermes calls; the MCP bridge infers it from `projectId`. The tool returns the same `items` shape as `cogmem memory recall`, including `raw_ledger` fallback, `sourceContext` locators, and `decisionTrace`. Inspect its selected lane, reason, and candidate counts before claiming memory is absent. For equal raw matches, prefer the original user anchor and inspect `sourceContext.after` rather than relying on a later assistant retelling.
|
|
205
|
+
|
|
206
|
+
Hermes has no automatic observation path in this integration. Use `cogmem_episode_append` for one message or bounded `cogmem_episode_import` for a session batch after meaningful conversation, and call `cogmem_recall` before memory-dependent answers. Supply stable external message IDs so retries are idempotent; never split/retry an auto-ID batch after `auto_identity_not_safe_across_split_batches`. These tools write Raw Ledger and episode control metadata only; they do not run Dream or create durable beliefs. Inspect `recommendedActions` and per-message checkpoints. On `no_recent_episode_ingestion_detected`, ingest recent messages; on `semantic_memory_may_lag`, inspect open/soft-sealed episodes and Dream failures before claiming freshness.
|
|
207
|
+
|
|
208
|
+
Use `cogmem_topic_operate` with actor `user_explicit` only for explicit user naming/organization instructions. Model suggestions use `model_candidate` and remain reviewable; alias collisions fail closed. Use `cogmem_episode_repair` for split/merge/move/reclassify/requeue work so receipts, stale candidates, cross-references, Dream jobs, and audit records stay synchronized. Do not hand-edit the database.
|
|
209
|
+
|
|
210
|
+
Use `cogmem memory map --project hermes --json` or MCP `cogmem_memory_map` to inspect Memory Binding and Graph Recall counters. Bindings attach high-value user raw events to stable topic/entity paths, fuse same-claim evidence into claim-key clusters, and create graph anchors for source drill-down only; they are not verified facts, user preferences, or instructions. Correction bindings expose review flags and correction edges. If `cogmem memory tick --project hermes --json` suggests `bind_raw_events`, run `cogmem memory bind --project hermes --json`. Re-run `cogmem connect hermes --workspace . --auto` after upgrades to patch existing MCP allow-lists with new Cogmem tools.
|
|
211
|
+
|
|
212
|
+
Dream correction records require explicit user clarification; assistant self-correction and questions containing `是不是` are not user-owned contradictions. Invalid provider output is a rejected diagnostic. Maintenance ticks supersede `needs_confirmation` entries older than the default 30-day TTL and retain their evidence rows.
|
|
213
|
+
|
|
214
|
+
## Memory Atlas navigation
|
|
215
|
+
|
|
216
|
+
For broad inventory or historical questions call `cogmem_graph_explore`. Use `cogmem_graph_search` and `cogmem_graph_node` for known concepts, `cogmem_graph_neighbors`/`cogmem_graph_path` for relations, and `cogmem_graph_timeline` for ordered reconstruction. Use `cogmem_recall` for a direct fact and follow event IDs to `cogmem memory show` for exact wording.
|
|
217
|
+
|
|
218
|
+
Combine the filters present in the user's message, including project, time, topic, entity/target, memory kind, and ordinary cues. Do not force an entity + time + action tuple. A cold result is newly visible, not newly verified or promoted.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Hermes Backend
|
|
2
|
+
|
|
3
|
+
Use cogmem as a Hermes-compatible durable memory backend through MCP and imports.
|
|
4
|
+
|
|
5
|
+
Entity resolution is evidence-backed and reversible. Person aliases require explicit user evidence; Hermes must not auto-merge pronouns, relationship labels, role names, assistant claims, or tool observations.
|
|
6
|
+
|
|
7
|
+
Belief Graph writes keep ownership and evidence roles. Hermes may record assistant/tool project observations, but only explicit user events can establish user-owned preferences, goals, boundaries, decisions, or facts.
|
|
8
|
+
|
|
9
|
+
## Default Contract
|
|
10
|
+
|
|
11
|
+
- `profile.md` contains durable profile/persona memory.
|
|
12
|
+
- `sessions/**/*.md` contains conversation/session memory.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
COGMEM_SKIP_INIT=1 curl -fsSL https://raw.githubusercontent.com/liuqin164/cogmem/main/install.sh | bash
|
|
18
|
+
cogmem init --yes --agent hermes
|
|
19
|
+
cogmem doctor --fix --agent hermes --workspace .
|
|
20
|
+
cogmem connect hermes --workspace . --auto
|
|
21
|
+
cogmem connect hermes --workspace .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Hermes integration is currently a skill plus MCP bridge. It does not replace a native Hermes memory provider and it does not patch Hermes runtime internals.
|
|
25
|
+
|
|
26
|
+
## Local Quantized Embeddings
|
|
27
|
+
|
|
28
|
+
Imports use the configured kernel embedder. To import existing Hermes memory through a local quantized model, configure the kernel before running the import command:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
ollama pull qwen3-embedding:0.6b
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```toml
|
|
35
|
+
[core]
|
|
36
|
+
db_path = "memory.db"
|
|
37
|
+
vector_backend = "sqlite-vec"
|
|
38
|
+
vector_dimension = 1024
|
|
39
|
+
|
|
40
|
+
[embedding]
|
|
41
|
+
provider = "openai_compatible"
|
|
42
|
+
base_url = "http://localhost:11434/v1"
|
|
43
|
+
model = "qwen3-embedding:0.6b"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use the matching vector dimension for the selected model. `qwen3-embedding:4b` uses 2560 dimensions and `qwen3-embedding:8b` uses 4096 dimensions.
|
|
47
|
+
|
|
48
|
+
## Migrate
|
|
49
|
+
|
|
50
|
+
Upgrade and migrate the Cogmem database itself before importing host memory:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
cogmem update --yes
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`cogmem update --yes` installs `cogmem@latest` from npm, runs the newly installed backed-up migration, and then tells the operator to reload the Hermes MCP server or restart the agent host. Use `cogmem update --dry-run --json` to see the install and migration commands first.
|
|
57
|
+
|
|
58
|
+
Preview:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cogmem import-hermes --workspace . --project hermes --dry-run
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Import:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cogmem import-hermes --workspace . --project hermes
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If Hermes stores memory somewhere else:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
cogmem import-hermes --workspace . --project hermes --profile ./memory/profile.md --sessions ./memory/sessions
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Single session files and batches can be imported explicitly:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cogmem import-hermes --workspace . --project hermes --session ./one.md
|
|
80
|
+
cogmem import-hermes --workspace . --project hermes --session ./one.md --session ./two.md
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The import command is idempotent. Re-running it against the same database skips records already processed by the cursor store. Imported raw records enter the same Episode Assembler used by live turns and are sealed at the explicit import batch boundary.
|
|
84
|
+
Imported records are embedded through the configured kernel embedder during import.
|
|
85
|
+
|
|
86
|
+
MCP recall JSON includes `decisionTrace`. Check its selected lane, reason, and candidate counts before concluding that a memory is absent, and use `sourceContext.locator.command` for exact wording. Raw text fallback searches the fully scoped ledger and prefers original user anchors over later assistant retellings when cue scores tie.
|
|
87
|
+
|
|
88
|
+
Dream stores explicit user clarification as organizational correction evidence rather than an automatic contradiction. Assistant self-correction and negative-form questions do not create user-owned corrections. Resolve `needs_confirmation` with `cogmem_candidate_review` or `cogmem memory review`; maintenance only supersedes entries left stale past the default 30-day TTL.
|
|
89
|
+
|
|
90
|
+
After upgrades, reload MCP. Rerun `cogmem connect hermes --workspace . --auto --force` when MCP wiring, allow-listed tools, or the installed skill bundle changed.
|
|
91
|
+
|
|
92
|
+
Cogmem 3.6.2 exposes seven read-only/idempotent Memory Atlas query tools plus explicit `cogmem_graph_touch`, and installs from npm by default. Use explore for broad memory inventory/history, search and node for a known concept, path/neighbors for relations, timeline for ordered reconstruction, and normal recall for a direct fact. Query facets combine the user's actual project, time, topic, entity/target, memory-kind, action, and keyword conditions like table filters, so cold memory can be revived without requiring an entity-time-action tuple. Touch only nodes actually used, and follow returned event IDs to raw evidence before quoting exact wording.
|
|
93
|
+
|
|
94
|
+
## Runtime
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import {
|
|
98
|
+
HermesWorkspaceProfile,
|
|
99
|
+
KernelAgentMemoryBackend,
|
|
100
|
+
createMemoryKernelFromConfig,
|
|
101
|
+
} from 'cogmem';
|
|
102
|
+
|
|
103
|
+
const kernel = createMemoryKernelFromConfig();
|
|
104
|
+
const memory = new KernelAgentMemoryBackend(kernel);
|
|
105
|
+
const profile = new HermesWorkspaceProfile(process.cwd());
|
|
106
|
+
|
|
107
|
+
const sources = profile.buildSourceDefinitions({
|
|
108
|
+
projectId: 'hermes',
|
|
109
|
+
profilePath: 'profile.md',
|
|
110
|
+
sessionDir: 'sessions',
|
|
111
|
+
});
|
|
112
|
+
console.log(sources);
|
|
113
|
+
|
|
114
|
+
await memory.rememberTurn({
|
|
115
|
+
agentId: 'hermes',
|
|
116
|
+
projectId: 'hermes',
|
|
117
|
+
sessionId: 'current',
|
|
118
|
+
userText: 'Remember the release gate command.',
|
|
119
|
+
assistantText: 'Stored.',
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const recalled = memory.recall({
|
|
123
|
+
agentId: 'hermes',
|
|
124
|
+
projectId: 'hermes',
|
|
125
|
+
query: 'what is the release gate?',
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
console.log(recalled.items);
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
If a Hermes workspace uses different paths, pass explicit `profilePath` and `sessionDir` values instead of changing core.
|
|
132
|
+
|
|
133
|
+
For agent-facing instructions, run `cogmem connect hermes --workspace .`. It installs `SKILL.md` plus `references/operations.md`, a complete command-selection, migration, import, recall, Atlas, review, repair, backup, and maintenance handbook.
|
|
134
|
+
|
|
135
|
+
`cogmem connect hermes --workspace . --auto` patches the Hermes MCP config with a `cogmem` server command. Re-running it after an upgrade updates existing allow-lists with strategy, topic, episode repair, candidate review, graph touch, conditional Dream, memory-map, maintenance, and prospective tools. Cogmem cannot observe Hermes conversations unless Hermes calls append/import. Episode append/import never run Dream; MCP Dream tick mutates only with `maintenanceMode: true`, never executes tools, and durable semantic changes still require governance. After running it, restart or reload Hermes so the MCP server list is re-read.
|
|
136
|
+
|
|
137
|
+
Use MCP append/import only for bounded traffic. Supply `externalMessageId` for every message that may cross request boundaries; if a batch returns `auto_identity_not_safe_across_split_batches`, assign IDs before splitting or retrying it. MCP reports per-message progress/failure checkpoints. Large JSONL histories belong on `cogmem episode import` with checkpoint/resume plus `--start-line`, `--end-line`, `--max-lines`, `--skip-errors`, and `--max-errors`.
|
|
138
|
+
|
|
139
|
+
Recall warnings are operational signals: `no_recent_episode_ingestion_detected` means the hookless host has not supplied recent conversation evidence, while `semantic_memory_may_lag` means open/soft-sealed high-value work or Dream backlog/failures remain. Ingest or repair before claiming current semantic memory. Use `cogmem_topic_list` / `cogmem_topic_operate` for audited user-shaped topic structure and `cogmem_episode_repair` for synchronized boundary surgery.
|
|
140
|
+
|
|
141
|
+
The MCP `cogmem_recall` tool uses the same backend as `cogmem memory recall`. A Hermes MCP call with only `projectId: "hermes"` still infers `agentId: "hermes"` and can return `raw_ledger` items with labeled `sourceContext` events, `sourceContext.window`, and locator commands when vectors are empty. Pass `collection: "theseus"` only when Hermes wants creative artifacts instead of normal operational memory.
|
|
142
|
+
|
|
143
|
+
Useful host-owned inspection commands:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
cogmem memory map --project hermes --json
|
|
147
|
+
cogmem memory tick --project hermes --json
|
|
148
|
+
cogmem memory bind --project hermes --json
|
|
149
|
+
cogmem episode status --project hermes --json
|
|
150
|
+
cogmem dream tick --project hermes --mode auto --json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`memory map` includes Memory Binding and Graph Recall counters. Bindings attach valuable user raw events to stable topic/entity paths, fuse same-claim evidence into claim-key clusters, and create graph anchors for raw-ledger drill-down; they are not verified long-term facts. If `memory tick` suggests `bind_raw_events`, run `memory bind` to backfill imported Hermes raw user events into the binding graph.
|