alma-memory 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

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.
Files changed (111) hide show
  1. alma/__init__.py +296 -194
  2. alma/compression/__init__.py +33 -0
  3. alma/compression/pipeline.py +980 -0
  4. alma/confidence/__init__.py +47 -47
  5. alma/confidence/engine.py +540 -540
  6. alma/confidence/types.py +351 -351
  7. alma/config/loader.py +157 -157
  8. alma/consolidation/__init__.py +23 -23
  9. alma/consolidation/engine.py +678 -678
  10. alma/consolidation/prompts.py +84 -84
  11. alma/core.py +1189 -322
  12. alma/domains/__init__.py +30 -30
  13. alma/domains/factory.py +359 -359
  14. alma/domains/schemas.py +448 -448
  15. alma/domains/types.py +272 -272
  16. alma/events/__init__.py +75 -75
  17. alma/events/emitter.py +285 -284
  18. alma/events/storage_mixin.py +246 -246
  19. alma/events/types.py +126 -126
  20. alma/events/webhook.py +425 -425
  21. alma/exceptions.py +49 -49
  22. alma/extraction/__init__.py +31 -31
  23. alma/extraction/auto_learner.py +265 -264
  24. alma/extraction/extractor.py +420 -420
  25. alma/graph/__init__.py +106 -81
  26. alma/graph/backends/__init__.py +32 -18
  27. alma/graph/backends/kuzu.py +624 -0
  28. alma/graph/backends/memgraph.py +432 -0
  29. alma/graph/backends/memory.py +236 -236
  30. alma/graph/backends/neo4j.py +417 -417
  31. alma/graph/base.py +159 -159
  32. alma/graph/extraction.py +198 -198
  33. alma/graph/store.py +860 -860
  34. alma/harness/__init__.py +35 -35
  35. alma/harness/base.py +386 -386
  36. alma/harness/domains.py +705 -705
  37. alma/initializer/__init__.py +37 -37
  38. alma/initializer/initializer.py +418 -418
  39. alma/initializer/types.py +250 -250
  40. alma/integration/__init__.py +62 -62
  41. alma/integration/claude_agents.py +444 -432
  42. alma/integration/helena.py +423 -423
  43. alma/integration/victor.py +471 -471
  44. alma/learning/__init__.py +101 -86
  45. alma/learning/decay.py +878 -0
  46. alma/learning/forgetting.py +1446 -1446
  47. alma/learning/heuristic_extractor.py +390 -390
  48. alma/learning/protocols.py +374 -374
  49. alma/learning/validation.py +346 -346
  50. alma/mcp/__init__.py +123 -45
  51. alma/mcp/__main__.py +156 -156
  52. alma/mcp/resources.py +122 -122
  53. alma/mcp/server.py +955 -591
  54. alma/mcp/tools.py +3254 -511
  55. alma/observability/__init__.py +91 -0
  56. alma/observability/config.py +302 -0
  57. alma/observability/guidelines.py +170 -0
  58. alma/observability/logging.py +424 -0
  59. alma/observability/metrics.py +583 -0
  60. alma/observability/tracing.py +440 -0
  61. alma/progress/__init__.py +21 -21
  62. alma/progress/tracker.py +607 -607
  63. alma/progress/types.py +250 -250
  64. alma/retrieval/__init__.py +134 -53
  65. alma/retrieval/budget.py +525 -0
  66. alma/retrieval/cache.py +1304 -1061
  67. alma/retrieval/embeddings.py +202 -202
  68. alma/retrieval/engine.py +850 -366
  69. alma/retrieval/modes.py +365 -0
  70. alma/retrieval/progressive.py +560 -0
  71. alma/retrieval/scoring.py +344 -344
  72. alma/retrieval/trust_scoring.py +637 -0
  73. alma/retrieval/verification.py +797 -0
  74. alma/session/__init__.py +19 -19
  75. alma/session/manager.py +442 -399
  76. alma/session/types.py +288 -288
  77. alma/storage/__init__.py +101 -61
  78. alma/storage/archive.py +233 -0
  79. alma/storage/azure_cosmos.py +1259 -1048
  80. alma/storage/base.py +1083 -525
  81. alma/storage/chroma.py +1443 -1443
  82. alma/storage/constants.py +103 -0
  83. alma/storage/file_based.py +614 -619
  84. alma/storage/migrations/__init__.py +21 -0
  85. alma/storage/migrations/base.py +321 -0
  86. alma/storage/migrations/runner.py +323 -0
  87. alma/storage/migrations/version_stores.py +337 -0
  88. alma/storage/migrations/versions/__init__.py +11 -0
  89. alma/storage/migrations/versions/v1_0_0.py +373 -0
  90. alma/storage/migrations/versions/v1_1_0_workflow_context.py +551 -0
  91. alma/storage/pinecone.py +1080 -1080
  92. alma/storage/postgresql.py +1948 -1452
  93. alma/storage/qdrant.py +1306 -1306
  94. alma/storage/sqlite_local.py +3041 -1358
  95. alma/testing/__init__.py +46 -0
  96. alma/testing/factories.py +301 -0
  97. alma/testing/mocks.py +389 -0
  98. alma/types.py +292 -264
  99. alma/utils/__init__.py +19 -0
  100. alma/utils/tokenizer.py +521 -0
  101. alma/workflow/__init__.py +83 -0
  102. alma/workflow/artifacts.py +170 -0
  103. alma/workflow/checkpoint.py +311 -0
  104. alma/workflow/context.py +228 -0
  105. alma/workflow/outcomes.py +189 -0
  106. alma/workflow/reducers.py +393 -0
  107. {alma_memory-0.5.0.dist-info → alma_memory-0.7.0.dist-info}/METADATA +244 -72
  108. alma_memory-0.7.0.dist-info/RECORD +112 -0
  109. alma_memory-0.5.0.dist-info/RECORD +0 -76
  110. {alma_memory-0.5.0.dist-info → alma_memory-0.7.0.dist-info}/WHEEL +0 -0
  111. {alma_memory-0.5.0.dist-info → alma_memory-0.7.0.dist-info}/top_level.txt +0 -0
