amalfa 1.4.0 → 1.4.3

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 (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +60 -104
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to AMALFA will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.4.3] - 2026-01-16
9
+ ### Documentation
10
+ - Bump to 1.4.3
11
+
12
+ ## [1.4.2] - 2026-01-16
13
+ ### Documentation
14
+ - Created `docs/USER-MANUAL.md` as the definitive guide for configuration and operations.
15
+ - Refactored `README.md` to be a lighter landing page.
16
+
17
+ ## [1.4.1] - 2026-01-16
18
+ ### Documentation
19
+ - Updated README.md with Tiered Maintenance Strategy and Sub-Agent documentation.
20
+
8
21
  ## [1.4.0] - 2026-01-16
9
22
 
10
23
  ### Added
package/README.md CHANGED
@@ -34,7 +34,9 @@ Built with **Bun + SQLite + FastEmbed**.
34
34
 
35
35
  **Current state:** AI agents lose context between sessions. Knowledge resets. Same problems get re-solved.
36
36
 
37
- **Amalfa solves this:** Agents write structured reflections (briefsworkdebriefsplaybooks). Amalfa indexes this as a queryable knowledge graph with semantic search.
37
+ **Amalfa solves this:** Agents write structured reflections (Write Brief Do Work Write Debrief Update Playbooks). Amalfa indexes this as a queryable knowledge graph with semantic search.
38
+
39
+ 👉 **Deep Dive:** [Why Structured Reflection Beats Infinite Context](docs/WHY-STRUCTURED-REFLECTION.md)
38
40
 
39
41
  **Result:** Agents can query "What did we learn about authentication?" and get ranked, relevant past work—even across different agents and sessions.
40
42
 
@@ -77,25 +79,14 @@ MCP Server (AI agents)
77
79
 
78
80
  **Distinguisher**: Unlike traditional systems where the database *is* the truth, AMALFA inverts this. Your prose is permanent, the index is disposable.
79
81
 
80
- ### When to Re-Ingest
81
-
82
- Just delete `.amalfa/` and re-run ingestion:
82
+ ### Troubleshooting & Maintenance
83
83
 
84
- ```bash
85
- rm -rf .amalfa/
86
- bun run scripts/cli/ingest.ts
87
- ```
84
+ Amalfa employs a tiered maintenance strategy. For standard issues, run `amalfa doctor`. For data updates, run `amalfa init`.
88
85
 
