alma-memory 0.5.1__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 -226
  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 -430
  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 -265
  24. alma/extraction/extractor.py +420 -420
  25. alma/graph/__init__.py +106 -106
  26. alma/graph/backends/__init__.py +32 -32
  27. alma/graph/backends/kuzu.py +624 -624
  28. alma/graph/backends/memgraph.py +432 -432
  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 -444
  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 -509
  55. alma/observability/__init__.py +91 -84
  56. alma/observability/config.py +302 -302
  57. alma/observability/guidelines.py +170 -0
  58. alma/observability/logging.py +424 -424
  59. alma/observability/metrics.py +583 -583
  60. alma/observability/tracing.py +440 -440
  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 -427
  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 -90
  78. alma/storage/archive.py +233 -0
  79. alma/storage/azure_cosmos.py +1259 -1259
  80. alma/storage/base.py +1083 -583
  81. alma/storage/chroma.py +1443 -1443
  82. alma/storage/constants.py +103 -103
  83. alma/storage/file_based.py +614 -614
  84. alma/storage/migrations/__init__.py +21 -21
  85. alma/storage/migrations/base.py +321 -321
  86. alma/storage/migrations/runner.py +323 -323
  87. alma/storage/migrations/version_stores.py +337 -337
  88. alma/storage/migrations/versions/__init__.py +11 -11
  89. alma/storage/migrations/versions/v1_0_0.py +373 -373
  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 -1559
  93. alma/storage/qdrant.py +1306 -1306
  94. alma/storage/sqlite_local.py +3041 -1457
  95. alma/testing/__init__.py +46 -46
  96. alma/testing/factories.py +301 -301
  97. alma/testing/mocks.py +389 -389
  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.1.dist-info → alma_memory-0.7.0.dist-info}/METADATA +210 -72
  108. alma_memory-0.7.0.dist-info/RECORD +112 -0
  109. alma_memory-0.5.1.dist-info/RECORD +0 -93
  110. {alma_memory-0.5.1.dist-info → alma_memory-0.7.0.dist-info}/WHEEL +0 -0
  111. {alma_memory-0.5.1.dist-info → alma_memory-0.7.0.dist-info}/top_level.txt +0 -0
