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
package/README.md
ADDED
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
# cogmem
|
|
2
|
+
|
|
3
|
+
Agent-native memory kernel for a single AI agent.
|
|
4
|
+
|
|
5
|
+
`cogmem` is a local-first memory backend for agents and agent frameworks. It stores raw experience, preserves provenance, curates long-term memory candidates, governs what becomes active memory, and recalls bounded context with source anchors.
|
|
6
|
+
|
|
7
|
+
Cogmem is a lightweight, local-first memory kernel for personal AI agents.
|
|
8
|
+
It lets agents recall and inject relevant source-anchored memory without manually reading memory files.
|
|
9
|
+
|
|
10
|
+
It is not a knowledge-base app, a note-taking app, a vector RAG wrapper, an Obsidian replacement, an agent runtime, or a task scheduler.
|
|
11
|
+
|
|
12
|
+
## Status
|
|
13
|
+
|
|
14
|
+
Current version: `3.6.2`
|
|
15
|
+
|
|
16
|
+
Distribution: npm registry. GitHub remains the source mirror and hosts this installer, but package install and upgrade resolve `cogmem` from npm by default.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
curl -fsSL https://raw.githubusercontent.com/liuqin164/cogmem/main/install.sh | bash
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The installer:
|
|
23
|
+
|
|
24
|
+
1. Ensures Bun is available.
|
|
25
|
+
2. Installs `cogmem@latest` from the npm registry into `~/.cogmem/pkg`.
|
|
26
|
+
3. Links the `cogmem` CLI into `~/.bun/bin`.
|
|
27
|
+
4. Starts the interactive setup wizard from `/dev/tty`, so `curl | bash` installs still receive real keyboard input.
|
|
28
|
+
|
|
29
|
+
If no interactive terminal is available, the installer writes a conservative non-interactive config and tells you to rerun `cogmem init`.
|
|
30
|
+
|
|
31
|
+
To skip the wizard:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
COGMEM_SKIP_INIT=1 curl -fsSL https://raw.githubusercontent.com/liuqin164/cogmem/main/install.sh | bash
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## What cogmem Is For
|
|
38
|
+
|
|
39
|
+
Use cogmem when an agent needs durable memory across sessions:
|
|
40
|
+
|
|
41
|
+
- Conversations with the user.
|
|
42
|
+
- Explicit user preferences, goals, constraints, and boundaries.
|
|
43
|
+
- Task events, tool observations, diagnostic conclusions, failures, and corrections.
|
|
44
|
+
- Imported memory files from OpenClaw, Hermes, transcripts, Markdown, JSON, CSV, or TSV.
|
|
45
|
+
- Governed recall that can explain why something was remembered and where the evidence came from.
|
|
46
|
+
|
|
47
|
+
The intended integration surface is:
|
|
48
|
+
|
|
49
|
+
- `KernelAgentMemoryBackend` for agent/framework code.
|
|
50
|
+
- `cogmem` CLI for setup, import, recall, audit, curation, and repair.
|
|
51
|
+
- MCP tools for hosts such as Hermes.
|
|
52
|
+
- A host plugin wrapper for OpenClaw automatic recall and turn recording.
|
|
53
|
+
|
|
54
|
+
## What cogmem Is Not
|
|
55
|
+
|
|
56
|
+
cogmem intentionally does not provide:
|
|
57
|
+
|
|
58
|
+
- Agent task execution.
|
|
59
|
+
- Shell, deploy, or tool runtime.
|
|
60
|
+
- App store, skill runtime, approval queue, or channel gateway.
|
|
61
|
+
- Telegram, Discord, browser, or web UI integrations.
|
|
62
|
+
- Multi-agent shared team memory.
|
|
63
|
+
- A human PKM/wiki/Obsidian replacement.
|
|
64
|
+
- A default “embed every sentence forever” vector store.
|
|
65
|
+
|
|
66
|
+
The current release is designed as the memory backend for one agent brain. Multiple agents can each have their own cogmem database and project scope, but this version does not implement conflict-safe shared memory for an agent team.
|
|
67
|
+
|
|
68
|
+
## Architecture
|
|
69
|
+
|
|
70
|
+
cogmem separates memory into layers:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
Raw Ledger
|
|
74
|
+
Complete chronological event archive: messages, tool calls, tool results, task events.
|
|
75
|
+
|
|
76
|
+
Metadata / FTS Index
|
|
77
|
+
Lightweight keyword, source, time, project, and thread indexing for exact lookup.
|
|
78
|
+
|
|
79
|
+
Memory Binding
|
|
80
|
+
CPU-canonicalized raw-event bindings to stable entity/topic paths, claim-key clusters, and activation-aware graph edges for source-anchored organization before fact promotion.
|
|
81
|
+
|
|
82
|
+
Memory Atlas
|
|
83
|
+
A bounded, project-scoped content map over topics, entities, clusters, episodes, beliefs, actions, time, and their source-anchored relations. Agents use it to inventory, filter, navigate, and then drill down to Raw Ledger evidence.
|
|
84
|
+
|
|
85
|
+
User-Shaped Topic Ontology
|
|
86
|
+
A stable memory-class skeleton plus project-scoped topic names, aliases, parent paths, relations, and reversible audit operations learned from explicit user language.
|
|
87
|
+
|
|
88
|
+
Episode Assembler
|
|
89
|
+
Deterministic, session-scoped grouping of raw messages into auditable open, soft-sealed, and sealed conversation episodes.
|
|
90
|
+
|
|
91
|
+
Memory Governance Plan
|
|
92
|
+
Evidence-backed, idempotent semantic operations validated by CPU policy and committed with their audit records in one SQLite transaction.
|
|
93
|
+
|
|
94
|
+
Compiled Memory
|
|
95
|
+
Governed summaries, preferences, constraints, goals, lessons, diagnostics, and topic memories.
|
|
96
|
+
|
|
97
|
+
Dream Curator
|
|
98
|
+
Conditional background curation that processes sealed episodes and proposes raw-event-grounded candidates only.
|
|
99
|
+
|
|
100
|
+
CPU Governance
|
|
101
|
+
Rule-based promotion, suppression, supersession, and confirmation policy.
|
|
102
|
+
|
|
103
|
+
Active Recall
|
|
104
|
+
Bounded context pack assembled with binding graph anchors, pulse activation, temporal routing, source anchors, and inhibition.
|
|
105
|
+
|
|
106
|
+
Strategy Cortex
|
|
107
|
+
CPU-owned current-turn policy that selects retrieval lanes, layer order, source requirements, and memory budget before recall.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Strategy Cortex borrows StraTA's separation between a compact global strategy and local execution, while deliberately excluding its online reinforcement-learning loop. Cogmem uses deterministic templates online and reserves diverse strategy comparison and critical memory-use judgment for offline BrainEval. See [StraTA](https://arxiv.org/abs/2605.06642).
|
|
111
|
+
|
|
112
|
+
The core rule is:
|
|
113
|
+
|
|
114
|
+
> Raw evidence is preserved. Active memory is selective.
|
|
115
|
+
|
|
116
|
+
Every derived memory should point back to raw ledger evidence. If a memory cannot support an exact quote, the recall result marks it accordingly.
|
|
117
|
+
|
|
118
|
+
## Model Requirements
|
|
119
|
+
|
|
120
|
+
cogmem can run in `rule_only` mode, but production-quality semantic recall needs at least an embedding model. Dream curation needs a chat model.
|
|
121
|
+
|
|
122
|
+
Recommended local setup with Ollama:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
ollama pull qwen3-embedding:0.6b
|
|
126
|
+
ollama pull qwen2.5:7b
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Example `.cogmem/config.toml`:
|
|
130
|
+
|
|
131
|
+
```toml
|
|
132
|
+
[core]
|
|
133
|
+
db_path = "memory.db"
|
|
134
|
+
vector_backend = "sqlite-vec"
|
|
135
|
+
vector_dimension = 1024
|
|
136
|
+
|
|
137
|
+
[embedding]
|
|
138
|
+
provider = "openai_compatible"
|
|
139
|
+
base_url = "http://localhost:11434/v1"
|
|
140
|
+
model = "qwen3-embedding:0.6b"
|
|
141
|
+
timeout_ms = 30000
|
|
142
|
+
|
|
143
|
+
[memory_model]
|
|
144
|
+
provider = "openai_compatible"
|
|
145
|
+
base_url = "http://localhost:11434/v1"
|
|
146
|
+
model = "qwen2.5:7b"
|
|
147
|
+
api_key = ""
|
|
148
|
+
timeout_ms = 60000
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Vector dimensions must match the embedding model:
|
|
152
|
+
|
|
153
|
+
- `qwen3-embedding:0.6b`: `1024`
|
|
154
|
+
- `qwen3-embedding:4b`: `2560`
|
|
155
|
+
- `qwen3-embedding:8b`: `4096`
|
|
156
|
+
|
|
157
|
+
High-dimensional vectors grow quickly. Prefer `raw_then_dream` or `selective_compile` for long-running agents.
|
|
158
|
+
|
|
159
|
+
## Quick Start
|
|
160
|
+
|
|
161
|
+
Install globally:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
curl -fsSL https://raw.githubusercontent.com/liuqin164/cogmem/main/install.sh | bash
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Or install into an existing Bun workspace:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
bun add cogmem@latest
|
|
171
|
+
bunx cogmem init
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Or install with npm in a Node workspace that already uses Bun to run the Cogmem CLI:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm install cogmem@latest
|
|
178
|
+
./node_modules/.bin/cogmem init
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Validate configuration:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
cogmem doctor
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Upgrade from npm and migrate an existing database:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
cogmem update --yes
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`cogmem update --yes` installs `cogmem@latest` from npm, then runs the newly installed `cogmem migrate --yes --backup --config <resolved-config>`. If OpenClaw is configured, the updater also runs the newly installed plugin-only repair command so stale `index.js` and `bridge.mjs` files are refreshed before you restart the agent. To inspect changes without writing:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
cogmem update --dry-run --json
|
|
197
|
+
cogmem migrate --dry-run --json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
For a manual migration, run `cogmem migrate --yes --backup`. The migration runner adopts the existing `_meta.schema_version`, applies only later idempotent migrations, preserves Raw Ledger rows, and creates a timestamped, transaction-consistent standalone database backup before changing an on-disk database. The backup includes committed SQLite WAL pages instead of copying only the main database file.
|
|
201
|
+
|
|
202
|
+
Upgrade a 3.5.2 database, a 3.6.0 database, or a pre-release schema-25 test database into the 3.6.2 schema set with one command:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
cogmem migrate --yes --backup --json
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Schema 25 backfills the rebuildable Atlas projection. Schema 26 adds audited candidate reviews and exact Atlas projection metadata. Schema 27 marks 3.6.0-upgraded Atlas projections dirty so the first real action/time rebuild is not skipped. All preserve Raw Ledger, episodes, bindings, beliefs, and governed topic state; the command is idempotent.
|
|
209
|
+
|
|
210
|
+
For OpenClaw upgrades, `cogmem update --yes` now runs this refresh automatically when the config has `[integrations.openclaw] enabled = true`. You can also run it manually; this path does not open the Cogmem database, so it still works while an old drainer has the DB busy:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cogmem doctor --fix --agent openclaw --workspace <openclaw-workspace> --plugin-only --json
|
|
214
|
+
openclaw gateway restart
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Diagnose plugin staleness and hook failures without touching the DB:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
cogmem openclaw diagnose --workspace <openclaw-workspace> --json
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
If old 3.5.2-era rows were imported with an empty `project_id`, preview and apply the conservative single-project repair:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
cogmem repair project-scope --from "" --to openclaw --dry-run --json
|
|
227
|
+
cogmem repair project-scope --from "" --to openclaw --apply --json
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Inspect and conditionally process sealed conversation episodes:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
cogmem episode status --project my-agent --json
|
|
234
|
+
cogmem dream tick --project my-agent --mode auto --json
|
|
235
|
+
cogmem memory govern --project my-agent --json
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
For a host timer, call `dream tick`; the timer only wakes the scheduler. An empty backlog performs no Dream work:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
cogmem dream tick --project my-agent --mode auto --max-episodes 10 --json
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Raw events are always written first. `KernelAgentMemoryBackend` and OpenClaw plugin 0.6.2 assemble live turns automatically. The foreground hook uses deterministic rules and previous assistant/user context; background import and repair paths may use the advisory hybrid classifier. Advisory output is allow-listed and cannot directly mutate durable memory. Unknown turns now fail closed as ambiguous. Continuation requires explicit continuation language or project/topic/entity/semantic overlap; Cogmem does not route domains with an expanding hard-coded keyword dictionary.
|
|
245
|
+
|
|
246
|
+
Hookless MCP agents can call `cogmem_episode_append` or bounded `cogmem_episode_import`. Existing OpenClaw/Hermes import commands use stable content identities and the same episode schema. Low-confidence imported groups soft-seal for review unless an operator explicitly forces sealing. Episode semantic summaries and closure receipts are control hints, never durable evidence; every Dream candidate must cite a non-empty subset of the episode's raw event IDs and still pass CPU governance.
|
|
247
|
+
|
|
248
|
+
User-shaped topic state is project-scoped. Explicit user operations become active and auditable; model-proposed topics, aliases, and relations remain candidates. Use MCP `cogmem_topic_list` to inspect nodes, `cogmem_topic_operate` to create, rename, alias, move, merge, split, or relate topics, and `cogmem_topic_rollback` to reverse an audited operation. Alias collisions fail closed as `needs_review`; applications can also call `TopicGovernance.rollback()` through the public API.
|
|
249
|
+
|
|
250
|
+
Episode surgery is available through `cogmem episode split|merge|move-event|reclassify|requeue-dream` or MCP `cogmem_episode_repair`. Structural repair recomputes closure receipts, invalidates candidates derived from the old episode boundary, preserves cross-references, requeues eligible sealed episodes, and writes an audit record.
|
|
251
|
+
|
|
252
|
+
Inspect queue state:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
cogmem memory status --project my-agent --json
|
|
256
|
+
cogmem memory candidates --project my-agent --status candidate --json
|
|
257
|
+
cogmem memory govern --project my-agent --json
|
|
258
|
+
cogmem memory candidates --project my-agent --status needs_confirmation --json
|
|
259
|
+
cogmem memory review --project my-agent --id <candidate-id> --action approve --actor <operator> --reason "confirmed" --confirmation-event <user-event-id> --json
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
`memory govern` intentionally promotes only `candidate`. With `--status needs_confirmation` it lists the review queue and prints the `memory review` command instead of silently promoting the wrong status. Review actions are approve, reject, defer, supersede, and correction relink; every action stores operator identity, reason, and evidence requirements in an immutable audit row. `defer` keeps the candidate in `needs_confirmation` and records `reviewAfter` plus a status reason.
|
|
263
|
+
|
|
264
|
+
## Memory Atlas: let an agent see what it remembers
|
|
265
|
+
|
|
266
|
+
`cogmem memory map` remains the system anatomy map. Memory Atlas is the content map. It does not replace recall or create a second fact store; it projects existing topics, entities, clusters, episodes, beliefs, action frames, time buckets, bindings, and evidence into a bounded navigation surface.
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
cogmem memory graph --project my-agent --json
|
|
270
|
+
cogmem memory graph-search --project my-agent --query "Hermes" --json
|
|
271
|
+
cogmem memory graph-explore --project my-agent --query "去年我让你对 Hermes 做过什么" --json
|
|
272
|
+
cogmem memory graph-node --project my-agent --id "entity:<id>" --json
|
|
273
|
+
cogmem memory graph-neighbors --project my-agent --id "entity:<id>" --hops 2 --json
|
|
274
|
+
cogmem memory graph-path --project my-agent --from "entity:<id>" --to "action:<id>" --json
|
|
275
|
+
cogmem memory graph-timeline --project my-agent --query "2025 Hermes 的决策和修复" --json
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Atlas filtering is not limited to entity + time + action. The query compiler combines whichever facets are actually present, such as project, time range, topic, person/object, event, decision, correction, goal, preference, plan, action, and ordinary keywords. Exact multi-facet matches may surface cold nodes even when their activation has decayed. Project scope and raw evidence validation are never bypassed.
|
|
279
|
+
|
|
280
|
+
Defaults are 8 nodes, one hop, and two evidence IDs per node. Hard limits are 30 nodes, two hops, ten evidence IDs, six path hops, and 2,000 visited nodes. Raw excerpts are omitted unless `--include-evidence` or `includeEvidence: true` is explicit. `evidenceTotal` reports all known evidence while `evidenceReturned` reports the bounded payload. Every returned evidence item carries an `eventId` and a `cogmem memory show` drilldown command.
|
|
281
|
+
|
|
282
|
+
Atlas reads do not brighten everything they display. MCP graph queries are read-only/idempotent; call `cogmem_graph_touch` only after the agent actually uses selected nodes. Maintenance decays activation, refreshes dirty projections only, and prunes old access telemetry.
|
|
283
|
+
|
|
284
|
+
Agents should use Atlas for broad inventory, history, and relationship questions; use normal recall for a direct fact. See [MEMORY_ATLAS.md](./MEMORY_ATLAS.md) for the complete CLI, MCP, OpenClaw, activation, and provenance contract.
|
|
285
|
+
|
|
286
|
+
## CLI JSON contract
|
|
287
|
+
|
|
288
|
+
Every documented `--json` command emits `schemaVersion: "cogmem.cli.v1"` and a stable `command` identifier without hiding the command payload under a generic wrapper. Array results use `items`. Queue-bearing commands expose `candidate`, `promoted`, `needs_confirmation`, and `beliefs` at the top level. Existing nested queue objects remain available during 3.6.x for compatibility.
|
|
289
|
+
|
|
290
|
+
```json
|
|
291
|
+
{
|
|
292
|
+
"schemaVersion": "cogmem.cli.v1",
|
|
293
|
+
"command": "memory.status",
|
|
294
|
+
"candidate": 15190,
|
|
295
|
+
"promoted": 4953,
|
|
296
|
+
"needs_confirmation": 281,
|
|
297
|
+
"beliefs": 244
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Inspect the memory anatomy and run one explicit host-owned upkeep tick:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
cogmem memory map --project my-agent --json
|
|
305
|
+
cogmem memory tick --project my-agent --json
|
|
306
|
+
cogmem memory bind --project my-agent --json
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
`memory tick` decays activation and returns suggested host actions. It refreshes Atlas only when dirty, records projection failures without aborting other maintenance, prunes old Atlas access telemetry, reports high-value unbound raw user events, and ages untouched review entries after the default 30-day TTL. It does not start a hidden daemon; cron, systemd, MCP hosts, or agent adapters decide when to call it.
|
|
310
|
+
|
|
311
|
+
Operational cost classes:
|
|
312
|
+
|
|
313
|
+
- Interactive/read-only: `memory status`, `memory candidates`, Atlas query commands, `strategy plan`, and direct source `memory show`.
|
|
314
|
+
- Interactive/bounded: `memory recall`; every call reports `performance.totalMs`.
|
|
315
|
+
- Maintenance/write: import, Dream, governance, review, repair, binding, migration, re-embedding, compaction, and `memory tick`.
|
|
316
|
+
|
|
317
|
+
Never overlap maintenance writers against one database. Wait for each command to exit, use returned `durationMs`, backlog, and failure details to set the next interval, and keep routine status/candidate inspection on the read-only path. A `vectors` count of zero is not by itself a failure: `memory status --json` includes `vectorState.recallAvailableWithoutVectors` and the active fallback status.
|
|
318
|
+
|
|
319
|
+
`memory bind` backfills Memory Binding for raw user events written outside the agent turn path, including imported OpenClaw/Hermes history and adapter-written raw events. Use `--since <globalSeq>` to resume from a known ledger sequence.
|
|
320
|
+
|
|
321
|
+
`memory map` includes Memory Binding and Graph Recall counters. Bindings attach valuable user raw events to stable topic/entity paths before any fact promotion, fuse same-claim evidence into claim-key clusters, and create graph anchors for source drill-down. Correction events create explicit correction edges and review flags instead of poisoning the active cluster. Treat bindings, clusters, and graph edges as organization hints, not as verified long-term facts.
|
|
322
|
+
|
|
323
|
+
Entity identity is owned by `EntityStore`; Memory Binding only writes those canonical entity IDs into its compatibility projection. `EntityGovernanceService` creates evidence-backed merge candidates, requires same-project/same-type entities, and makes every applied merge reversible. Person aliases require explicit user evidence and a higher confidence threshold. Do not auto-merge pronouns, family labels, role names, or assistant/tool-only guesses.
|
|
324
|
+
|
|
325
|
+
`BeliefGovernanceService` turns repeated evidence into versioned current beliefs without losing the source chain. User-owned preferences, goals, boundaries, and decisions require explicit user events. Assistant and tool evidence may create project observations, but cannot establish user facts. Matching evidence reinforces one node; user corrections supersede the prior version; unsupported contradictions remain `possible_conflict` while the current belief stays active.
|
|
326
|
+
|
|
327
|
+
`TemporalMemoryService` answers which belief version was valid at a requested time and maintains bounded project/entity timelines for milestones, decisions, corrections, and belief versions. Current answers must not silently mix superseded state with active state. Historical answers should include the relevant validity window, correction reason, and raw evidence anchors when available.
|
|
328
|
+
|
|
329
|
+
`ContextCortex` decides whether memory should surface, which layers are eligible, and how much context they may consume. It hard-filters cross-project, superseded, current-session echo, unsupported user-belief, and unnecessary sensitive candidates before ranking. The default memory budget is 25% of available context with a 30% hard ceiling. Every plan emits an activation receipt containing selected and suppressed IDs with reasons.
|
|
330
|
+
|
|
331
|
+
`StrategyCortex` runs before recall for non-trivial memory queries. It selects one CPU-owned template such as `source-first`, `temporal-first`, `user-belief-first`, `project-state`, `graph-source`, or `balanced-memory`, then constrains which graph/compiled/raw lanes may run and how Context Cortex orders the resulting layers. A capsule is fixed only for the current turn. Intent/project changes, an unmet exact-source requirement, evidence conflict, or an unsatisfied required-layer budget may trigger at most one deterministic replan. The capsule has `instructionAuthority: "none"`: it cannot override the user, host policy, tool authorization, or memory governance.
|
|
332
|
+
|
|
333
|
+
Inspect this policy and its read-only outcome telemetry with:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
cogmem strategy plan --project hermes --query "我当时的原话是什么?" --json
|
|
337
|
+
cogmem strategy outcomes --project hermes --json
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
OpenClaw plugin 0.6.2 skips Cogmem entirely for greetings, uses only session state/turn bridge for short continuations, and applies Strategy Cortex before full recall. Navigation turns use one bridge/kernel lifecycle for Atlas exploration, evidence-bearing node/timeline drill-down, and recall. The bounded volatile `<COGMEM_MEMORY_ATLAS>` block includes evidence event IDs and drill-down commands; OpenClaw does not need MCP for this path.
|
|
341
|
+
|
|
342
|
+
`ProspectiveMemoryService` stores future intentions, commitments, reminders, open loops, and plans as candidates only. A candidate is not actionable until an explicit user event confirms it. Rejected candidates stay suppressed unless genuinely new evidence creates a new version. The service and `cogmem prospective` CLI manage state only; they expose no task or tool execution capability.
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
cogmem prospective create --project hermes --type reminder --key release:check-ci --title "Check CI" --evidence <request-event-id> --due <epoch-ms>
|
|
346
|
+
cogmem prospective confirm --project hermes --id <candidate-id> --evidence <distinct-user-confirmation-event-id>
|
|
347
|
+
cogmem prospective due --project hermes
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Every mutation requires the candidate project. Confirmation evidence must be a distinct Raw Ledger user event in that project. A due result is memory state, not permission to run a tool.
|
|
351
|
+
|
|
352
|
+
Run `cogmem brain-eval --input samples.json` to measure recall, precision, provenance coverage, context-budget compliance, stale/cross-project leakage, and unconfirmed prospective activation. The command exits non-zero when a safety threshold fails.
|
|
353
|
+
|
|
354
|
+
Compare precomputed memory-policy rollouts offline with:
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
cogmem brain-eval --input strategy-outcomes.json --strategy-rollout --json
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
This mode never generates online rollouts. It reports median and worst-decile quality, source fidelity, strategy adherence, unsafe/stale/cross-project leakage, budget compliance, and p95 latency. Top-fraction score is diagnostic potential only and cannot override a failed safety gate.
|
|
361
|
+
|
|
362
|
+
## Import Existing Agent Memory
|
|
363
|
+
|
|
364
|
+
Configure the embedding provider before importing. Imported records are embedded through the configured kernel embedder, so the configured `vector_dimension` must match the selected embedding model.
|
|
365
|
+
|
|
366
|
+
For local quantized embeddings with Ollama:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
ollama pull qwen3-embedding:0.6b
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
```toml
|
|
373
|
+
[embedding]
|
|
374
|
+
provider = "openai_compatible"
|
|
375
|
+
base_url = "http://localhost:11434/v1"
|
|
376
|
+
model = "qwen3-embedding:0.6b"
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Always preview an import with `--dry-run` first.
|
|
380
|
+
|
|
381
|
+
OpenClaw:
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
cogmem import-openclaw --workspace . --project openclaw --dry-run
|
|
385
|
+
cogmem import-openclaw --workspace . --project openclaw
|
|
386
|
+
cogmem import-openclaw --workspace . --project openclaw --session ./one.md
|
|
387
|
+
cogmem import-openclaw --workspace . --project openclaw --session ./one.md --session ./two.md
|
|
388
|
+
cogmem import-openclaw --workspace . --project openclaw --memory ./one.md
|
|
389
|
+
cogmem import-openclaw --workspace . --project openclaw --memory ./one.md --memory ./two.md
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Hermes:
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
cogmem import-hermes --workspace . --project hermes --dry-run
|
|
396
|
+
cogmem import-hermes --workspace . --project hermes
|
|
397
|
+
cogmem import-hermes --workspace . --project hermes --state-db ./state.db --dry-run
|
|
398
|
+
cogmem import-hermes --workspace . --project hermes --state-db ./state.db
|
|
399
|
+
cogmem import-hermes --workspace . --project hermes --profile ./memory/profile.md --sessions ./memory/sessions
|
|
400
|
+
cogmem import-hermes --workspace . --project hermes --session ./one.md
|
|
401
|
+
cogmem import-hermes --workspace . --project hermes --session ./one.md --session ./two.md
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Hermes `state.db` is scanned automatically when it exists at the workspace root. The importer reads the SQLite `messages` table, preserves message order, supports WAL-mode read-only databases through SQLite immutable mode, and prefers message-level `occurredAt` / `timestamp` / `createdAt` fields. Numeric `timestamp` values are treated as epoch seconds when they are below millisecond range. `InsertTime` is only a fallback when the original message time is absent.
|
|
405
|
+
|
|
406
|
+
Imports are idempotent. Re-running the same import skips records already processed by the cursor store. Use `--json --progress` when a host agent needs machine-readable output while still receiving progress on stderr.
|
|
407
|
+
|
|
408
|
+
Normalize JSON, JSONL, CSV, or TSV transcripts before import when the source format needs explicit ordering anchors:
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
cogmem normalize-transcript --input ./export.json --output ./normalized.md --family json-array --dry-run --json
|
|
412
|
+
cogmem normalize-transcript --input ./hermes-sessions.jsonl --output ./normalized.md --family jsonl --dry-run --json
|
|
413
|
+
cogmem normalize-transcript --input ./export.csv --output ./normalized.md --family csv --dry-run --json
|
|
414
|
+
cogmem-normalize-transcript --input ./export.json --output ./normalized.md --family json-array --dry-run --json
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Normalization writes Markdown with `cogmem-source-ref` markers for raw offset, line, and ordering confidence. JSONL supports both one-message-per-line exports and Hermes session exports where each line is an object with `messages[]`. A dry run validates and summarizes the transcript only; it does not open a memory database.
|
|
418
|
+
|
|
419
|
+
## OpenClaw
|
|
420
|
+
|
|
421
|
+
OpenClaw is the most complete host integration in this release.
|
|
422
|
+
|
|
423
|
+
From the OpenClaw workspace:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
cd ~/.openclaw/workspace
|
|
427
|
+
cogmem init --agent openclaw --scope project
|
|
428
|
+
cogmem doctor
|
|
429
|
+
cogmem connect openclaw --workspace . --auto --force
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Import existing OpenClaw memory:
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
cogmem import-openclaw --workspace . --project openclaw --dry-run
|
|
436
|
+
cogmem import-openclaw --workspace . --project openclaw
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
If you imported old memory before raw ledger anchors existed:
|
|
440
|
+
|
|
441
|
+
```bash
|
|
442
|
+
cogmem import-openclaw --workspace . --project openclaw --config .cogmem/config.toml --reindex-raw --json
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
`cogmem connect openclaw --auto` installs a local OpenClaw plugin wrapper under:
|
|
446
|
+
|
|
447
|
+
```text
|
|
448
|
+
<workspace>/extensions/cogmem-auto-memory/
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
The wrapper registers:
|
|
452
|
+
|
|
453
|
+
- `before_prompt_build`: governed recall and prompt context injection.
|
|
454
|
+
- `agent_end`: queued turn recording so slow embedding/database writes do not block responses.
|
|
455
|
+
|
|
456
|
+
The automatic wrapper keeps OpenClaw's native prompt untouched. Cogmem only prepends its own bounded memory layer:
|
|
457
|
+
|
|
458
|
+
- `<COGMEM_SESSION_STATE>` is compact current-session working state stored under `.cogmem/session_state/openclaw/`.
|
|
459
|
+
- `<COGMEM_TURN_BRIDGE>` is a short-lived receipt of which memory anchors supported the prior answer, stored under `.cogmem/session_bridges/openclaw/`.
|
|
460
|
+
- `<COGMEM_STRATEGY_CONTEXT>` is the current-turn, no-authority memory-use policy. It is not evidence or an instruction and is stripped before recording.
|
|
461
|
+
- `<COGMEM_RECALL_CONTEXT>` is full recall evidence for the current turn only. It is stripped before turn recording and must not be persisted or re-ingested as new memory.
|
|
462
|
+
|
|
463
|
+
By default, `selective_compile` uses user text as the durable compile signal, excludes current-session compiled memory during recall, injects at most three memory items, and omits full source-window text unless the plugin config enables it.
|
|
464
|
+
|
|
465
|
+
After updates or config drift:
|
|
466
|
+
|
|
467
|
+
```bash
|
|
468
|
+
cogmem doctor --fix --agent openclaw --workspace .
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## Hermes
|
|
472
|
+
|
|
473
|
+
Hermes integration is MCP-based in this release. cogmem does not claim to be a native Hermes memory provider.
|
|
474
|
+
|
|
475
|
+
Install the skill and patch Hermes MCP config:
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
cogmem init --agent hermes
|
|
479
|
+
cogmem connect hermes --workspace /path/to/hermes/workspace --auto --force
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
This installs the agent-facing skill bundle at:
|
|
483
|
+
|
|
484
|
+
```text
|
|
485
|
+
~/.hermes/skills/cogmem-memory/SKILL.md
|
|
486
|
+
~/.hermes/skills/cogmem-memory/references/operations.md
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
The reference file is the complete agent command handbook for setup, migration, imports, recall, Atlas, governance review, repair, backup, and maintenance scheduling.
|
|
490
|
+
|
|
491
|
+
With `--auto`, it adds or updates a `cogmem` MCP server entry in:
|
|
492
|
+
|
|
493
|
+
```text
|
|
494
|
+
~/.hermes/config.yaml
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Then reload MCP inside Hermes:
|
|
498
|
+
|
|
499
|
+
```text
|
|
500
|
+
/reload-mcp
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Hermes can call the MCP recall tool directly:
|
|
504
|
+
|
|
505
|
+
```json
|
|
506
|
+
{ "query": "MoneyPrinterTurbo", "projectId": "hermes" }
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
`cogmem_recall` uses the same agent-facing recall path as `cogmem memory recall` and returns its `strategyCapsule`. `cogmem_strategy_plan` exposes that deterministic, read-only memory policy without performing recall. If `agentId` is omitted, MCP infers it from `projectId`, so project-only Hermes calls can still reach raw ledger fallback and return `items[].sourceContext` when vectors are empty. Re-running `cogmem connect hermes --auto` after an upgrade also patches existing `tools.include` allow-lists with newly supported Cogmem MCP tools.
|
|
510
|
+
|
|
511
|
+
For Hermes sessions without lifecycle hooks, use `cogmem_episode_append` with a required stable `externalMessageId` for one message or `cogmem_episode_import` for a bounded batch. These tools only write Raw Ledger and episode metadata. They never run Dream. Inspect with `cogmem_episode_status`, seal explicitly with `cogmem_episode_seal`, and call MCP `cogmem_dream_tick` with `maintenanceMode: true` only during idle upkeep or an explicit user/admin maintenance request. Without that flag it returns a recommendation-only dry run.
|
|
512
|
+
|
|
513
|
+
`externalMessageId` is idempotent inside `(projectId, sourceAgent, sessionId)`. Reusing the same ID with different role, text, or `sourceAgent` metadata is rejected instead of silently replacing evidence. A bounded MCP batch that omits IDs returns `auto_identity_not_safe_across_split_batches`; do not split and retry such a batch without assigning stable IDs. Import results include per-message checkpoints. Deterministic noise remains in Raw Ledger and is returned as `ignoredEventIds`, not as repairable `unassignedEventIds`.
|
|
514
|
+
|
|
515
|
+
If recall reports `no_recent_episode_ingestion_detected` or `semantic_memory_may_lag`, the hookless host must append/import recent messages before trusting semantic freshness. For large JSONL files use `cogmem episode import` with `--start-line`, `--end-line`, `--max-lines`, `--skip-errors`, and `--max-errors`; failures report `failedAtLine`, `lastProcessedLine`, and `resumeFrom`.
|
|
516
|
+
|
|
517
|
+
```json
|
|
518
|
+
{
|
|
519
|
+
"projectId": "hermes",
|
|
520
|
+
"sessionId": "session-42",
|
|
521
|
+
"sourceAgent": "hermes",
|
|
522
|
+
"role": "user",
|
|
523
|
+
"text": "Continue the release discussion.",
|
|
524
|
+
"externalMessageId": "msg-42"
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
Import existing Hermes memory:
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
cogmem import-hermes --workspace /path/to/hermes/workspace --project hermes --dry-run
|
|
532
|
+
cogmem import-hermes --workspace /path/to/hermes/workspace --project hermes
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
If Hermes stores conversations in SQLite:
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
cogmem import-hermes --workspace /path/to/hermes/workspace --project hermes --state-db /path/to/hermes/workspace/state.db --dry-run
|
|
539
|
+
cogmem import-hermes --workspace /path/to/hermes/workspace --project hermes --state-db /path/to/hermes/workspace/state.db
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
If Hermes stores memory in non-default paths, pass explicit files:
|
|
543
|
+
|
|
544
|
+
```bash
|
|
545
|
+
cogmem import-hermes --workspace . --project hermes --profile ./memory/profile.md --sessions ./memory/sessions
|
|
546
|
+
cogmem import-hermes --workspace . --project hermes --session ./sessions/one.md
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
## Agent-Facing Recall
|
|
550
|
+
|
|
551
|
+
Agents should not search legacy Markdown files first. They should ask cogmem:
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
cogmem memory recall --query "what did we discuss about memory black boxes?" --project openclaw --agent openclaw --json
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
Hermes recall should use the Hermes project and agent identifiers:
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
cogmem memory recall --query "我们记录过哪些库存" --project hermes --agent hermes --json
|
|
561
|
+
cogmem memory search --query "エルビ 库存" --project hermes --json
|
|
562
|
+
cogmem memory show --event <event-id> --before 2 --after 2 --json
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
`memory recall` can still return source-anchored raw ledger evidence when `vectors` is `0`. In that state, recall falls back to governed raw FTS and returns `sourceContext` locators instead of claiming vector search succeeded. Broad inventory questions such as `我们记录过哪些库存` are expanded into structured ledger cues such as `库存管理`, `在库`, `产品コード`, and `数量`; if compiled-memory candidates do not contain those cues, raw ledger evidence is preferred.
|
|
566
|
+
|
|
567
|
+
Use collection routing for non-operational artifacts:
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
cogmem memory recall --query "MoneyPrinterTurbo storyboard" --project openclaw --agent openclaw --collection theseus --json
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
Default recall includes untagged and `collection:anchor` memory only. `collection:theseus` is for creative artifacts and must be requested explicitly so drafts do not pollute the normal agent memory path.
|
|
574
|
+
|
|
575
|
+
The MCP `cogmem_recall` tool returns the same agent-facing item shape and fallback behavior. Agents may call it with `query`, `projectId`, and optionally `agentId` and `collection`; when `agentId` is omitted, MCP uses `projectId` as the agent id before falling back to `openclaw`. `cogmem_strategy_plan` is the read-only strategy inspection path, while `cogmem_explain_recall` remains the audit path for `filteredEvidence` and governance reasons. Recall and explain surfaces expose `decisionTrace`, and OpenClaw renders its bounded form as `recallDecision`. Inspect `selectedLane`, `reason`, and candidate counts before claiming that memory is absent; then use `sourceLocator` for exact wording.
|
|
576
|
+
|
|
577
|
+
`cogmem memory status --json` exposes stable top-level counters:
|
|
578
|
+
|
|
579
|
+
```text
|
|
580
|
+
rawEvents, vectors, dreamedRawCount, undreamedRawCount, dreamCoverageRate
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
Useful intents:
|
|
584
|
+
|
|
585
|
+
```bash
|
|
586
|
+
cogmem memory recall --query "上个会话我们聊了什么" --intent previous_session_summary --project openclaw --agent openclaw --json
|
|
587
|
+
cogmem memory recall --query "我当时关于记忆黑盒的原话是什么" --intent forensic_quote --project openclaw --agent openclaw --json
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Recall results include:
|
|
591
|
+
|
|
592
|
+
- `decisionTrace` with the selected recall lane, stable reason, per-lane candidate counts, and selected count
|
|
593
|
+
- `sourceType`
|
|
594
|
+
- `sourceAnchor`
|
|
595
|
+
- `sourceContext`
|
|
596
|
+
- `sourceContext.event.label` and per-event `label` values for matching injected context to `memory show`
|
|
597
|
+
- `sourceContext.window` with requested counts, actual counts, chronological ordering, role filter, anchor exclusion, and overlap handling
|
|
598
|
+
- `sourceContext.event.charRange` / `sourceRange` when the importer or recorder preserved source positions
|
|
599
|
+
- `canAnswerExactQuote`
|
|
600
|
+
- `whyMatched`
|
|
601
|
+
- `governanceReason`
|
|
602
|
+
|
|
603
|
+
If `canAnswerExactQuote=false`, the agent must not present the item as the user's original wording. It should use `sourceContext` or run the locator command:
|
|
604
|
+
|
|
605
|
+
```bash
|
|
606
|
+
cogmem memory show --event <eventId> --before 2 --after 2 --json
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
`memory show --json` uses the same source context contract. Its `before` and `after` arrays strictly exclude the anchor event, remain chronological, and are de-duplicated. The `window` object reports `requestedCount`, `count`, `excludesAnchor`, `roleFilter`, `ordering`, `overlapEventIds`, and `overlapHandling`. OpenClaw automatic prompt injection renders this metadata inside `<COGMEM_RECALL_CONTEXT>` as `sourceWindow` and `sourceTruncation`; full `sourceBefore` / `sourceAfter` text is omitted by default and should be requested through `sourceLocator` before quoting exact wording.
|
|
610
|
+
|
|
611
|
+
Raw-ledger fallback is not limited to the latest fixed event window. When Chinese FTS cannot match a cue directly, Cogmem runs a project/workspace/thread/time-scoped ledger text fallback and prefers an original user event over an assistant retelling when both match equally. Imported OpenClaw Markdown also accepts empty `user:` / `assistant:` headers whose body follows on later lines and collapses only adjacent exact duplicate exports.
|
|
612
|
+
|
|
613
|
+
## TypeScript API
|
|
614
|
+
|
|
615
|
+
```ts
|
|
616
|
+
import {
|
|
617
|
+
KernelAgentMemoryBackend,
|
|
618
|
+
createMemoryKernelFromConfig,
|
|
619
|
+
} from 'cogmem';
|
|
620
|
+
|
|
621
|
+
const kernel = createMemoryKernelFromConfig();
|
|
622
|
+
const memory = new KernelAgentMemoryBackend(kernel);
|
|
623
|
+
|
|
624
|
+
await memory.rememberTurn({
|
|
625
|
+
agentId: 'openclaw',
|
|
626
|
+
projectId: 'openclaw',
|
|
627
|
+
sessionId: 'session-1',
|
|
628
|
+
userText: 'Remember that this project is local-first.',
|
|
629
|
+
assistantText: 'Stored.',
|
|
630
|
+
ingestMode: 'raw_then_dream',
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
const recalled = memory.recall({
|
|
634
|
+
agentId: 'openclaw',
|
|
635
|
+
projectId: 'openclaw',
|
|
636
|
+
query: 'what did I say about local-first memory?',
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
console.log(recalled.narrative);
|
|
640
|
+
console.log(recalled.items);
|
|
641
|
+
|
|
642
|
+
const pack = memory.recallPack({
|
|
643
|
+
agentId: 'openclaw',
|
|
644
|
+
projectId: 'openclaw',
|
|
645
|
+
query: 'what should I remember before answering?',
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
console.log(pack.slots.direct);
|
|
649
|
+
console.log(pack.slots.associative);
|
|
650
|
+
console.log(pack.slots.entityCards);
|
|
651
|
+
console.log(pack.slots.beliefTouches);
|
|
652
|
+
|
|
653
|
+
const map = kernel.buildMemoryMap({ projectId: 'openclaw' });
|
|
654
|
+
const tick = kernel.runMaintenanceTick({ projectId: 'openclaw' });
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
## Updating
|
|
658
|
+
|
|
659
|
+
```bash
|
|
660
|
+
cogmem update --yes
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
`cogmem update` installs the latest package from:
|
|
664
|
+
|
|
665
|
+
```text
|
|
666
|
+
npm:cogmem@latest
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
The updater resolves `latest` to npm by default, installs into the current package or the one-line installer home, then runs post-install work through the newly installed local `node_modules/.bin/cogmem`. That post-install path runs a backed-up schema migration with the resolved config, refreshes the OpenClaw plugin when OpenClaw is configured, and reports which agent hosts must be restarted. Use `--from <version|tag|tarball>` only when you intentionally want another package spec.
|
|
670
|
+
|
|
671
|
+
For OpenClaw after an update, restart the gateway or host after `cogmem update --yes` finishes. To repair only the plugin without opening SQLite:
|
|
672
|
+
|
|
673
|
+
```bash
|
|
674
|
+
cd ~/.openclaw/workspace
|
|
675
|
+
cogmem doctor --fix --agent openclaw --workspace . --plugin-only
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
For Hermes after an update, reload the MCP server or restart the agent host. If MCP wiring changed:
|
|
679
|
+
|
|
680
|
+
```bash
|
|
681
|
+
cogmem connect hermes --workspace /path/to/hermes/workspace --auto --force
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
This also updates existing Hermes `cogmem-mcp` blocks with missing strategy, episode, Dream, memory-map, maintenance, and prospective tools.
|
|
685
|
+
|
|
686
|
+
## Documentation
|
|
687
|
+
|
|
688
|
+
- [Memory model](./MEMORY_MODEL.md)
|
|
689
|
+
- [Memory Atlas](./MEMORY_ATLAS.md)
|
|
690
|
+
- [Recall explainability](./RECALL_EXPLAINABILITY.md)
|
|
691
|
+
- [Concurrent access](./CONCURRENT_ACCESS.md)
|
|
692
|
+
- [Benchmarks and release gates](./BENCHMARKS.md)
|
|
693
|
+
- [Security](./SECURITY.md)
|
|
694
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
695
|
+
- [Release checklist](./RELEASE_CHECKLIST.md)
|
|
696
|
+
- [Changelog](./CHANGELOG.md)
|
|
697
|
+
|
|
698
|
+
Installed OpenClaw and Hermes skills include their own `references/operations.md` command handbook.
|
|
699
|
+
|
|
700
|
+
## CLI
|
|
701
|
+
|
|
702
|
+
```text
|
|
703
|
+
cogmem init
|
|
704
|
+
cogmem doctor
|
|
705
|
+
cogmem connect openclaw|hermes
|
|
706
|
+
cogmem update
|
|
707
|
+
cogmem memory recall|search|show|dream|govern|candidates|review|status|map|tick|bind
|
|
708
|
+
cogmem memory graph|graph-search|graph-explore|graph-node|graph-neighbors|graph-path|graph-timeline
|
|
709
|
+
cogmem import-openclaw
|
|
710
|
+
cogmem import-hermes
|
|
711
|
+
cogmem normalize-transcript
|
|
712
|
+
cogmem snapshot export|import
|
|
713
|
+
cogmem compact
|
|
714
|
+
cogmem re-embed
|
|
715
|
+
cogmem migrate-vectors
|
|
716
|
+
cogmem migrate
|
|
717
|
+
cogmem prospective
|
|
718
|
+
cogmem strategy
|
|
719
|
+
cogmem brain-eval
|
|
720
|
+
cogmem episode
|
|
721
|
+
cogmem dream
|
|
722
|
+
cogmem mcp
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
## Release Checks
|
|
726
|
+
|
|
727
|
+
```bash
|
|
728
|
+
bun run typecheck
|
|
729
|
+
bun run build
|
|
730
|
+
bun test
|
|
731
|
+
npm pack --dry-run --json
|
|
732
|
+
npm publish --dry-run --access public
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
Publish with `npm publish --access public` after the dry run and full tests pass. Keep GitHub branches/releases in sync so old GitHub-installed 3.6.1 users have a discoverable bridge to the npm-first 3.6.2 updater.
|
|
736
|
+
|
|
737
|
+
## Security and Privacy
|
|
738
|
+
|
|
739
|
+
- Local-first by default.
|
|
740
|
+
- No hosted storage required.
|
|
741
|
+
- External embedding or memory-model providers must be explicit in TOML.
|
|
742
|
+
- PII redaction can run before writing.
|
|
743
|
+
- Optional AES-256-GCM encryption is available for sensitive fields.
|
|
744
|
+
- Snapshots and exports can contain sensitive memory. Treat them as private artifacts.
|
|
745
|
+
- Project boundaries are enforced in recall and explain paths.
|
|
746
|
+
|
|
747
|
+
## Design Boundary
|
|
748
|
+
|
|
749
|
+
cogmem can be used by OpenClaw, Hermes, LangGraph, custom agents, or a future agent OS. It must not depend on those hosts.
|
|
750
|
+
|
|
751
|
+
The source of truth is the kernel store and chronological event ledger, not Markdown files. Markdown, Obsidian vaults, and wiki pages can be imported or exported as projections, but they are not the primary memory system.
|