89
- **Common scenarios**:
90
- - After upgrading AMALFA versions
91
- - When experiencing search issues
92
- - When changing embedding models
93
- - After adding/modifying many documents
94
- - Anytime you want a clean slate
86
+ 👉 **Full Guide:** [User Manual - Maintenance & Troubleshooting](docs/USER-MANUAL.md#6-maintenance--troubleshooting)
95
87
 
96
- **Speed**: 308 nodes in <1 second. Re-ingestion is fast enough to be casual.
97
88
 
98
- ### Brief-Debrief-Playbook Pattern
89
+ ### Write Brief → Do Work → Write Debrief → Update Playbooks Pattern
99
90
 
100
91
  ```
101
92
  Brief (task spec)
@@ -131,25 +122,62 @@ Amalfa **automatically** adds:
131
122
 
132
123
  **Agents don't maintain metadata manually.** Amalfa handles it via git-audited auto-augmentation.
133
124
 
134
- ### Latent Space Tagging
125
+ ---
135
126
 
136
- **Innovation:** Tags emerge from vector clustering, not predefined taxonomy.
127
+ ## Sub-Agents & Discovery
137
128
 
138
- ```python
139
- # Cluster documents in embedding space
140
- clusters = cluster(all_docs, min_size=3)
129
+ Amalfa orchestrates specialized sub-agents (Vector, Reranker, Sonar) to provide intelligence.
141
130
 
142
- # Generate labels from cluster content
143
- for cluster in clusters:
144
- label = generate_label(cluster.docs) # e.g., "auth-state-patterns"
145
- for doc in cluster:
146
- doc.add_tag(f"latent:{label}", confidence_score)
147
- ```
131
+ * **Vector Daemon**: Handles embeddings.
132
+ * **Reranker Daemon**: Re-scores search results for precision.
133
+ * **Sonar Agent**: Performs reasoning and deep research using local LLMs (Ollama) or Cloud APIs.
134
+
135
+ 👉 **Full Guide:** [User Manual - Services & Sub-Agents](docs/USER-MANUAL.md#5-services--sub-agents)
148
136
 
149
- **Result:** Self-organizing knowledge base that adapts as it grows.
150
137
 
151
138
  ---
152
139
 
140
+ ## Architecture
141
+
142
+ ### Technology Stack
143
+
144
+ - **Runtime:** Bun (fast, TypeScript-native)
145
+ - **Database:** SQLite with WAL mode (local-first, portable)
146
+ - **Embeddings:** FastEmbed (`bge-small-en-v1.5`, 384 dims)
147
+ - **Reranking:** Xenova Transformers (`bge-reranker-base`)
148
+ - **Protocol:** Model Context Protocol (MCP)
149
+
150
+ ### Project Structure
151
+
152
+ ```
153
+ amalfa/
154
+ ├── src/
155
+ │ ├── mcp/ # MCP server implementation
156
+ │ ├── resonance/ # Database layer (SQLite wrapper)
157
+ │ ├── core/ # Graph processing (EdgeWeaver, VectorEngine)
158
+ │ └── utils/ # Logging, validation, lifecycle
159
+ ├── scripts/
160
+ │ ├── cli/ # Command-line tools
161
+ │ └── pipeline/ # Data ingestion pipeline
162
+ ├── docs/
163
+ │ ├── VISION-AGENT-LEARNING.md # Core vision
164
+ │ ├── AGENT-METADATA-PATTERNS.md # Auto-augmentation design
165
+ │ └── SETUP.md # NPM publishing guide
166
+ ├── briefs/ # Task specifications
167
+ ├── debriefs/ # Reflective documents
168
+ └── playbooks/ # Codified patterns
169
+ ```
170
+
171
+ ### Key Patterns
172
+
173
+ 1. **Hollow Nodes:** Node metadata in SQLite, content on filesystem
174
+ 2. **FAFCAS Protocol:** Embedding normalization that enables scalar product searches (10x faster than cosine similarity)
175
+ 3. **Micro-Daemon Mesh:**
176
+ * **Vector Daemon (3010)**: Embeddings
177
+ * **Reranker Daemon (3011)**: Relevance Scoring
178
+ * **Sonar Agent (3012)**: Reasoning loop
179
+ 4. **ServiceLifecycle:** Unified daemon management pattern
180
+
153
181
  ## Quick Start
154
182
 
155
183
  ### Installation
@@ -206,91 +234,19 @@ bun install
206
234
 
207
235
  ---
208
236
 
209
- ## Architecture
210
-
211
- ### Technology Stack
212
237
 
213
- - **Runtime:** Bun (fast, TypeScript-native)
214
- - **Database:** SQLite with WAL mode (local-first, portable)
215
- - **Embeddings:** FastEmbed (`all-MiniLM-L6-v2`, 384 dims)
216
- - **Search:** Vector similarity + full-text (FTS5)
217
- - **Protocol:** Model Context Protocol (MCP)
218
-
219
- ### Project Structure
220
-
221
- ```
222
- amalfa/
223
- ├── src/
224
- │ ├── mcp/ # MCP server implementation
225
- │ ├── resonance/ # Database layer (SQLite wrapper)
226
- │ ├── core/ # Graph processing (EdgeWeaver, VectorEngine)
227
- │ └── utils/ # Logging, validation, lifecycle
228
- ├── scripts/
229
- │ ├── cli/ # Command-line tools
230
- │ └── pipeline/ # Data ingestion pipeline
231
- ├── docs/
232
- │ ├── VISION-AGENT-LEARNING.md # Core vision
233
- │ ├── AGENT-METADATA-PATTERNS.md # Auto-augmentation design
234
- │ └── SETUP.md # NPM publishing guide
235
- ├── briefs/ # Task specifications
236
- ├── debriefs/ # Reflective documents
237
- └── playbooks/ # Codified patterns
238
- ```
239
-
240
- ### Key Patterns
241
-
242
- 1. **Hollow Nodes:** Node metadata in SQLite, content on filesystem
243
- 2. **FAFCAS Protocol:** Embedding normalization that enables scalar product searches (10x faster than cosine similarity)
244
- 3. **Git-Based Auditing:** All agent augmentations are git commits
245
- 4. **ServiceLifecycle:** Unified daemon management pattern
246
-
247
- ---
248
-
249
- ## Example Workflow
250
-
251
- AMALFA follows a **Brief → Work → Debrief → Playbook** cycle:
252
-
253
- ![AMALFA Workflow](https://raw.githubusercontent.com/pjsvis/amalfa/main/docs/workflow.png)
254
-
255
- **Example:**
256
-
257
- 1. **Brief:** "Implement user authentication with JWT tokens"
258
- 2. **Work:** Agent implements the feature, commits code
259
- 3. **Debrief:** Document what worked (JWT refresh tokens), what didn't (session storage), lessons learned
260
- 4. **Playbook:** Extract reusable pattern: "Authentication with stateless JWT tokens"
261
- 5. **Query:** Later, "How should we handle auth?" → AMALFA retrieves the playbook via semantic search
262
-
263
- **The magic:** Each document is embedded as a vector (384 dimensions), enabling semantic search across all accumulated knowledge.
264
-
265
- ---
266
-
267
- ## Vision
268
-
269
- See [VISION-AGENT-LEARNING.md](docs/VISION-AGENT-LEARNING.md) for the full vision.
270
-
271
- **TL;DR:**
272
-
273
- Agents generate knowledge through structured reflection. Amalfa provides semantic infrastructure to make this knowledge:
274
-
275
- - **Queryable** (vector search + graph traversal)
276
- - **Persistent** (across sessions and agents)
277
- - **Self-organizing** (latent space clustering)
278
- - **Auditable** (git-based workflow)
279
-
280
- **The goal:** Enable agents to maintain institutional memory without human bottlenecks.
281
-
282
- ---
283
238
 
284
239
  ## Implementation Status
285
240
 
286
- ### ✅ Core Functionality (v1.0 - Released)
241
+ ### ✅ Core Functionality (v1.4.0 - Released)
287
242
 
288
243
  - ✅ **MCP Server** - stdio transport, tools, resources
289
244
  - ✅ **Vector Search** - FastEmbed embeddings (384-dim), semantic search
245
+ - ✅ **Reranking** - BGE-M3 cross-encoder for high precision
290
246
  - ✅ **Database** - SQLite with hollow nodes, FAFCAS protocol
291
247
  - ✅ **Ingestion Pipeline** - Markdown → nodes + embeddings
292
- - ✅ **CLI** - init, serve, stats, doctor, servers, daemon, vector
293
- - ✅ **Service Management** - Vector daemon, file watcher, lifecycle
248
+ - ✅ **CLI** - init, serve, stats, doctor, servers, daemon, vector, reranker
249
+ - ✅ **Service Management** - Vector/Reranker daemons, file watcher, Sonar agent
294
250
  - ✅ **Pre-flight Validation** - Check markdown before ingestion
295
251
 
296
252
  ### 🚧 Phase 1: Auto-Augmentation (In Progress)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amalfa",
3
- "version": "1.4.0",
3
+ "version": "1.4.3",
4
4
  "description": "Local-first knowledge graph engine for AI agents. Transforms markdown into searchable memory with MCP protocol.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/pjsvis/amalfa#readme",