alma-memory 0.2.0__tar.gz

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 (41) hide show
  1. alma_memory-0.2.0/PKG-INFO +327 -0
  2. alma_memory-0.2.0/README.md +283 -0
  3. alma_memory-0.2.0/alma/__init__.py +75 -0
  4. alma_memory-0.2.0/alma/config/__init__.py +5 -0
  5. alma_memory-0.2.0/alma/config/loader.py +156 -0
  6. alma_memory-0.2.0/alma/core.py +322 -0
  7. alma_memory-0.2.0/alma/harness/__init__.py +35 -0
  8. alma_memory-0.2.0/alma/harness/base.py +377 -0
  9. alma_memory-0.2.0/alma/harness/domains.py +689 -0
  10. alma_memory-0.2.0/alma/integration/__init__.py +62 -0
  11. alma_memory-0.2.0/alma/integration/claude_agents.py +432 -0
  12. alma_memory-0.2.0/alma/integration/helena.py +413 -0
  13. alma_memory-0.2.0/alma/integration/victor.py +447 -0
  14. alma_memory-0.2.0/alma/learning/__init__.py +86 -0
  15. alma_memory-0.2.0/alma/learning/forgetting.py +1396 -0
  16. alma_memory-0.2.0/alma/learning/heuristic_extractor.py +374 -0
  17. alma_memory-0.2.0/alma/learning/protocols.py +326 -0
  18. alma_memory-0.2.0/alma/learning/validation.py +341 -0
  19. alma_memory-0.2.0/alma/mcp/__init__.py +45 -0
  20. alma_memory-0.2.0/alma/mcp/__main__.py +155 -0
  21. alma_memory-0.2.0/alma/mcp/resources.py +121 -0
  22. alma_memory-0.2.0/alma/mcp/server.py +533 -0
  23. alma_memory-0.2.0/alma/mcp/tools.py +374 -0
  24. alma_memory-0.2.0/alma/retrieval/__init__.py +53 -0
  25. alma_memory-0.2.0/alma/retrieval/cache.py +1062 -0
  26. alma_memory-0.2.0/alma/retrieval/embeddings.py +202 -0
  27. alma_memory-0.2.0/alma/retrieval/engine.py +287 -0
  28. alma_memory-0.2.0/alma/retrieval/scoring.py +334 -0
  29. alma_memory-0.2.0/alma/storage/__init__.py +20 -0
  30. alma_memory-0.2.0/alma/storage/azure_cosmos.py +972 -0
  31. alma_memory-0.2.0/alma/storage/base.py +372 -0
  32. alma_memory-0.2.0/alma/storage/file_based.py +583 -0
  33. alma_memory-0.2.0/alma/storage/sqlite_local.py +912 -0
  34. alma_memory-0.2.0/alma/types.py +216 -0
  35. alma_memory-0.2.0/alma_memory.egg-info/PKG-INFO +327 -0
  36. alma_memory-0.2.0/alma_memory.egg-info/SOURCES.txt +39 -0
  37. alma_memory-0.2.0/alma_memory.egg-info/dependency_links.txt +1 -0
  38. alma_memory-0.2.0/alma_memory.egg-info/requires.txt +27 -0
  39. alma_memory-0.2.0/alma_memory.egg-info/top_level.txt +1 -0
  40. alma_memory-0.2.0/pyproject.toml +103 -0
  41. alma_memory-0.2.0/setup.cfg +4 -0
