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,152 @@
|
|
|
1
|
+
# Recall Explainability
|
|
2
|
+
|
|
3
|
+
Agent-facing recall is governed by default. `KernelAgentMemoryBackend.recall()` and `MemoryKernel.navigateMemory()` return active evidence only after scope, status, trust, and budget filtering.
|
|
4
|
+
|
|
5
|
+
## Included Evidence
|
|
6
|
+
|
|
7
|
+
`explainRecallWithKernel()` reports why evidence entered the recall result:
|
|
8
|
+
|
|
9
|
+
- `activationPath`: the recall path, such as pulse, temporal traversal, or fallback.
|
|
10
|
+
- `whyMatched`: agent scope, provenance, pulse fusion, temporal branch, and governance reasons.
|
|
11
|
+
- `sourceAnchor`: the drill-down anchor for the semantic memory source event.
|
|
12
|
+
|
|
13
|
+
`sourceAnchor` contains:
|
|
14
|
+
|
|
15
|
+
- `eventId`: the memory event that recorded the semantic ingest.
|
|
16
|
+
- `sourceEventType`: usually `INGESTED`.
|
|
17
|
+
- `sourceRefs`: raw event, source path, thread, line, turn, and ordinal anchors when available.
|
|
18
|
+
- `context`: surrounding ledger context for the source event.
|
|
19
|
+
|
|
20
|
+
For agent lifecycle events, source refs may point to `message`, `tool_call`, `tool_result`, or `task_event` raw ledger entries. For normalized JSON/CSV imports, source refs preserve original source offset and row/line anchors when available, even though ingestion flows through Markdown projection.
|
|
21
|
+
|
|
22
|
+
`KernelAgentMemoryBackend.recall()` also returns `sourceContext` on agent-facing items when a raw event can be resolved. `sourceContext` contains the raw event text, stable display labels, bounded before/after events, parent/child links, strict window metadata, optional source/character ranges, and a `sourceLocator` command:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cogmem memory show --event <eventId> --before 2 --after 2
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Agents should use `sourceContext` when the user asks what was specifically said, how a conclusion was explained, or what happened before/after a remembered point. If `canAnswerExactQuote=false`, the item is only a clue until the raw source event is inspected.
|
|
29
|
+
|
|
30
|
+
Every `sourceContext` event has a `label` suitable for prompt injection and cross-reference, usually derived from host message id metadata or the ledger `globalSeq`. When available, `charRange` gives the original source character range and `sourceRange` carries source offset, line range, and source character range. `sourceContext.window` states the requested before/after counts, actual counts, ordering (`chronological`), role filter (`all`), `excludesAnchor=true`, and overlap handling (`drop_from_after`). Agents should prefer these fields over guessing whether before/after includes the anchor.
|
|
31
|
+
|
|
32
|
+
When automatic prompt injection is missing or insufficient, agents can actively query the same governed path:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cogmem memory recall --query "<user question>" --project <project> --agent <agent> --json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This command returns `queryPlan`, `items`, `sourceAnchor`, and `sourceContext`. It is the preferred fallback before searching legacy host files.
|
|
39
|
+
|
|
40
|
+
Normal recall and agent-scoped explain-recall also return the same `decisionTrace` contract:
|
|
41
|
+
|
|
42
|
+
- `selectedLane`: `graph`, `compiled`, `brain_fallback`, `raw_ledger`, `mixed`, or `none`.
|
|
43
|
+
- `reason`: a stable selection reason such as `compiled_cue_match`, `raw_cue_match_preferred`, or `no_recall_evidence`.
|
|
44
|
+
- `candidateCounts`: bounded counts for graph, navigation, scoped navigation, brain fallback, and raw ledger lanes.
|
|
45
|
+
- `selectedCount`: the number of returned items.
|
|
46
|
+
|
|
47
|
+
OpenClaw renders this trace as one compact `recallDecision=` line inside the volatile recall block. It explains what Cogmem selected; it is not a user instruction or evidence. If the selected lane is `none`, inspect the query plan and run `cogmem explain-recall` before concluding that the memory does not exist.
|
|
48
|
+
|
|
49
|
+
OpenClaw automatic injection wraps full recall evidence in `<COGMEM_RECALL_CONTEXT>`. That block is current-turn-only background memory, not current user intent and not raw ledger history. The wrapper strips it before recording turns. If the prompt also contains `<COGMEM_TURN_BRIDGE>` or `<COGMEM_SESSION_STATE>`, treat those as compact session sidecars for continuity only; re-run recall or inspect `sourceLocator` before relying on detailed evidence.
|
|
50
|
+
|
|
51
|
+
For non-trivial recall, OpenClaw may prepend `<COGMEM_STRATEGY_CONTEXT>` before the recall block. This is a canonical current-turn retrieval policy, not evidence and not an instruction. It records the selected template, layer order, source policy, and budget. `cogmem_strategy_plan` exposes the same read-only capsule through MCP without performing recall. Normal MCP recall also returns `strategyCapsule`. If an exact-source strategy cannot find raw evidence, the bridge may make one narrowed retry; it must still report that source is unavailable rather than converting a summary into an exact quote.
|
|
52
|
+
|
|
53
|
+
`--collection <name>` scopes recall to a named collection. Default recall only includes untagged and `collection:anchor` memory. Use `--collection theseus` for creative artifacts or drafts that should not enter normal operational recall.
|
|
54
|
+
|
|
55
|
+
MCP `cogmem_recall` now uses this same agent-facing path. It returns `items` with `sourceType`, `sourceAnchor`, `sourceContext`, `canAnswerExactQuote`, and raw ledger fallback when governed compiled evidence is empty. If a host sends only `projectId`, MCP uses that value as `agentId` before falling back to `openclaw`. Hosts may also pass `collection`.
|
|
56
|
+
|
|
57
|
+
Hookless hosts must also inspect recall warning metadata. `no_recent_episode_ingestion_detected` means Cogmem has not observed recent conversation traffic; `semantic_memory_may_lag` means open/soft-sealed high-value episodes, Dream backlog/failures, or recent raw evidence have not completed semantic curation. These warnings do not erase returned evidence, but the agent must append/import the missing messages or disclose that semantic freshness is uncertain before claiming memory is current.
|
|
58
|
+
|
|
59
|
+
For past-memory queries such as `你还记得...`, a cue-matching raw user anchor outranks a compiled assistant retelling even when both contain the same topic words. The assistant retelling may remain as supporting evidence, but the original user event is first and retains its source locator.
|
|
60
|
+
|
|
61
|
+
MCP `cogmem_explain_recall` is the audit tool. Like normal MCP recall, it derives `agentId` from `projectId` when the caller omits `agentId`. It reports the same selected evidence IDs and `decisionTrace` as agent recall, plus pulse, temporal, activation, and `filteredEvidence` details from `explainRecallWithKernel()`; use it to inspect why evidence was included or suppressed, not as a separate competing recall implementation.
|
|
62
|
+
|
|
63
|
+
MCP `cogmem_memory_map` returns the memory self-map for agent/host inspection. MCP `cogmem_maintenance_tick` runs one explicit host-owned tick: activation decay plus suggested upkeep commands, with `hiddenDaemonStarted=false`.
|
|
64
|
+
|
|
65
|
+
## Agent Query Plans
|
|
66
|
+
|
|
67
|
+
`KernelAgentMemoryBackend.recall()` returns a `queryPlan` alongside agent-ready items. The plan records the original query, inferred/explicit intent, primary search text, bounded search cues, `semanticCuePhrases`, and `temporalHints` used for recall. This makes long questions auditable: an adapter can show that a sentence about "CogMem Memory Context 和记忆黑盒" was reduced to stable cues such as `CogMem Memory Context 记忆 黑盒`, `存档 黑盒`, or `黑盒` instead of being treated as one brittle raw string.
|
|
68
|
+
|
|
69
|
+
If FTS cannot directly match a Chinese or mixed-language cue, raw fallback searches the fully scoped ledger instead of a fixed recent-event window. Scope filters still apply. Equal cue matches prefer the original user event, while `sourceContext.after` preserves the assistant reply for causal continuity; later assistant retellings do not displace the original anchor merely because they are longer.
|
|
70
|
+
|
|
71
|
+
Forensic follow-ups can pass `anchorEventId` or `anchorText` from a previous recall item. The backend then prefers the anchored raw event for questions such as "what exactly did I say" instead of letting a vague query drift to unrelated imported summaries. Imported summaries and compiled memories still set `canAnswerExactQuote=false`; only raw source events with anchors can support exact wording.
|
|
72
|
+
|
|
73
|
+
When an adapter can consume structured pre-answer context, call `KernelAgentMemoryBackend.recallPack()`. It wraps the normal recall result and adds:
|
|
74
|
+
|
|
75
|
+
- `slots.direct`
|
|
76
|
+
- `slots.associative`
|
|
77
|
+
- `slots.entityCards`
|
|
78
|
+
- `slots.beliefTouches`
|
|
79
|
+
- `chargeVector`
|
|
80
|
+
|
|
81
|
+
These slots are bounded and governed. They are meant for agent prompt assembly and host scheduling, not for unbounded graph traversal.
|
|
82
|
+
|
|
83
|
+
## Dream Candidate Audit
|
|
84
|
+
|
|
85
|
+
`raw_then_dream` makes episode and Dream backlog state visible before semantic compilation happens. `cogmem episode status` shows conversation boundaries, `cogmem dream tick` conditionally processes sealed episodes, and `cogmem memory candidates` shows the resulting governance queue. Open episodes are not Dream input.
|
|
86
|
+
|
|
87
|
+
Each candidate includes:
|
|
88
|
+
|
|
89
|
+
- `candidateType`: summary, preferences, user_preference, project_memory, long_term_goal, boundary, failure_lesson, diagnostic_conclusion, session_summary, topic_summary, temporal_fact_update, conflict_candidate, semantic_tags, indexing_decision, semantic_relation, edge_adjustment, contradictions, causalLinks, or another governed category.
|
|
90
|
+
- `status`: usually `candidate` or `shadow` until a CPU governance policy reviews it.
|
|
91
|
+
- `confidence`: a bounded extraction confidence, not truth confidence.
|
|
92
|
+
- `content`: the proposed memory payload.
|
|
93
|
+
- `evidence`: raw event anchors with `eventId`, role, global/thread order, parent/previous links, and source text excerpts.
|
|
94
|
+
- `content.sourceEpisodeId`: the sealed conversation unit used for curation. It is an audit pointer, not evidence by itself.
|
|
95
|
+
|
|
96
|
+
Candidates explain organization, not truth. A preference candidate can show that the user explicitly said a constraint, but it is still queued for governance. A tool-result causal candidate can show that one tool result belongs to a tool call, but it must not become a verified real-world fact merely because the tool returned text.
|
|
97
|
+
|
|
98
|
+
An explicit user clarification may produce an organizational `correction` candidate. It does not automatically produce a contradiction or rewrite a belief. `CorrectionResolver` must bind it to an active same-project claim/belief; orphan or ambiguous corrections stay `needs_confirmation` with `orphan_correction_requires_target_review`. Assistant apologies/self-corrections and negative-form user questions are not sufficient user-owned correction evidence. A provider candidate must cite exact current episode event IDs; `["all"]`, unknown IDs, and fallback to unrelated leading events are rejected. Provider project labels cannot override CPU-owned project scope.
|
|
99
|
+
|
|
100
|
+
Semantic organization candidates are also advisory. `semantic_tags` and `indexing_decision` can make future recall less brittle than full-sentence matching, while `semantic_relation` and `edge_adjustment` can propose local graph activation changes. They do not rewrite existing memories or promote facts by themselves.
|
|
101
|
+
|
|
102
|
+
When `[memory_model]` is configured, the worker may call a local Ollama or cloud OpenAI-compatible memory model to propose richer candidates. The explainability contract is unchanged: model output must include source evidence, remains candidate-only, and cannot directly change active memory.
|
|
103
|
+
|
|
104
|
+
## Filtered Evidence
|
|
105
|
+
|
|
106
|
+
`filteredEvidence` records same-project candidates that were considered but did not enter active context. Reasons include:
|
|
107
|
+
|
|
108
|
+
- `status_suppressed`
|
|
109
|
+
- `over_context_limit`
|
|
110
|
+
- `agent_scope_mismatch`
|
|
111
|
+
- `collection_scope_mismatch`
|
|
112
|
+
|
|
113
|
+
When available, filtered evidence also carries `sourceAnchor` so forensic tools can explain where a suppressed candidate came from. Scoped explain results must stay same-project; cross-project filtered evidence must not be exposed.
|
|
114
|
+
|
|
115
|
+
## Ledger Vs Recall
|
|
116
|
+
|
|
117
|
+
Use chronological ledger APIs when the question is about original order:
|
|
118
|
+
|
|
119
|
+
- `getThreadEvents(threadId)`
|
|
120
|
+
- `getEventContext(eventId, { before, after })`
|
|
121
|
+
|
|
122
|
+
Use governed recall when the agent needs current task context:
|
|
123
|
+
|
|
124
|
+
- `KernelAgentMemoryBackend.recall()`
|
|
125
|
+
- `MemoryKernel.navigateMemory()`
|
|
126
|
+
- `explainRecallWithKernel()`
|
|
127
|
+
|
|
128
|
+
Use the local audit CLI when the user needs to inspect memory directly:
|
|
129
|
+
|
|
130
|
+
- `cogmem memory status`
|
|
131
|
+
- `cogmem memory list`
|
|
132
|
+
- `cogmem memory search --query <text>`
|
|
133
|
+
- `cogmem memory recall --query <text> --agent <agent>`
|
|
134
|
+
- `cogmem memory show --event <eventId> --before 2 --after 2`
|
|
135
|
+
- `cogmem episode status --project <project>`
|
|
136
|
+
- `cogmem dream tick --project <project> --mode auto`
|
|
137
|
+
- `cogmem memory candidates --project <project> --status candidate`
|
|
138
|
+
- `cogmem memory candidates --project <project> --status needs_confirmation`
|
|
139
|
+
- `cogmem memory review --project <project> --id <candidateId> --action <approve|reject|defer|supersede|relink> --actor <operator> --reason <reason>`
|
|
140
|
+
- `cogmem memory map --project <project> --json`
|
|
141
|
+
- `cogmem memory tick --project <project> --json`
|
|
142
|
+
|
|
143
|
+
Ledger replay can show raw evidence. It must not replace governed recall, pulse activation, inhibition, or ContextPack budgeting.
|
|
144
|
+
## Memory Atlas versus direct recall
|
|
145
|
+
|
|
146
|
+
Use Memory Atlas before direct recall when the user asks what is remembered, asks a broad project/history question, or needs relationships between multiple memory areas. Use direct recall for a concrete factual question. Atlas narrows the search space; it does not answer from summaries alone.
|
|
147
|
+
|
|
148
|
+
The expected sequence is `graphExplore` or `graphSearch`, then `graphNode`/`graphPath`/`graphTimeline`, then exact Raw Ledger drill-down. Atlas evidence includes `eventId` and a `cogmem memory show` command. Raw excerpts are omitted unless `includeEvidence=true`.
|
|
149
|
+
|
|
150
|
+
`coldMemoryResurrected=true` means query facets surfaced a low-activation node. It is a ranking explanation, not proof that the node is true or newly promoted. Inspect the node status, confidence, and raw source before making a claim.
|
|
151
|
+
|
|
152
|
+
Atlas query tools are read-only and do not change activation. If the agent actually uses a returned node, MCP `cogmem_graph_touch` records that selected-node use separately. Evidence output distinguishes the node's full `evidenceTotal` from the bounded `evidenceReturned` payload.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# cogmem 3.6.2 Release Checklist
|
|
2
|
+
|
|
3
|
+
This release is distributed through the npm registry. GitHub remains the source and review mirror.
|
|
4
|
+
|
|
5
|
+
## Required Metadata
|
|
6
|
+
|
|
7
|
+
- `package.json` name is `cogmem`.
|
|
8
|
+
- `package.json` version is `3.6.2`.
|
|
9
|
+
- `package.json` has `publishConfig.access = public`.
|
|
10
|
+
- Public export `.` points to `dist/public.js` and `dist/public.d.ts`.
|
|
11
|
+
- Internal subpath `./internal` exists only as an explicit advanced subpath.
|
|
12
|
+
- `install.sh` is tracked and installs `cogmem@latest` from npm by default.
|
|
13
|
+
- Local databases, SQLite sidecars, `.DS_Store`, and `dist/.tsbuildinfo` are not tracked.
|
|
14
|
+
|
|
15
|
+
## Required Binaries
|
|
16
|
+
|
|
17
|
+
- `cogmem`
|
|
18
|
+
- `cogmem init`
|
|
19
|
+
- `cogmem doctor`
|
|
20
|
+
- `cogmem connect`
|
|
21
|
+
- `cogmem update`
|
|
22
|
+
- `cogmem openclaw diagnose`
|
|
23
|
+
- `cogmem-compact`
|
|
24
|
+
- `cogmem memory`
|
|
25
|
+
- `cogmem repair`
|
|
26
|
+
- `cogmem explain-recall`
|
|
27
|
+
- `cogmem-mcp`
|
|
28
|
+
- `cogmem import-openclaw`
|
|
29
|
+
- `cogmem import-hermes`
|
|
30
|
+
- `cogmem normalize-transcript`
|
|
31
|
+
- `cogmem snapshot`
|
|
32
|
+
- `cogmem re-embed`
|
|
33
|
+
- `cogmem migrate-vectors`
|
|
34
|
+
- `cogmem migrate`
|
|
35
|
+
- `cogmem prospective`
|
|
36
|
+
- `cogmem strategy`
|
|
37
|
+
- `cogmem brain-eval`
|
|
38
|
+
- `cogmem episode`
|
|
39
|
+
- `cogmem dream`
|
|
40
|
+
|
|
41
|
+
MCP `tools/list` includes strategy, episode append/import/status/seal/repair, topic list/operate/rollback, candidate review, conditional Dream tick/status, prospective tools, all seven read-only Memory Atlas queries, and explicit `cogmem_graph_touch`. Atlas queries declare read-only/idempotent semantics and never change activation; only touch records selected-node use. Episode append/import never run Dream. MCP Dream tick requires `maintenanceMode: true` to process work; otherwise it is recommendation-only.
|
|
42
|
+
|
|
43
|
+
## Required Documentation
|
|
44
|
+
|
|
45
|
+
- README explains the vision, architecture, limits, and one-line install command.
|
|
46
|
+
- README says this is a single-agent memory kernel, not an agent team shared brain.
|
|
47
|
+
- README distinguishes embedding models from Dream Curator memory-model LLMs.
|
|
48
|
+
- README and integration docs explain labeled `sourceContext`, strict before/after window metadata, `charRange` / `sourceRange`, and OpenClaw `sourceWindow` / `sourceTruncation` injection.
|
|
49
|
+
- README and skills explain collection routing, `cogmem memory map`, and `cogmem memory tick` as host-owned inspection and maintenance surfaces.
|
|
50
|
+
- README and skills explain `decisionTrace` / `recallDecision`, source-first raw fallback, correction semantics, audited review actions, and review-queue aging.
|
|
51
|
+
- README and skills explain `cogmem update --yes`, npm install resolution, automatic backed-up migration, automatic OpenClaw plugin-only refresh when configured, migration dry-run, backups, and that Raw Ledger evidence is never rewritten by schema migration.
|
|
52
|
+
- README and skills explain that entity aliases are evidence-backed, project-scoped, reversible, and stricter for person entities.
|
|
53
|
+
- README and skills explain Belief Graph ownership, user-evidence requirements, reinforcement, conflict review, and supersession history.
|
|
54
|
+
- README and skills explain Temporal Memory validity windows, historical lookup, correction reasons, and current-state stale suppression.
|
|
55
|
+
- README and skills explain Context Cortex intent suppression, 25% default/30% maximum budget, source drill-down, and activation receipts.
|
|
56
|
+
- README and skills explain that Prospective Memory is confirmed-only state with no task execution capability, and how to use BrainEval as a release gate.
|
|
57
|
+
- README and skills explain Strategy Cortex templates, no-instruction-authority lifecycle, one-retry replanning, strategy-conditioned retrieval, offline-only rollout comparison, and read-only MemoryUseJudge telemetry.
|
|
58
|
+
- README and skills explain Raw Ledger-first episode assembly, soft/hard sealing, explicit conditional Dream ticks, raw-event evidence grounding, repair/retry, and hookless Hermes MCP/import usage.
|
|
59
|
+
- README and skills explain CPU foreground versus hybrid background classification, contextual short replies, registry-aware topic boundaries, safe reopen, semantic-summary non-evidence status, per-job Dream modes/failures, stable import identity, and schema migration 24.
|
|
60
|
+
- README and skills explain user-shaped topic operations, user-explicit versus model-candidate authority, alias collision review, operation rollback, and project isolation.
|
|
61
|
+
- README, `MEMORY_ATLAS.md`, and skills distinguish the system anatomy map from the content Atlas; explain graph overview/search/explore/node/neighbors/path/timeline, generic multi-facet cold-memory resurrection, activation visibility, source drill-down, and project isolation.
|
|
62
|
+
- README documents `cogmem.cli.v1`: object payloads are top-level, array payloads use `items`, and queue counters expose top-level compatibility aliases.
|
|
63
|
+
- README documents the one-line schema-24/schema-26/pre-release schema-25 to schema-27 migration with backup, and migration tests prove source counts are preserved, Atlas projection is dirty after upgrade, and reruns are idempotent.
|
|
64
|
+
- README and OpenClaw skill document plugin-only repair, plugin/audit diagnose, stale graph reads, and conservative empty-project project-scope repair for 3.5.2 -> 3.6.x upgrades.
|
|
65
|
+
- README and skills explain episode surgery, closure recomputation, stale-candidate invalidation, cross-reference/audit preservation, and sealed-only Dream requeue.
|
|
66
|
+
- README and Hermes skill explain per-message import checkpoints, stable `externalMessageId` requirements across split batches, source-agent validation, CLI range/error controls, and hookless recall freshness warnings.
|
|
67
|
+
- OpenClaw installation includes `SKILL.md` plus the complete `references/operations.md` command handbook covering migration, import, review, Atlas, repair, backup, and maintenance.
|
|
68
|
+
- Hermes installation includes the same complete handbook, MCP wiring, `connect hermes --auto`, and `/reload-mcp`.
|
|
69
|
+
- OpenClaw skill explains the direct plugin Atlas route without MCP; Hermes skill explains graph-first MCP tool selection and exact evidence drill-down.
|
|
70
|
+
- BrainEval fixtures cover Atlas scope isolation, traversal bounds, evidence locators, path reconstruction, faceted resurrection, and canonical-source immutability.
|
|
71
|
+
- Concurrency fixtures prove read-only inspection while another connection is open; Atlas fixtures prove pure reads, explicit touch, dirty-only rebuild, error state, retention, weighted path, and exact facet composition.
|
|
72
|
+
- SECURITY documents local-first storage, explicit external providers, snapshots as sensitive, and governed recall.
|
|
73
|
+
|
|
74
|
+
## Verification
|
|
75
|
+
|
|
76
|
+
Run from the repository root:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
bun run typecheck
|
|
80
|
+
bun run build
|
|
81
|
+
bun test
|
|
82
|
+
npm pack --dry-run --json
|
|
83
|
+
npm publish --dry-run --access public
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The pack dry-run must include built public API files, CLI files, examples, docs, and `install.sh`. It must not include local databases or machine-specific files.
|
|
87
|
+
|
|
88
|
+
After verification, publish with:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm publish --access public
|
|
92
|
+
```
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
`cogmem` is local-first by default. Memory data is stored in the configured SQLite database path.
|
|
4
|
+
|
|
5
|
+
## Data Handling
|
|
6
|
+
|
|
7
|
+
- Core does not require a hosted storage service.
|
|
8
|
+
- TOML is the only kernel configuration entrypoint. Security and governance settings live in `config.toml`; environment variables are only interpolated when explicitly referenced in that file.
|
|
9
|
+
- PII redaction is configured under `[governance]` with `pii_redact_email`, `pii_redact_phone`, and `pii_redact_ssn`.
|
|
10
|
+
- Field encryption is available by passing an `EncryptionProvider` when creating the kernel.
|
|
11
|
+
- Embedding providers may send text to the provider explicitly configured in `config.toml`.
|
|
12
|
+
- Snapshot files should be treated as sensitive because they contain exported memory data.
|
|
13
|
+
- Imports and migrations should be run with dry-run first when moving existing agent memory into core.
|
|
14
|
+
- Raw chronological ledger events are written through the kernel so configured PII redaction runs before persistence. Encrypted deployments still treat ledger payloads as sensitive.
|
|
15
|
+
- Agent-facing recall is governed by default: archived memory, suspect LLM inference, suspect tool observations, and suspect unverified claims are suppressed from active context.
|
|
16
|
+
- Raw user utterances can be recalled as provenance evidence when explicitly tagged as raw user evidence; this does not promote them into verified facts.
|
|
17
|
+
- Recall explanations expose same-project `filteredEvidence` with `reason` and optional `governanceReason`. Scoped explanations must not expose filtered evidence from other projects.
|
|
18
|
+
|
|
19
|
+
## Reporting
|
|
20
|
+
|
|
21
|
+
Report vulnerabilities privately through the repository security advisory flow. Do not open public issues for exploitable security bugs.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { computeStableHash } from './types.js';
|
|
3
|
+
export class MarkdownSourceLoader {
|
|
4
|
+
read(source) {
|
|
5
|
+
const stat = statSync(source.sourcePath);
|
|
6
|
+
const content = source.adapterKind === 'hermes_state_db' ? '' : readFileSync(source.sourcePath, 'utf8');
|
|
7
|
+
return {
|
|
8
|
+
sourceId: source.sourceId,
|
|
9
|
+
adapterKind: source.adapterKind,
|
|
10
|
+
sourcePath: source.sourcePath,
|
|
11
|
+
projectId: source.projectId,
|
|
12
|
+
fileHash: computeStableHash([source.sourcePath, stat.mtimeMs, stat.size, content]),
|
|
13
|
+
fileMtimeMs: stat.mtimeMs,
|
|
14
|
+
fileSize: stat.size,
|
|
15
|
+
readAt: Date.now(),
|
|
16
|
+
content
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AdaptedSource, AdapterWindow, SourceAdapter, SourceDefinition, SourceFileSnapshot } from '../types.js';
|
|
2
|
+
export declare class ConversationMarkdownAdapter implements SourceAdapter {
|
|
3
|
+
readonly kind: "conversation_markdown";
|
|
4
|
+
private readonly adapterVersion;
|
|
5
|
+
adapt(source: SourceDefinition, snapshot: SourceFileSnapshot, window?: AdapterWindow): AdaptedSource;
|
|
6
|
+
private parseMessages;
|
|
7
|
+
private buildRecords;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ConversationMarkdownAdapter.d.ts.map
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { computeStableHash, inferSourceTitle, normalizeMarkdownText, parseLooseDateHeading, parseMarkdownRoleLine, resolveTimestampWithContext } from '../types.js';
|
|
2
|
+
export class ConversationMarkdownAdapter {
|
|
3
|
+
kind = 'conversation_markdown';
|
|
4
|
+
adapterVersion = 'conversation-markdown-v2';
|
|
5
|
+
adapt(source, snapshot, window) {
|
|
6
|
+
const normalized = normalizeMarkdownText(snapshot.content);
|
|
7
|
+
const lines = normalized.split('\n');
|
|
8
|
+
const diagnostics = [];
|
|
9
|
+
const messages = this.parseMessages(lines, snapshot.fileMtimeMs, source.sourcePath, diagnostics);
|
|
10
|
+
const filteredMessages = messages.filter((message) => !window || (message.timestamp >= window.start && message.timestamp < window.end));
|
|
11
|
+
const records = this.buildRecords(source, snapshot, filteredMessages);
|
|
12
|
+
return {
|
|
13
|
+
source,
|
|
14
|
+
snapshot: {
|
|
15
|
+
sourceId: snapshot.sourceId,
|
|
16
|
+
adapterKind: snapshot.adapterKind,
|
|
17
|
+
sourcePath: snapshot.sourcePath,
|
|
18
|
+
projectId: snapshot.projectId,
|
|
19
|
+
fileHash: snapshot.fileHash,
|
|
20
|
+
fileMtimeMs: snapshot.fileMtimeMs,
|
|
21
|
+
fileSize: snapshot.fileSize,
|
|
22
|
+
readAt: snapshot.readAt
|
|
23
|
+
},
|
|
24
|
+
records,
|
|
25
|
+
diagnostics
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
parseMessages(lines, fallbackTime, sourcePath, diagnostics) {
|
|
29
|
+
const messages = [];
|
|
30
|
+
let current = null;
|
|
31
|
+
let currentDateHint;
|
|
32
|
+
let currentSessionStartedAt;
|
|
33
|
+
let pendingSourceRef;
|
|
34
|
+
let ignoredPrelude = 0;
|
|
35
|
+
let collapsedAdjacentDuplicates = 0;
|
|
36
|
+
const flush = () => {
|
|
37
|
+
if (!current)
|
|
38
|
+
return;
|
|
39
|
+
const text = current.text.trim();
|
|
40
|
+
if (text) {
|
|
41
|
+
const lineSpan = Math.max(1, text.split('\n').length);
|
|
42
|
+
const message = { ...current, text, lineEnd: current.lineNumber + lineSpan - 1 };
|
|
43
|
+
const previous = messages[messages.length - 1];
|
|
44
|
+
if (previous && previous.role === message.role && previous.text === message.text) {
|
|
45
|
+
collapsedAdjacentDuplicates += 1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
messages.push(message);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
current = null;
|
|
52
|
+
};
|
|
53
|
+
lines.forEach((line, index) => {
|
|
54
|
+
const sourceRefMarker = parseSourceRefMarker(line);
|
|
55
|
+
if (sourceRefMarker) {
|
|
56
|
+
pendingSourceRef = sourceRefMarker;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (/^<!--\s*cogmem-[a-z0-9_-]+:/i.test(line.trim()) || /^<!--\s*cogmem-normalized\s*:/i.test(line.trim())) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const sessionStartedAt = parseSessionStartedAt(line);
|
|
63
|
+
if (sessionStartedAt !== undefined) {
|
|
64
|
+
currentSessionStartedAt = sessionStartedAt;
|
|
65
|
+
currentDateHint = new Date(sessionStartedAt).toISOString().slice(0, 10);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const dateHeading = parseLooseDateHeading(line);
|
|
69
|
+
if (dateHeading) {
|
|
70
|
+
currentDateHint = dateHeading;
|
|
71
|
+
currentSessionStartedAt = undefined;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const parsed = parseMarkdownRoleLine(line);
|
|
75
|
+
if (parsed) {
|
|
76
|
+
flush();
|
|
77
|
+
current = {
|
|
78
|
+
role: parsed.role,
|
|
79
|
+
text: parsed.text,
|
|
80
|
+
timestamp: parsed.timestamp
|
|
81
|
+
? resolveTimestampWithContext(parsed.timestamp, fallbackTime + index, currentDateHint)
|
|
82
|
+
: (currentSessionStartedAt ?? fallbackTime) + index,
|
|
83
|
+
lineNumber: index + 1,
|
|
84
|
+
lineEnd: index + 1,
|
|
85
|
+
sourceRef: pendingSourceRef,
|
|
86
|
+
};
|
|
87
|
+
pendingSourceRef = undefined;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (!current) {
|
|
91
|
+
if (line.trim())
|
|
92
|
+
ignoredPrelude += 1;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
current.text += `${current.text ? '\n' : ''}${line.trimEnd()}`;
|
|
96
|
+
});
|
|
97
|
+
flush();
|
|
98
|
+
if (collapsedAdjacentDuplicates > 0) {
|
|
99
|
+
diagnostics.push({
|
|
100
|
+
severity: 'warning',
|
|
101
|
+
code: 'conversation_adjacent_duplicate_collapsed',
|
|
102
|
+
message: `Collapsed ${collapsedAdjacentDuplicates} adjacent exact duplicate message(s).`,
|
|
103
|
+
filePath: sourcePath,
|
|
104
|
+
adapterKind: this.kind,
|
|
105
|
+
contractHint: 'Adjacent messages with the same role and identical normalized text are treated as export duplicates.',
|
|
106
|
+
fallbackHint: 'Non-adjacent repeated messages remain separate chronological evidence.',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (messages.length === 0 && lines.some((line) => line.trim())) {
|
|
110
|
+
diagnostics.push({
|
|
111
|
+
severity: 'error',
|
|
112
|
+
code: 'conversation_contract_mismatch',
|
|
113
|
+
message: 'No parseable conversation messages were found.',
|
|
114
|
+
filePath: sourcePath,
|
|
115
|
+
adapterKind: this.kind,
|
|
116
|
+
contractHint: 'Expected role-prefixed transcript lines such as "user:", "Human:", "Q:", "AI:", or "assistant:".',
|
|
117
|
+
fallbackHint: 'Use repeated --conversation only for transcript-style files, or minimally normalize the markdown into role-prefixed lines before ingestion.'
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else if (ignoredPrelude > 0) {
|
|
121
|
+
diagnostics.push({
|
|
122
|
+
severity: 'warning',
|
|
123
|
+
code: 'conversation_partial_prelude_ignored',
|
|
124
|
+
message: `Ignored ${ignoredPrelude} non-message line(s) before the first parseable transcript turn.`,
|
|
125
|
+
filePath: sourcePath,
|
|
126
|
+
adapterKind: this.kind,
|
|
127
|
+
contractHint: 'Intro headings and date headers are tolerated, but only role-prefixed transcript lines become episodic records.',
|
|
128
|
+
fallbackHint: 'If important turns live outside the transcript shape, move them into explicit role-prefixed lines or ingest the file through --soul instead.'
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return messages;
|
|
132
|
+
}
|
|
133
|
+
buildRecords(source, snapshot, messages) {
|
|
134
|
+
const sourceTitle = inferSourceTitle(source.sourcePath);
|
|
135
|
+
const records = [];
|
|
136
|
+
let turnCursor = 0;
|
|
137
|
+
let openTurnId;
|
|
138
|
+
let lastRole;
|
|
139
|
+
let eventOrdinal = 0;
|
|
140
|
+
for (const message of messages) {
|
|
141
|
+
if (!openTurnId || message.role === 'user' || (lastRole === 'agent' && message.role !== 'agent')) {
|
|
142
|
+
turnCursor += 1;
|
|
143
|
+
eventOrdinal = 0;
|
|
144
|
+
openTurnId = computeStableHash([source.sourceId, snapshot.fileHash, 'turn', turnCursor]);
|
|
145
|
+
}
|
|
146
|
+
eventOrdinal += 1;
|
|
147
|
+
const sourceOffset = message.sourceRef?.sourceOffset ?? records.length + 1;
|
|
148
|
+
const lineStart = message.sourceRef?.lineStart ?? message.lineNumber;
|
|
149
|
+
const lineEnd = message.sourceRef?.lineEnd ?? message.lineEnd;
|
|
150
|
+
const orderingConfidence = message.sourceRef?.orderingConfidence ?? 'high';
|
|
151
|
+
const recordHash = computeStableHash([
|
|
152
|
+
source.sourceId,
|
|
153
|
+
message.role,
|
|
154
|
+
message.timestamp,
|
|
155
|
+
message.text
|
|
156
|
+
]);
|
|
157
|
+
records.push({
|
|
158
|
+
recordId: `srcmsg-${recordHash.slice(0, 16)}`,
|
|
159
|
+
turnId: openTurnId,
|
|
160
|
+
kind: 'conversation_message',
|
|
161
|
+
role: message.role,
|
|
162
|
+
text: message.text,
|
|
163
|
+
timestamp: message.timestamp,
|
|
164
|
+
tags: [sourceTitle, 'conversation'],
|
|
165
|
+
confidenceHint: 0.92,
|
|
166
|
+
sourceTypeHint: message.role === 'agent' ? 'llm_inference' : 'user_input',
|
|
167
|
+
metadata: {
|
|
168
|
+
lineNumber: message.lineNumber,
|
|
169
|
+
lineStart,
|
|
170
|
+
lineEnd,
|
|
171
|
+
charStart: message.sourceRef?.charStart,
|
|
172
|
+
charEnd: message.sourceRef?.charEnd,
|
|
173
|
+
sourceOffset,
|
|
174
|
+
turnIndex: turnCursor,
|
|
175
|
+
turnSeq: turnCursor,
|
|
176
|
+
eventOrdinal,
|
|
177
|
+
orderingConfidence
|
|
178
|
+
},
|
|
179
|
+
provenance: {
|
|
180
|
+
sourceId: source.sourceId,
|
|
181
|
+
sourcePath: source.sourcePath,
|
|
182
|
+
sourceType: this.kind,
|
|
183
|
+
adapterVersion: this.adapterVersion,
|
|
184
|
+
fileHash: snapshot.fileHash,
|
|
185
|
+
fileMtimeMs: snapshot.fileMtimeMs,
|
|
186
|
+
recordHash,
|
|
187
|
+
reliabilityClass: 'raw_utterance',
|
|
188
|
+
lineStart,
|
|
189
|
+
lineEnd,
|
|
190
|
+
charStart: message.sourceRef?.charStart,
|
|
191
|
+
charEnd: message.sourceRef?.charEnd,
|
|
192
|
+
sourceOffset,
|
|
193
|
+
orderingConfidence
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
lastRole = message.role;
|
|
197
|
+
}
|
|
198
|
+
return records;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function parseSessionStartedAt(line) {
|
|
202
|
+
const heading = line.trim().replace(/^#{1,6}\s*/, '');
|
|
203
|
+
const match = heading.match(/^Session\s*:\s*(.+)$/i);
|
|
204
|
+
if (!match?.[1])
|
|
205
|
+
return undefined;
|
|
206
|
+
const parsed = Date.parse(match[1].trim());
|
|
207
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
208
|
+
}
|
|
209
|
+
function parseSourceRefMarker(line) {
|
|
210
|
+
const match = line.trim().match(/^<!--\s*(?:cogmem|agent-brain)-source-ref:\s*([^]+?)\s*-->$/i);
|
|
211
|
+
if (!match?.[1])
|
|
212
|
+
return undefined;
|
|
213
|
+
try {
|
|
214
|
+
const parsed = JSON.parse(match[1].replace(/-->/g, '-->'));
|
|
215
|
+
return {
|
|
216
|
+
sourceOffset: numberField(parsed.sourceOffset),
|
|
217
|
+
lineStart: numberField(parsed.lineStart),
|
|
218
|
+
lineEnd: numberField(parsed.lineEnd),
|
|
219
|
+
charStart: numberField(parsed.charStart),
|
|
220
|
+
charEnd: numberField(parsed.charEnd),
|
|
221
|
+
orderingConfidence: orderingConfidenceField(parsed.orderingConfidence),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
return undefined;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function numberField(value) {
|
|
229
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
230
|
+
}
|
|
231
|
+
function orderingConfidenceField(value) {
|
|
232
|
+
return value === 'high' || value === 'medium' || value === 'low' ? value : undefined;
|
|
233
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AdaptedSource, AdapterWindow, SourceAdapter, SourceDefinition, SourceFileSnapshot } from '../types.js';
|
|
2
|
+
export declare class HermesStateDbAdapter implements SourceAdapter {
|
|
3
|
+
readonly kind: "hermes_state_db";
|
|
4
|
+
private readonly adapterVersion;
|
|
5
|
+
adapt(source: SourceDefinition, snapshot: SourceFileSnapshot, window?: AdapterWindow): AdaptedSource;
|
|
6
|
+
private toRecord;
|
|
7
|
+
private result;
|
|
8
|
+
private diagnostic;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=HermesStateDbAdapter.d.ts.map
|