alma/learning/__init__.py CHANGED
@@ -1,86 +1,101 @@
1
- """
2
- ALMA Learning Protocols.
3
-
4
- Provides learning, validation, forgetting, and heuristic extraction.
5
- """
6
-
7
- from alma.learning.forgetting import (
8
- CleanupJob,
9
- CleanupResult,
10
- # Cleanup Scheduling
11
- CleanupScheduler,
12
- # Confidence Decay
13
- ConfidenceDecayer,
14
- # Decay Functions
15
- DecayFunction,
16
- DecayResult,
17
- ExponentialDecay,
18
- # Forgetting Engine
19
- ForgettingEngine,
20
- HealthAlert,
21
- HealthThresholds,
22
- LinearDecay,
23
- MemoryHealthMetrics,
24
- # Memory Health Monitoring
25
- MemoryHealthMonitor,
26
- NoDecay,
27
- PrunePolicy,
28
- PruneReason,
29
- PruneResult,
30
- PruneSummary,
31
- StepDecay,
32
- )
33
- from alma.learning.heuristic_extractor import (
34
- ExtractionResult,
35
- HeuristicExtractor,
36
- PatternCandidate,
37
- extract_heuristics_from_outcome,
38
- )
39
- from alma.learning.protocols import LearningProtocol
40
- from alma.learning.validation import (
41
- ScopeValidator,
42
- TaskTypeValidator,
43
- ValidationReport,
44
- ValidationResult,
45
- validate_learning_request,
46
- )
47
-
48
- __all__ = [
49
- # Core Protocol
50
- "LearningProtocol",
51
- # Validation
52
- "ScopeValidator",
53
- "ValidationResult",
54
- "ValidationReport",
55
- "TaskTypeValidator",
56
- "validate_learning_request",
57
- # Forgetting Engine
58
- "ForgettingEngine",
59
- "PrunePolicy",
60
- "PruneResult",
61
- "PruneSummary",
62
- "PruneReason",
63
- # Decay Functions
64
- "DecayFunction",
65
- "ExponentialDecay",
66
- "LinearDecay",
67
- "StepDecay",
68
- "NoDecay",
69
- # Confidence Decay
70
- "ConfidenceDecayer",
71
- "DecayResult",
72
- # Memory Health Monitoring
73
- "MemoryHealthMonitor",
74
- "MemoryHealthMetrics",
75
- "HealthAlert",
76
- "HealthThresholds",
77
- # Cleanup Scheduling
78
- "CleanupScheduler",
79
- "CleanupJob",
80
- "CleanupResult",
81
- # Heuristic Extraction
82
- "HeuristicExtractor",
83
- "PatternCandidate",
84
- "ExtractionResult",
85
- "extract_heuristics_from_outcome",
86
- ]
1
+ """
2
+ ALMA Learning Protocols.
3
+
4
+ Provides learning, validation, forgetting, and heuristic extraction.
5
+ """
6
+
7
+ from alma.learning.decay import (
8
+ DecayConfig,
9
+ DecayManager,
10
+ MemoryStrength,
11
+ StrengthState,
12
+ calculate_projected_strength,
13
+ days_until_threshold,
14
+ )
15
+ from alma.learning.forgetting import (
16
+ CleanupJob,
17
+ CleanupResult,
18
+ # Cleanup Scheduling
19
+ CleanupScheduler,
20
+ # Confidence Decay
21
+ ConfidenceDecayer,
22
+ # Decay Functions
23
+ DecayFunction,
24
+ DecayResult,
25
+ ExponentialDecay,
26
+ # Forgetting Engine
27
+ ForgettingEngine,
28
+ HealthAlert,
29
+ HealthThresholds,
30
+ LinearDecay,
31
+ MemoryHealthMetrics,
32
+ # Memory Health Monitoring
33
+ MemoryHealthMonitor,
34
+ NoDecay,
35
+ PrunePolicy,
36
+ PruneReason,
37
+ PruneResult,
38
+ PruneSummary,
39
+ StepDecay,
40
+ )
41
+ from alma.learning.heuristic_extractor import (
42
+ ExtractionResult,
43
+ HeuristicExtractor,
44
+ PatternCandidate,
45
+ extract_heuristics_from_outcome,
46
+ )
47
+ from alma.learning.protocols import LearningProtocol
48
+ from alma.learning.validation import (
49
+ ScopeValidator,
50
+ TaskTypeValidator,
51
+ ValidationReport,
52
+ ValidationResult,
53
+ validate_learning_request,
54
+ )
55
+
56
+ __all__ = [
57
+ # Core Protocol
58
+ "LearningProtocol",
59
+ # Validation
60
+ "ScopeValidator",
61
+ "ValidationResult",
62
+ "ValidationReport",
63
+ "TaskTypeValidator",
64
+ "validate_learning_request",
65
+ # Forgetting Engine
66
+ "ForgettingEngine",
67
+ "PrunePolicy",
68
+ "PruneResult",
69
+ "PruneSummary",
70
+ "PruneReason",
71
+ # Decay Functions
72
+ "DecayFunction",
73
+ "ExponentialDecay",
74
+ "LinearDecay",
75
+ "StepDecay",
76
+ "NoDecay",
77
+ # Confidence Decay
78
+ "ConfidenceDecayer",
79
+ "DecayResult",
80
+ # Memory Strength Decay (v0.7.0)
81
+ "MemoryStrength",
82
+ "StrengthState",
83
+ "DecayConfig",
84
+ "DecayManager",
85
+ "calculate_projected_strength",
86
+ "days_until_threshold",
87
+ # Memory Health Monitoring
88
+ "MemoryHealthMonitor",
89
+ "MemoryHealthMetrics",
90
+ "HealthAlert",
91
+ "HealthThresholds",
92
+ # Cleanup Scheduling
93
+ "CleanupScheduler",
94
+ "CleanupJob",
95
+ "CleanupResult",
96
+ # Heuristic Extraction
97
+ "HeuristicExtractor",
98
+ "PatternCandidate",
99
+ "ExtractionResult",
100
+ "extract_heuristics_from_outcome",
101
+ ]