alma/progress/types.py CHANGED
@@ -1,250 +1,250 @@
1
- """
2
- Progress Tracking Types.
3
-
4
- Data models for tracking work items and progress.
5
- """
6
-
7
- import uuid
8
- from dataclasses import dataclass, field
9
- from datetime import datetime, timezone
10
- from typing import Any, Dict, List, Literal, Optional
11
-
12
- WorkItemStatus = Literal[
13
- "pending", # Not started
14
- "in_progress", # Currently being worked on
15
- "blocked", # Waiting on something
16
- "review", # Completed, awaiting review
17
- "done", # Completed and verified
18
- "failed", # Could not complete
19
- ]
20
-
21
-
22
- @dataclass
23
- class WorkItem:
24
- """
25
- A trackable unit of work.
26
-
27
- Can represent features, bugs, tasks, research questions,
28
- or any domain-specific work unit.
29
- """
30
-
31
- id: str
32
- project_id: str
33
- agent: Optional[str]
34
-
35
- # Work item details
36
- title: str
37
- description: str
38
- item_type: str # "feature", "bug", "task", "research_question", etc.
39
- status: WorkItemStatus = "pending"
40
- priority: int = 50 # 0-100, higher = more important
41
-
42
- # Progress tracking
43
- started_at: Optional[datetime] = None
44
- completed_at: Optional[datetime] = None
45
- time_spent_ms: int = 0
46
- attempt_count: int = 0
47
-
48
- # Relationships
49
- parent_id: Optional[str] = None
50
- blocks: List[str] = field(default_factory=list)
51
- blocked_by: List[str] = field(default_factory=list)
52
-
53
- # Validation
54
- tests: List[str] = field(default_factory=list)
55
- tests_passing: bool = False
56
- acceptance_criteria: List[str] = field(default_factory=list)
57
-
58
- # Timestamps
59
- created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
60
- updated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
61
-
62
- # Extensible metadata
63
- metadata: Dict[str, Any] = field(default_factory=dict)
64
-
65
- @classmethod
66
- def create(
67
- cls,
68
- project_id: str,
69
- title: str,
70
- description: str,
71
- item_type: str = "task",
72
- agent: Optional[str] = None,
73
- priority: int = 50,
74
- parent_id: Optional[str] = None,
75
- **kwargs,
76
- ) -> "WorkItem":
77
- """Factory method to create a new work item."""
78
- return cls(
79
- id=str(uuid.uuid4()),
80
- project_id=project_id,
81
- agent=agent,
82
- title=title,
83
- description=description,
84
- item_type=item_type,
85
- priority=priority,
86
- parent_id=parent_id,
87
- **kwargs,
88
- )
89
-
90
- def start(self) -> None:
91
- """Mark work item as started."""
92
- self.status = "in_progress"
93
- self.started_at = datetime.now(timezone.utc)
94
- self.attempt_count += 1
95
- self.updated_at = datetime.now(timezone.utc)
96
-
97
- def complete(self, tests_passing: bool = True) -> None:
98
- """Mark work item as completed."""
99
- self.status = "done"
100
- self.completed_at = datetime.now(timezone.utc)
101
- self.tests_passing = tests_passing
102
- if self.started_at:
103
- self.time_spent_ms += int(
104
- (self.completed_at - self.started_at).total_seconds() * 1000
105
- )
106
- self.updated_at = datetime.now(timezone.utc)
107
-
108
- def block(self, blocked_by: Optional[str] = None, reason: str = "") -> None:
109
- """Mark work item as blocked."""
110
- self.status = "blocked"
111
- if blocked_by:
112
- self.blocked_by.append(blocked_by)
113
- if reason:
114
- self.metadata["block_reason"] = reason
115
- self.updated_at = datetime.now(timezone.utc)
116
-
117
- def fail(self, reason: str = "") -> None:
118
- """Mark work item as failed."""
119
- self.status = "failed"
120
- if reason:
121
- self.metadata["failure_reason"] = reason
122
- self.updated_at = datetime.now(timezone.utc)
123
-
124
- def is_actionable(self) -> bool:
125
- """Check if work item can be worked on."""
126
- return self.status in ("pending", "in_progress") and len(self.blocked_by) == 0
127
-
128
-
129
- @dataclass
130
- class ProgressLog:
131
- """
132
- Session-level progress snapshot.
133
-
134
- Records the state of progress at a point in time.
135
- """
136
-
137
- id: str
138
- project_id: str
139
- agent: str
140
- session_id: str
141
-
142
- # Progress counts
143
- items_total: int
144
- items_done: int
145
- items_in_progress: int
146
- items_blocked: int
147
- items_pending: int
148
-
149
- # Current focus
150
- current_item_id: Optional[str]
151
- current_action: str
152
-
153
- # Session metrics
154
- session_start: datetime
155
- actions_taken: int = 0
156
- outcomes_recorded: int = 0
157
-
158
- # Timestamp
159
- created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
160
-
161
- @classmethod
162
- def create(
163
- cls,
164
- project_id: str,
165
- agent: str,
166
- session_id: str,
167
- items_total: int,
168
- items_done: int,
169
- items_in_progress: int,
170
- items_blocked: int,
171
- items_pending: int,
172
- current_item_id: Optional[str] = None,
173
- current_action: str = "",
174
- session_start: Optional[datetime] = None,
175
- ) -> "ProgressLog":
176
- """Factory method to create progress log."""
177
- return cls(
178
- id=str(uuid.uuid4()),
179
- project_id=project_id,
180
- agent=agent,
181
- session_id=session_id,
182
- items_total=items_total,
183
- items_done=items_done,
184
- items_in_progress=items_in_progress,
185
- items_blocked=items_blocked,
186
- items_pending=items_pending,
187
- current_item_id=current_item_id,
188
- current_action=current_action,
189
- session_start=session_start or datetime.now(timezone.utc),
190
- )
191
-
192
-
193
- @dataclass
194
- class ProgressSummary:
195
- """
196
- Summary of progress for display/reporting.
197
-
198
- A simplified view of progress state.
199
- """
200
-
201
- project_id: str
202
- agent: Optional[str]
203
-
204
- # Counts
205
- total: int
206
- done: int
207
- in_progress: int
208
- blocked: int
209
- pending: int
210
- failed: int
211
-
212
- # Percentages
213
- completion_rate: float # 0-1
214
- success_rate: float # done / (done + failed)
215
-
216
- # Current focus
217
- current_item: Optional[WorkItem]
218
- next_suggested: Optional[WorkItem]
219
-
220
- # Blockers
221
- blockers: List[WorkItem]
222
-
223
- # Time tracking
224
- total_time_ms: int
225
- avg_time_per_item_ms: float
226
-
227
- # Timestamps
228
- last_activity: Optional[datetime]
229
- generated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
230
-
231
- @property
232
- def completion_percentage(self) -> int:
233
- """Get completion as percentage."""
234
- return int(self.completion_rate * 100)
235
-
236
- def format_summary(self) -> str:
237
- """Format as human-readable string."""
238
- lines = [
239
- f"Progress: {self.done}/{self.total} ({self.completion_percentage}%)",
240
- f" In Progress: {self.in_progress}",
241
- f" Blocked: {self.blocked}",
242
- f" Pending: {self.pending}",
243
- ]
244
- if self.current_item:
245
- lines.append(f" Current: {self.current_item.title}")
246
- if self.next_suggested:
247
- lines.append(f" Next: {self.next_suggested.title}")
248
- if self.blockers:
249
- lines.append(f" Blockers: {len(self.blockers)} items")
250
- return "\n".join(lines)
1
+ """
2
+ Progress Tracking Types.
3
+
4
+ Data models for tracking work items and progress.
5
+ """
6
+
7
+ import uuid
8
+ from dataclasses import dataclass, field
9
+ from datetime import datetime, timezone
10
+ from typing import Any, Dict, List, Literal, Optional
11
+
12
+ WorkItemStatus = Literal[
13
+ "pending", # Not started
14
+ "in_progress", # Currently being worked on
15
+ "blocked", # Waiting on something
16
+ "review", # Completed, awaiting review
17
+ "done", # Completed and verified
18
+ "failed", # Could not complete
19
+ ]
20
+
21
+
22
+ @dataclass
23
+ class WorkItem:
24
+ """
25
+ A trackable unit of work.
26
+
27
+ Can represent features, bugs, tasks, research questions,
28
+ or any domain-specific work unit.
29
+ """
30
+
31
+ id: str
32
+ project_id: str
33
+ agent: Optional[str]
34
+
35
+ # Work item details
36
+ title: str
37
+ description: str
38
+ item_type: str # "feature", "bug", "task", "research_question", etc.
39
+ status: WorkItemStatus = "pending"
40
+ priority: int = 50 # 0-100, higher = more important
41
+
42
+ # Progress tracking
43
+ started_at: Optional[datetime] = None
44
+ completed_at: Optional[datetime] = None
45
+ time_spent_ms: int = 0
46
+ attempt_count: int = 0
47
+
48
+ # Relationships
49
+ parent_id: Optional[str] = None
50
+ blocks: List[str] = field(default_factory=list)
51
+ blocked_by: List[str] = field(default_factory=list)
52
+
53
+ # Validation
54
+ tests: List[str] = field(default_factory=list)
55
+ tests_passing: bool = False
56
+ acceptance_criteria: List[str] = field(default_factory=list)
57
+
58
+ # Timestamps
59
+ created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
60
+ updated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
61
+
62
+ # Extensible metadata
63
+ metadata: Dict[str, Any] = field(default_factory=dict)
64
+
65
+ @classmethod
66
+ def create(
67
+ cls,
68
+ project_id: str,
69
+ title: str,
70
+ description: str,
71
+ item_type: str = "task",
72
+ agent: Optional[str] = None,
73
+ priority: int = 50,
74
+ parent_id: Optional[str] = None,
75
+ **kwargs,
76
+ ) -> "WorkItem":
77
+ """Factory method to create a new work item."""
78
+ return cls(
79
+ id=str(uuid.uuid4()),
80
+ project_id=project_id,
81
+ agent=agent,
82
+ title=title,
83
+ description=description,
84
+ item_type=item_type,
85
+ priority=priority,
86
+ parent_id=parent_id,
87
+ **kwargs,
88
+ )
89
+
90
+ def start(self) -> None:
91
+ """Mark work item as started."""
92
+ self.status = "in_progress"
93
+ self.started_at = datetime.now(timezone.utc)
94
+ self.attempt_count += 1
95
+ self.updated_at = datetime.now(timezone.utc)
96
+
97
+ def complete(self, tests_passing: bool = True) -> None:
98
+ """Mark work item as completed."""
99
+ self.status = "done"
100
+ self.completed_at = datetime.now(timezone.utc)
101
+ self.tests_passing = tests_passing
102
+ if self.started_at:
103
+ self.time_spent_ms += int(
104
+ (self.completed_at - self.started_at).total_seconds() * 1000
105
+ )
106
+ self.updated_at = datetime.now(timezone.utc)
107
+
108
+ def block(self, blocked_by: Optional[str] = None, reason: str = "") -> None:
109
+ """Mark work item as blocked."""
110
+ self.status = "blocked"
111
+ if blocked_by:
112
+ self.blocked_by.append(blocked_by)
113
+ if reason:
114
+ self.metadata["block_reason"] = reason
115
+ self.updated_at = datetime.now(timezone.utc)
116
+
117
+ def fail(self, reason: str = "") -> None:
118
+ """Mark work item as failed."""
119
+ self.status = "failed"
120
+ if reason:
121
+ self.metadata["failure_reason"] = reason
122
+ self.updated_at = datetime.now(timezone.utc)
123
+
124
+ def is_actionable(self) -> bool:
125
+ """Check if work item can be worked on."""
126
+ return self.status in ("pending", "in_progress") and len(self.blocked_by) == 0
127
+
128
+
129
+ @dataclass
130
+ class ProgressLog:
131
+ """
132
+ Session-level progress snapshot.
133
+
134
+ Records the state of progress at a point in time.
135
+ """
136
+
137
+ id: str
138
+ project_id: str
139
+ agent: str
140
+ session_id: str
141
+
142
+ # Progress counts
143
+ items_total: int
144
+ items_done: int
145
+ items_in_progress: int
146
+ items_blocked: int
147
+ items_pending: int
148
+
149
+ # Current focus
150
+ current_item_id: Optional[str]
151
+ current_action: str
152
+
153
+ # Session metrics
154
+ session_start: datetime
155
+ actions_taken: int = 0
156
+ outcomes_recorded: int = 0
157
+
158
+ # Timestamp
159
+ created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
160
+
161
+ @classmethod
162
+ def create(
163
+ cls,
164
+ project_id: str,
165
+ agent: str,
166
+ session_id: str,
167
+ items_total: int,
168
+ items_done: int,
169
+ items_in_progress: int,
170
+ items_blocked: int,
171
+ items_pending: int,
172
+ current_item_id: Optional[str] = None,
173
+ current_action: str = "",
174
+ session_start: Optional[datetime] = None,
175
+ ) -> "ProgressLog":
176
+ """Factory method to create progress log."""
177
+ return cls(
178
+ id=str(uuid.uuid4()),
179
+ project_id=project_id,
180
+ agent=agent,
181
+ session_id=session_id,
182
+ items_total=items_total,
183
+ items_done=items_done,
184
+ items_in_progress=items_in_progress,
185
+ items_blocked=items_blocked,
186
+ items_pending=items_pending,
187
+ current_item_id=current_item_id,
188
+ current_action=current_action,
189
+ session_start=session_start or datetime.now(timezone.utc),
190
+ )
191
+
192
+
193
+ @dataclass
194
+ class ProgressSummary:
195
+ """
196
+ Summary of progress for display/reporting.
197
+
198
+ A simplified view of progress state.
199
+ """
200
+
201
+ project_id: str
202
+ agent: Optional[str]
203
+
204
+ # Counts
205
+ total: int
206
+ done: int
207
+ in_progress: int
208
+ blocked: int
209
+ pending: int
210
+ failed: int
211
+
212
+ # Percentages
213
+ completion_rate: float # 0-1
214
+ success_rate: float # done / (done + failed)
215
+
216
+ # Current focus
217
+ current_item: Optional[WorkItem]
218
+ next_suggested: Optional[WorkItem]
219
+
220
+ # Blockers
221
+ blockers: List[WorkItem]
222
+
223
+ # Time tracking
224
+ total_time_ms: int
225
+ avg_time_per_item_ms: float
226
+
227
+ # Timestamps
228
+ last_activity: Optional[datetime]
229
+ generated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
230
+
231
+ @property
232
+ def completion_percentage(self) -> int:
233
+ """Get completion as percentage."""
234
+ return int(self.completion_rate * 100)
235
+
236
+ def format_summary(self) -> str:
237
+ """Format as human-readable string."""
238
+ lines = [
239
+ f"Progress: {self.done}/{self.total} ({self.completion_percentage}%)",
240
+ f" In Progress: {self.in_progress}",
241
+ f" Blocked: {self.blocked}",
242
+ f" Pending: {self.pending}",
243
+ ]
244
+ if self.current_item:
245
+ lines.append(f" Current: {self.current_item.title}")
246
+ if self.next_suggested:
247
+ lines.append(f" Next: {self.next_suggested.title}")
248
+ if self.blockers:
249
+ lines.append(f" Blockers: {len(self.blockers)} items")
250
+ return "\n".join(lines)
@@ -1,53 +1,134 @@
1
- """
2
- ALMA Retrieval Engine.
3
-
4
- Provides semantic search, scoring, and caching for memory retrieval.
5
- """
6
-
7
- from alma.retrieval.cache import (
8
- CacheBackend,
9
- CacheEntry,
10
- CacheStats,
11
- NullCache,
12
- PerformanceMetrics,
13
- RedisCache,
14
- RetrievalCache,
15
- create_cache,
16
- )
17
- from alma.retrieval.embeddings import (
18
- AzureEmbedder,
19
- EmbeddingProvider,
20
- LocalEmbedder,
21
- MockEmbedder,
22
- )
23
- from alma.retrieval.engine import RetrievalEngine
24
- from alma.retrieval.scoring import (
25
- MemoryScorer,
26
- ScoredItem,
27
- ScoringWeights,
28
- compute_composite_score,
29
- )
30
-
31
- __all__ = [
32
- # Engine
33
- "RetrievalEngine",
34
- # Scoring
35
- "MemoryScorer",
36
- "ScoringWeights",
37
- "ScoredItem",
38
- "compute_composite_score",
39
- # Cache
40
- "CacheBackend",
41
- "RetrievalCache",
42
- "RedisCache",
43
- "NullCache",
44
- "CacheEntry",
45
- "CacheStats",
46
- "PerformanceMetrics",
47
- "create_cache",
48
- # Embeddings
49
- "EmbeddingProvider",
50
- "LocalEmbedder",
51
- "AzureEmbedder",
52
- "MockEmbedder",
53
- ]
1
+ """
2
+ ALMA Retrieval Engine.
3
+
4
+ Provides semantic search, scoring, and caching for memory retrieval.
5
+ Supports mode-aware retrieval for different cognitive tasks.
6
+ Includes token budget management, trust-integrated scoring, and progressive disclosure.
7
+ """
8
+
9
+ from alma.retrieval.budget import (
10
+ BudgetedItem,
11
+ BudgetReport,
12
+ PriorityTier,
13
+ RetrievalBudget,
14
+ TokenEstimator,
15
+ )
16
+ from alma.retrieval.cache import (
17
+ CacheBackend,
18
+ CacheEntry,
19
+ CacheKeyGenerator,
20
+ CacheStats,
21
+ NullCache,
22
+ PerformanceMetrics,
23
+ RedisCache,
24
+ RetrievalCache,
25
+ create_cache,
26
+ )
27
+ from alma.retrieval.embeddings import (
28
+ AzureEmbedder,
29
+ EmbeddingProvider,
30
+ LocalEmbedder,
31
+ MockEmbedder,
32
+ )
33
+ from alma.retrieval.engine import RetrievalEngine
34
+ from alma.retrieval.modes import (
35
+ ModeConfig,
36
+ RetrievalMode,
37
+ create_custom_mode,
38
+ get_mode_config,
39
+ get_mode_reason,
40
+ infer_mode_from_query,
41
+ validate_mode_config,
42
+ )
43
+ from alma.retrieval.progressive import (
44
+ DisclosureLevel,
45
+ MemorySummary,
46
+ ProgressiveRetrieval,
47
+ ProgressiveSlice,
48
+ )
49
+ from alma.retrieval.scoring import (
50
+ MemoryScorer,
51
+ ScoredItem,
52
+ ScoringWeights,
53
+ compute_composite_score,
54
+ )
55
+ from alma.retrieval.trust_scoring import (
56
+ AgentTrustContext,
57
+ AgentTrustProfile,
58
+ TrustAwareScorer,
59
+ TrustLevel,
60
+ TrustPatternStore,
61
+ TrustScoredItem,
62
+ TrustWeights,
63
+ )
64
+ from alma.retrieval.verification import (
65
+ Verification,
66
+ VerificationConfig,
67
+ VerificationMethod,
68
+ VerificationStatus,
69
+ VerifiedMemory,
70
+ VerifiedResults,
71
+ VerifiedRetriever,
72
+ create_verified_retriever,
73
+ )
74
+
75
+ __all__ = [
76
+ # Engine
77
+ "RetrievalEngine",
78
+ # Modes
79
+ "RetrievalMode",
80
+ "ModeConfig",
81
+ "infer_mode_from_query",
82
+ "get_mode_config",
83
+ "get_mode_reason",
84
+ "create_custom_mode",
85
+ "validate_mode_config",
86
+ # Scoring
87
+ "MemoryScorer",
88
+ "ScoringWeights",
89
+ "ScoredItem",
90
+ "compute_composite_score",
91
+ # Trust-Integrated Scoring (v0.8.0+)
92
+ "TrustAwareScorer",
93
+ "TrustWeights",
94
+ "TrustScoredItem",
95
+ "TrustLevel",
96
+ "AgentTrustProfile",
97
+ "AgentTrustContext",
98
+ "TrustPatternStore",
99
+ # Token Budget (v0.8.0+)
100
+ "PriorityTier",
101
+ "TokenEstimator",
102
+ "BudgetedItem",
103
+ "BudgetReport",
104
+ "RetrievalBudget",
105
+ # Progressive Disclosure (v0.8.0+)
106
+ "DisclosureLevel",
107
+ "MemorySummary",
108
+ "ProgressiveSlice",
109
+ "ProgressiveRetrieval",
110
+ # Cache
111
+ "CacheBackend",
112
+ "CacheKeyGenerator",
113
+ "RetrievalCache",
114
+ "RedisCache",
115
+ "NullCache",
116
+ "CacheEntry",
117
+ "CacheStats",
118
+ "PerformanceMetrics",
119
+ "create_cache",
120
+ # Embeddings
121
+ "EmbeddingProvider",
122
+ "LocalEmbedder",
123
+ "AzureEmbedder",
124
+ "MockEmbedder",
125
+ # Verification (v0.7.0+)
126
+ "VerificationStatus",
127
+ "VerificationMethod",
128
+ "Verification",
129
+ "VerifiedMemory",
130
+ "VerifiedResults",
131
+ "VerificationConfig",
132
+ "VerifiedRetriever",
133
+ "create_verified_retriever",
134
+ ]