@@ -0,0 +1,327 @@
1
+ Metadata-Version: 2.4
2
+ Name: alma-memory
3
+ Version: 0.2.0
4
+ Summary: Agent Learning Memory Architecture - Persistent memory for AI agents
5
+ Author-email: RBKunnela <aiagentsprompt@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/RBKunnela/ALMA-memory
8
+ Project-URL: Documentation, https://github.com/RBKunnela/ALMA-memory/tree/main/docs
9
+ Project-URL: Repository, https://github.com/RBKunnela/ALMA-memory
10
+ Project-URL: Issues, https://github.com/RBKunnela/ALMA-memory/issues
11
+ Keywords: ai,agents,memory,learning,llm,azure,claude
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: pyyaml>=6.0
23
+ Requires-Dist: python-dotenv>=1.0.0
24
+ Provides-Extra: local
25
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "local"
26
+ Requires-Dist: faiss-cpu>=1.7.4; extra == "local"
27
+ Provides-Extra: azure
28
+ Requires-Dist: azure-cosmos>=4.5.0; extra == "azure"
29
+ Requires-Dist: azure-identity>=1.15.0; extra == "azure"
30
+ Requires-Dist: azure-keyvault-secrets>=4.7.0; extra == "azure"
31
+ Requires-Dist: openai>=1.0.0; extra == "azure"
32
+ Provides-Extra: mcp
33
+ Requires-Dist: pydantic>=2.0.0; extra == "mcp"
34
+ Requires-Dist: aiohttp>=3.9.0; extra == "mcp"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
37
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
38
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
39
+ Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
40
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
41
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
42
+ Provides-Extra: all
43
+ Requires-Dist: alma-memory[azure,dev,local,mcp]; extra == "all"
44
+
45
+ # ALMA - Agent Learning Memory Architecture
46
+
47
+ > A reusable harness pattern for creating AI agents that learn and improve over time through structured memory - without model weight updates.
48
+
49
+ ## The Harness Pattern
50
+
51
+ ALMA isn't just agent memory - it's a **generalized framework** for any tool-using workflow:
52
+
53
+ ```
54
+ ┌─────────────────────────────────────────────────────────────────┐
55
+ │ 1. SETTING Fixed environment: tools, constraints │
56
+ ├─────────────────────────────────────────────────────────────────┤
57
+ │ 2. CONTEXT Ephemeral per-run inputs: task, user │
58
+ ├─────────────────────────────────────────────────────────────────┤
59
+ │ 3. AGENT The executor with scoped intelligence │
60
+ ├─────────────────────────────────────────────────────────────────┤
61
+ │ 4. MEMORY SCHEMA Domain-specific learning structure │
62
+ └─────────────────────────────────────────────────────────────────┘
63
+ ```
64
+
65
+ **The Flow:**
66
+ 1. **Pre-run**: Inject relevant memory slices ("Past successes in similar tasks")
67
+ 2. **Run**: Agent acts using tools, logs reflections
68
+ 3. **Post-run**: Update memory schema
69
+ 4. **Repeat**: Agent appears to "learn" without weight changes
70
+
71
+ ## Why This Matters
72
+
73
+ ```
74
+ Code exists ≠ Knowledge retained
75
+ Knowledge retained ≠ Knowledge scoped
76
+ Knowledge scoped ≠ Knowledge retrieved efficiently
77
+ ```
78
+
79
+ ALMA solves all three through **scoped memory injection**. Agents get smarter via better-informed prompts, not model changes.
80
+
81
+ ## Supported Domains
82
+
83
+ ALMA works for ANY tool-using workflow:
84
+
85
+ | Domain | Agents | Use Case |
86
+ |--------|--------|----------|
87
+ | **Coding** | Helena, Victor | Testing, API development |
88
+ | **Research** | Researcher | Market analysis, competitive intelligence |
89
+ | **Content** | Copywriter, Documenter | Marketing, documentation |
90
+ | **Operations** | Support | Customer service, automation |
91
+
92
+ ## Quick Start
93
+
94
+ ### Installation
95
+
96
+ ```bash
97
+ pip install alma-memory
98
+ # or from source
99
+ pip install git+https://github.com/RBKunnela/ALMA-memory.git
100
+ ```
101
+
102
+ ### Using the Harness Pattern
103
+
104
+ ```python
105
+ from alma import ALMA, create_harness, Context
106
+
107
+ # Initialize ALMA
108
+ alma = ALMA.from_config(".alma/config.yaml")
109
+
110
+ # Create a domain-specific harness
111
+ harness = create_harness("coding", "helena", alma)
112
+
113
+ # Define task context
114
+ context = Context(
115
+ task="Test the login form validation",
116
+ project_id="my-app",
117
+ user_id="developer-1",
118
+ inputs={"component": "LoginForm", "priority": "high"}
119
+ )
120
+
121
+ # Run with memory injection
122
+ result = harness.run(context)
123
+
124
+ # The harness automatically:
125
+ # 1. Retrieved relevant memories (testing strategies, past outcomes)
126
+ # 2. Built the prompt with injected knowledge
127
+ # 3. Will log the outcome for future learning
128
+ ```
129
+
130
+ ### Creating Custom Agents
131
+
132
+ ```python
133
+ from alma import (
134
+ ALMA, Harness, Setting, Agent, MemorySchema, Tool, ToolType
135
+ )
136
+
137
+ # Define the environment
138
+ setting = Setting(
139
+ name="Bio Research Environment",
140
+ description="Tools for biological data analysis",
141
+ tools=[
142
+ Tool(
143
+ name="sequence_search",
144
+ description="Search genomic databases",
145
+ tool_type=ToolType.SEARCH,
146
+ ),
147
+ Tool(
148
+ name="structure_analysis",
149
+ description="Analyze protein structures",
150
+ tool_type=ToolType.ANALYSIS,
151
+ ),
152
+ ],
153
+ global_constraints=[
154
+ "Cite all data sources",
155
+ "Note confidence levels",
156
+ ],
157
+ )
158
+
159
+ # Define what this agent can learn
160
+ schema = MemorySchema(
161
+ domain="bioinformatics",
162
+ description="Patterns for biological data analysis",
163
+ learnable_categories=[
164
+ "search_refinements",
165
+ "analysis_patterns",
166
+ "data_interpretation",
167
+ ],
168
+ forbidden_categories=[
169
+ "medical_diagnosis", # Out of scope
170
+ ],
171
+ min_occurrences=5,
172
+ )
173
+
174
+ # Create the agent
175
+ agent = Agent(
176
+ name="bio_researcher",
177
+ role="Bioinformatics Analyst",
178
+ description="Expert in genomic analysis and protein structure prediction",
179
+ memory_schema=schema,
180
+ )
181
+
182
+ # Assemble the harness
183
+ alma = ALMA.from_config(".alma/config.yaml")
184
+ harness = Harness(setting=setting, agent=agent, alma=alma)
185
+ ```
186
+
187
+ ### Basic Memory Operations
188
+
189
+ ```python
190
+ from alma import ALMA
191
+
192
+ alma = ALMA.from_config(".alma/config.yaml")
193
+
194
+ # Retrieve relevant memories
195
+ memories = alma.retrieve(
196
+ task="Test the login form validation",
197
+ agent="helena",
198
+ top_k=5
199
+ )
200
+
201
+ # Inject into prompt
202
+ prompt = f"""
203
+ ## Your Task
204
+ Test the login form validation
205
+
206
+ ## Relevant Knowledge (from past runs)
207
+ {memories.to_prompt()}
208
+ """
209
+
210
+ # After task completion, learn from the outcome
211
+ alma.learn(
212
+ agent="helena",
213
+ task="Test login form",
214
+ outcome="success",
215
+ strategy_used="Tested empty fields, invalid email, valid submission",
216
+ feedback="User confirmed tests were thorough"
217
+ )
218
+ ```
219
+
220
+ ## Memory Types
221
+
222
+ | Type | What It Stores | Example |
223
+ |------|----------------|---------|
224
+ | **Heuristic** | Learned strategies | "For forms with >5 fields, test validation incrementally" |
225
+ | **Outcome** | Task results | "Login test succeeded using JWT token strategy" |
226
+ | **Preference** | User constraints | "User prefers verbose test output" |
227
+ | **Domain Knowledge** | Accumulated facts | "Login uses OAuth 2.0 with 24h token expiry" |
228
+ | **Anti-pattern** | What NOT to do | "Don't use sleep() for async waits - causes flaky tests" |
229
+
230
+ ## Configuration
231
+
232
+ Create `.alma/config.yaml`:
233
+
234
+ ```yaml
235
+ alma:
236
+ project_id: "my-project"
237
+ storage: sqlite # or "azure" for production
238
+
239
+ domains:
240
+ coding:
241
+ enabled: true
242
+ agents: [helena, victor]
243
+ research:
244
+ enabled: true
245
+ agents: [researcher]
246
+
247
+ agents:
248
+ helena:
249
+ domain: coding
250
+ can_learn:
251
+ - testing_strategies
252
+ - selector_patterns
253
+ cannot_learn:
254
+ - backend_logic
255
+ min_occurrences_for_heuristic: 3
256
+
257
+ researcher:
258
+ domain: research
259
+ can_learn:
260
+ - trend_patterns
261
+ - source_reliability
262
+ cannot_learn:
263
+ - code_implementation
264
+ min_occurrences_for_heuristic: 5
265
+ ```
266
+
267
+ ## Storage Backends
268
+
269
+ | Backend | Use Case | Vector Search |
270
+ |---------|----------|---------------|
271
+ | `azure` | Production | Cosmos DB with vector search |
272
+ | `sqlite` | Local dev | SQLite + FAISS |
273
+ | `file` | Testing | JSON files (no vector search) |
274
+
275
+ ## Architecture
276
+
277
+ ```
278
+ ┌─────────────────────────────────────────────────────────────────┐
279
+ │ HARNESS PATTERN │
280
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
281
+ │ │ Setting │ │ Context │ │ Agent │ │MemorySchema │ │
282
+ │ │ (tools) │ │ (task) │ │(executor)│ │ (learning) │ │
283
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │
284
+ └─────────────────────────────────────────────────────────────────┘
285
+
286
+ ┌─────────────────────────────────────────────────────────────────┐
287
+ │ ALMA CORE │
288
+ │ ┌────────────┐ ┌────────────┐ ┌────────────────────────┐ │
289
+ │ │ Retrieval │ │ Learning │ │ Storage │ │
290
+ │ │ Engine │ │ Protocol │ │ (Azure/SQLite/File) │ │
291
+ │ └────────────┘ └────────────┘ └────────────────────────┘ │
292
+ └─────────────────────────────────────────────────────────────────┘
293
+
294
+ ┌─────────────────────────────────────────────────────────────────┐
295
+ │ MEMORY TYPES │
296
+ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌──────────┐ │
297
+ │ │ Heuristics │ │ Outcomes │ │Preferences │ │Anti-patt.│ │
298
+ │ └────────────┘ └────────────┘ └────────────┘ └──────────┘ │
299
+ └─────────────────────────────────────────────────────────────────┘
300
+ ```
301
+
302
+ ## Documentation
303
+
304
+ - [PRD](docs/architecture/PRD.md) - Full product requirements
305
+ - [Harness Pattern](docs/guides/harness-pattern.md) - Deep dive on the pattern
306
+ - [API Reference](docs/api/) - Coming soon
307
+
308
+ ## Status
309
+
310
+ | Phase | Description | Status |
311
+ |-------|-------------|--------|
312
+ | 1 | Core Abstractions | Done |
313
+ | 2 | Local Storage (SQLite + FAISS) | Done |
314
+ | 3 | Retrieval Engine | In Progress |
315
+ | 4 | Learning Protocols | Todo |
316
+ | 5 | Agent Integration (Helena + Victor) | Todo |
317
+ | 6 | Azure Cosmos DB | Todo |
318
+ | 7 | Cache Layer | Todo |
319
+ | 8 | Forgetting Mechanism | Todo |
320
+
321
+ ## License
322
+
323
+ MIT
324
+
325
+ ## Contributing
326
+
327
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
@@ -0,0 +1,283 @@
1
+ # ALMA - Agent Learning Memory Architecture
2
+
3
+ > A reusable harness pattern for creating AI agents that learn and improve over time through structured memory - without model weight updates.
4
+
5
+ ## The Harness Pattern
6
+
7
+ ALMA isn't just agent memory - it's a **generalized framework** for any tool-using workflow:
8
+
9
+ ```
10
+ ┌─────────────────────────────────────────────────────────────────┐
11
+ │ 1. SETTING Fixed environment: tools, constraints │
12
+ ├─────────────────────────────────────────────────────────────────┤
13
+ │ 2. CONTEXT Ephemeral per-run inputs: task, user │
14
+ ├─────────────────────────────────────────────────────────────────┤
15
+ │ 3. AGENT The executor with scoped intelligence │
16
+ ├─────────────────────────────────────────────────────────────────┤
17
+ │ 4. MEMORY SCHEMA Domain-specific learning structure │
18
+ └─────────────────────────────────────────────────────────────────┘
19
+ ```
20
+
21
+ **The Flow:**
22
+ 1. **Pre-run**: Inject relevant memory slices ("Past successes in similar tasks")
23
+ 2. **Run**: Agent acts using tools, logs reflections
24
+ 3. **Post-run**: Update memory schema
25
+ 4. **Repeat**: Agent appears to "learn" without weight changes
26
+
27
+ ## Why This Matters
28
+
29
+ ```
30
+ Code exists ≠ Knowledge retained
31
+ Knowledge retained ≠ Knowledge scoped
32
+ Knowledge scoped ≠ Knowledge retrieved efficiently
33
+ ```
34
+
35
+ ALMA solves all three through **scoped memory injection**. Agents get smarter via better-informed prompts, not model changes.
36
+
37
+ ## Supported Domains
38
+
39
+ ALMA works for ANY tool-using workflow:
40
+
41
+ | Domain | Agents | Use Case |
42
+ |--------|--------|----------|
43
+ | **Coding** | Helena, Victor | Testing, API development |
44
+ | **Research** | Researcher | Market analysis, competitive intelligence |
45
+ | **Content** | Copywriter, Documenter | Marketing, documentation |
46
+ | **Operations** | Support | Customer service, automation |
47
+
48
+ ## Quick Start
49
+
50
+ ### Installation
51
+
52
+ ```bash
53
+ pip install alma-memory
54
+ # or from source
55
+ pip install git+https://github.com/RBKunnela/ALMA-memory.git
56
+ ```
57
+
58
+ ### Using the Harness Pattern
59
+
60
+ ```python
61
+ from alma import ALMA, create_harness, Context
62
+
63
+ # Initialize ALMA
64
+ alma = ALMA.from_config(".alma/config.yaml")
65
+
66
+ # Create a domain-specific harness
67
+ harness = create_harness("coding", "helena", alma)
68
+
69
+ # Define task context
70
+ context = Context(
71
+ task="Test the login form validation",
72
+ project_id="my-app",
73
+ user_id="developer-1",
74
+ inputs={"component": "LoginForm", "priority": "high"}
75
+ )
76
+
77
+ # Run with memory injection
78
+ result = harness.run(context)
79
+
80
+ # The harness automatically:
81
+ # 1. Retrieved relevant memories (testing strategies, past outcomes)
82
+ # 2. Built the prompt with injected knowledge
83
+ # 3. Will log the outcome for future learning
84
+ ```
85
+
86
+ ### Creating Custom Agents
87
+
88
+ ```python
89
+ from alma import (
90
+ ALMA, Harness, Setting, Agent, MemorySchema, Tool, ToolType
91
+ )
92
+
93
+ # Define the environment
94
+ setting = Setting(
95
+ name="Bio Research Environment",
96
+ description="Tools for biological data analysis",
97
+ tools=[
98
+ Tool(
99
+ name="sequence_search",
100
+ description="Search genomic databases",
101
+ tool_type=ToolType.SEARCH,
102
+ ),
103
+ Tool(
104
+ name="structure_analysis",
105
+ description="Analyze protein structures",
106
+ tool_type=ToolType.ANALYSIS,
107
+ ),
108
+ ],
109
+ global_constraints=[
110
+ "Cite all data sources",
111
+ "Note confidence levels",
112
+ ],
113
+ )
114
+
115
+ # Define what this agent can learn
116
+ schema = MemorySchema(
117
+ domain="bioinformatics",
118
+ description="Patterns for biological data analysis",
119
+ learnable_categories=[
120
+ "search_refinements",
121
+ "analysis_patterns",
122
+ "data_interpretation",
123
+ ],
124
+ forbidden_categories=[
125
+ "medical_diagnosis", # Out of scope
126
+ ],
127
+ min_occurrences=5,
128
+ )
129
+
130
+ # Create the agent
131
+ agent = Agent(
132
+ name="bio_researcher",
133
+ role="Bioinformatics Analyst",
134
+ description="Expert in genomic analysis and protein structure prediction",
135
+ memory_schema=schema,
136
+ )
137
+
138
+ # Assemble the harness
139
+ alma = ALMA.from_config(".alma/config.yaml")
140
+ harness = Harness(setting=setting, agent=agent, alma=alma)
141
+ ```
142
+
143
+ ### Basic Memory Operations
144
+
145
+ ```python
146
+ from alma import ALMA
147
+
148
+ alma = ALMA.from_config(".alma/config.yaml")
149
+
150
+ # Retrieve relevant memories
151
+ memories = alma.retrieve(
152
+ task="Test the login form validation",
153
+ agent="helena",
154
+ top_k=5
155
+ )
156
+
157
+ # Inject into prompt
158
+ prompt = f"""
159
+ ## Your Task
160
+ Test the login form validation
161
+
162
+ ## Relevant Knowledge (from past runs)
163
+ {memories.to_prompt()}
164
+ """
165
+
166
+ # After task completion, learn from the outcome
167
+ alma.learn(
168
+ agent="helena",
169
+ task="Test login form",
170
+ outcome="success",
171
+ strategy_used="Tested empty fields, invalid email, valid submission",
172
+ feedback="User confirmed tests were thorough"
173
+ )
174
+ ```
175
+
176
+ ## Memory Types
177
+
178
+ | Type | What It Stores | Example |
179
+ |------|----------------|---------|
180
+ | **Heuristic** | Learned strategies | "For forms with >5 fields, test validation incrementally" |
181
+ | **Outcome** | Task results | "Login test succeeded using JWT token strategy" |
182
+ | **Preference** | User constraints | "User prefers verbose test output" |
183
+ | **Domain Knowledge** | Accumulated facts | "Login uses OAuth 2.0 with 24h token expiry" |
184
+ | **Anti-pattern** | What NOT to do | "Don't use sleep() for async waits - causes flaky tests" |
185
+
186
+ ## Configuration
187
+
188
+ Create `.alma/config.yaml`:
189
+
190
+ ```yaml
191
+ alma:
192
+ project_id: "my-project"
193
+ storage: sqlite # or "azure" for production
194
+
195
+ domains:
196
+ coding:
197
+ enabled: true
198
+ agents: [helena, victor]
199
+ research:
200
+ enabled: true
201
+ agents: [researcher]
202
+
203
+ agents:
204
+ helena:
205
+ domain: coding
206
+ can_learn:
207
+ - testing_strategies
208
+ - selector_patterns
209
+ cannot_learn:
210
+ - backend_logic
211
+ min_occurrences_for_heuristic: 3
212
+
213
+ researcher:
214
+ domain: research
215
+ can_learn:
216
+ - trend_patterns
217
+ - source_reliability
218
+ cannot_learn:
219
+ - code_implementation
220
+ min_occurrences_for_heuristic: 5
221
+ ```
222
+
223
+ ## Storage Backends
224
+
225
+ | Backend | Use Case | Vector Search |
226
+ |---------|----------|---------------|
227
+ | `azure` | Production | Cosmos DB with vector search |
228
+ | `sqlite` | Local dev | SQLite + FAISS |
229
+ | `file` | Testing | JSON files (no vector search) |
230
+
231
+ ## Architecture
232
+
233
+ ```
234
+ ┌─────────────────────────────────────────────────────────────────┐
235
+ │ HARNESS PATTERN │
236
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
237
+ │ │ Setting │ │ Context │ │ Agent │ │MemorySchema │ │
238
+ │ │ (tools) │ │ (task) │ │(executor)│ │ (learning) │ │
239
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │
240
+ └─────────────────────────────────────────────────────────────────┘
241
+
242
+ ┌─────────────────────────────────────────────────────────────────┐
243
+ │ ALMA CORE │
244
+ │ ┌────────────┐ ┌────────────┐ ┌────────────────────────┐ │
245
+ │ │ Retrieval │ │ Learning │ │ Storage │ │
246
+ │ │ Engine │ │ Protocol │ │ (Azure/SQLite/File) │ │
247
+ │ └────────────┘ └────────────┘ └────────────────────────┘ │
248
+ └─────────────────────────────────────────────────────────────────┘
249
+
250
+ ┌─────────────────────────────────────────────────────────────────┐
251
+ │ MEMORY TYPES │
252
+ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌──────────┐ │
253
+ │ │ Heuristics │ │ Outcomes │ │Preferences │ │Anti-patt.│ │
254
+ │ └────────────┘ └────────────┘ └────────────┘ └──────────┘ │
255
+ └─────────────────────────────────────────────────────────────────┘
256
+ ```
257
+
258
+ ## Documentation
259
+
260
+ - [PRD](docs/architecture/PRD.md) - Full product requirements
261
+ - [Harness Pattern](docs/guides/harness-pattern.md) - Deep dive on the pattern
262
+ - [API Reference](docs/api/) - Coming soon
263
+
264
+ ## Status
265
+
266
+ | Phase | Description | Status |
267
+ |-------|-------------|--------|
268
+ | 1 | Core Abstractions | Done |
269
+ | 2 | Local Storage (SQLite + FAISS) | Done |
270
+ | 3 | Retrieval Engine | In Progress |
271
+ | 4 | Learning Protocols | Todo |
272
+ | 5 | Agent Integration (Helena + Victor) | Todo |
273
+ | 6 | Azure Cosmos DB | Todo |
274
+ | 7 | Cache Layer | Todo |
275
+ | 8 | Forgetting Mechanism | Todo |
276
+
277
+ ## License
278
+
279
+ MIT
280
+
281
+ ## Contributing
282
+
283
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
@@ -0,0 +1,75 @@
1
+ """
2
+ ALMA - Agent Learning Memory Architecture
3
+
4
+ Persistent memory system for AI agents that learn and improve over time
5
+ through structured memory layers - without model weight updates.
6
+
7
+ The Harness Pattern:
8
+ 1. Setting - Fixed environment (tools, constraints)
9
+ 2. Context - Ephemeral per-run inputs
10
+ 3. Agent - The executor with scoped intelligence
11
+ 4. Memory Schema - Domain-specific learning structure
12
+
13
+ This makes any tool-using agent appear to "learn" by injecting relevant
14
+ memory slices before each run and updating memory after.
15
+ """
16
+
17
+ __version__ = "0.2.0"
18
+
19
+ # Core
20
+ from alma.core import ALMA
21
+ from alma.types import (
22
+ Heuristic,
23
+ Outcome,
24
+ UserPreference,
25
+ DomainKnowledge,
26
+ AntiPattern,
27
+ MemorySlice,
28
+ MemoryScope,
29
+ )
30
+
31
+ # Harness Pattern
32
+ from alma.harness.base import (
33
+ Setting,
34
+ Context,
35
+ Agent,
36
+ MemorySchema,
37
+ Harness,
38
+ Tool,
39
+ ToolType,
40
+ RunResult,
41
+ )
42
+ from alma.harness.domains import (
43
+ CodingDomain,
44
+ ResearchDomain,
45
+ ContentDomain,
46
+ OperationsDomain,
47
+ create_harness,
48
+ )
49
+
50
+ __all__ = [
51
+ # Core
52
+ "ALMA",
53
+ "Heuristic",
54
+ "Outcome",
55
+ "UserPreference",
56
+ "DomainKnowledge",
57
+ "AntiPattern",
58
+ "MemorySlice",
59
+ "MemoryScope",
60
+ # Harness Pattern
61
+ "Setting",
62
+ "Context",
63
+ "Agent",
64
+ "MemorySchema",
65
+ "Harness",
66
+ "Tool",
67
+ "ToolType",
68
+ "RunResult",
69
+ # Domain Configurations
70
+ "CodingDomain",
71
+ "ResearchDomain",
72
+ "ContentDomain",
73
+ "OperationsDomain",
74
+ "create_harness",
75
+ ]
@@ -0,0 +1,5 @@
1
+ """ALMA Configuration."""
2
+
3
+ from alma.config.loader import ConfigLoader
4
+
5
+ __all__ = ["ConfigLoader"]