amalfa 1.0.0 → 1.0.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/README.md +226 -247
- package/amalfa.config.example.ts +8 -6
- package/docs/AGENT-METADATA-PATTERNS.md +1021 -0
- package/docs/CONFIG_E2E_VALIDATION.md +147 -0
- package/docs/CONFIG_UNIFICATION.md +187 -0
- package/docs/CONFIG_VALIDATION.md +103 -0
- package/docs/LEGACY_DEPRECATION.md +174 -0
- package/docs/MCP_SETUP.md +317 -0
- package/docs/QUICK_START_MCP.md +168 -0
- package/docs/SESSION-2026-01-06-METADATA-PATTERNS.md +346 -0
- package/docs/SETUP.md +464 -0
- package/docs/SETUP_COMPLETE.md +464 -0
- package/docs/VISION-AGENT-LEARNING.md +1242 -0
- package/docs/_current-config-status.md +93 -0
- package/package.json +6 -3
- package/polyvis.settings.json.bak +38 -0
- package/src/cli.ts +159 -31
- package/src/config/defaults.ts +73 -15
- package/src/core/VectorEngine.ts +18 -9
- package/src/daemon/index.ts +12 -8
- package/src/mcp/index.ts +62 -7
- package/src/pipeline/AmalfaIngestor.ts +22 -12
- package/src/pipeline/PreFlightAnalyzer.ts +434 -0
- package/src/resonance/DatabaseFactory.ts +3 -4
- package/src/resonance/db.ts +8 -6
- package/src/resonance/schema.ts +19 -1
- package/src/resonance/services/vector-daemon.ts +151 -0
- package/src/utils/DaemonManager.ts +147 -0
- package/src/utils/ZombieDefense.ts +5 -1
- package/:memory: +0 -0
- package/:memory:-shm +0 -0
- package/:memory:-wal +0 -0
- package/README.old.md +0 -112
- package/agents.config.json +0 -11
- package/drizzle/0000_minor_iron_fist.sql +0 -19
- package/drizzle/meta/0000_snapshot.json +0 -139
- package/drizzle/meta/_journal.json +0 -13
- package/example_usage.ts +0 -39
- package/experiment.sh +0 -35
- package/hello +0 -2
- package/index.html +0 -52
- package/knowledge/excalibur.md +0 -12
- package/plans/experience-graph-integration.md +0 -60
- package/prompts/gemini-king-mode-prompt.md +0 -46
- package/public/docs/MCP_TOOLS.md +0 -372
- package/schemas/README.md +0 -20
- package/schemas/cda.schema.json +0 -84
- package/schemas/conceptual-lexicon.schema.json +0 -75
- package/scratchpads/dummy-debrief-boxed.md +0 -39
- package/scratchpads/dummy-debrief.md +0 -27
- package/scratchpads/scratchpad-design.md +0 -50
- package/scratchpads/scratchpad-scrolling.md +0 -20
- package/scratchpads/scratchpad-toc-disappearance.md +0 -23
- package/scratchpads/scratchpad-toc.md +0 -28
- package/scratchpads/test_gardener.md +0 -7
- package/src/core/LLMClient.ts +0 -93
- package/src/core/TagEngine.ts +0 -56
- package/src/db/schema.ts +0 -46
- package/src/gardeners/AutoTagger.ts +0 -116
- package/src/pipeline/HarvesterPipeline.ts +0 -101
- package/src/pipeline/Ingestor.ts +0 -555
- package/src/resonance/cli/ingest.ts +0 -41
- package/src/resonance/cli/migrate.ts +0 -54
- package/src/resonance/config.ts +0 -40
- package/src/resonance/daemon.ts +0 -236
- package/src/resonance/pipeline/extract.ts +0 -89
- package/src/resonance/pipeline/transform_docs.ts +0 -60
- package/src/resonance/services/tokenizer.ts +0 -159
- package/src/resonance/transform/cda.ts +0 -393
- package/src/utils/EnvironmentVerifier.ts +0 -67
- package/substack/substack-playbook-1.md +0 -95
- package/substack/substack-playbook-2.md +0 -78
- package/tasks/ui-investigation.md +0 -26
- package/test-db +0 -0
- package/test-db-shm +0 -0
- package/test-db-wal +0 -0
- package/tests/canary/verify_pinch_check.ts +0 -44
- package/tests/fixtures/ingest_test.md +0 -12
- package/tests/fixtures/ingest_test_boxed.md +0 -13
- package/tests/fixtures/safety_test.md +0 -45
- package/tests/fixtures/safety_test_boxed.md +0 -49
- package/tests/fixtures/tagged_output.md +0 -49
- package/tests/fixtures/tagged_test.md +0 -49
- package/tests/mcp-server-settings.json +0 -8
- package/verify-embedder.ts +0 -54
package/README.md
CHANGED
|
@@ -2,355 +2,334 @@
|
|
|
2
2
|
|
|
3
3
|
**A Memory Layer For Agents**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
MCP server that gives AI agents semantic access to project knowledge graphs.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
---
|
|
9
8
|
|
|
10
|
-
##
|
|
9
|
+
## Status
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
✅ **v1.0 published** - Available on npm
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **💰 Zero cost**: No API calls, no subscriptions
|
|
17
|
-
- **📝 Markdown native**: Your notes are the source of truth
|
|
18
|
-
- **🔄 Real-time**: File watcher keeps your knowledge graph up-to-date
|
|
19
|
-
- **🤖 Agent-ready**: MCP protocol integration with Claude Desktop
|
|
13
|
+
[](https://www.npmjs.com/package/amalfa)
|
|
14
|
+
[](https://www.npmjs.com/package/amalfa)
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
---
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
## What is Amalfa?
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
# Install globally
|
|
27
|
-
bun add -g amalfa
|
|
20
|
+
Amalfa is a **Model Context Protocol (MCP) server** that provides AI agents with:
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
- 🔍 **Semantic search** over markdown documentation
|
|
23
|
+
- 📊 **Graph traversal** of relationships between documents
|
|
24
|
+
- 🧠 **Agent continuity** across sessions via persistent memory
|
|
25
|
+
- ⚡ **Auto-augmentation** of metadata (tags, links, clusters)
|
|
26
|
+
- 🏷️ **Latent space tagging** for emergent organization
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
Built with **Bun + SQLite + FastEmbed**.
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
# 1. Navigate to your project with markdown files
|
|
37
|
-
cd ~/Documents/my-notes
|
|
30
|
+
---
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
amalfa init
|
|
32
|
+
## The Problem
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
amalfa daemon start
|
|
34
|
+
**Current state:** AI agents lose context between sessions. Knowledge resets. Same problems get re-solved.
|
|
44
35
|
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Configuration
|
|
49
|
-
|
|
50
|
-
Create `amalfa.config.json` in your project root:
|
|
51
|
-
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"source": "./docs",
|
|
55
|
-
"database": ".amalfa/resonance.db",
|
|
56
|
-
"embeddings": {
|
|
57
|
-
"model": "BAAI/bge-small-en-v1.5",
|
|
58
|
-
"dimensions": 384
|
|
59
|
-
},
|
|
60
|
-
"watch": {
|
|
61
|
-
"enabled": true,
|
|
62
|
-
"debounce": 1000
|
|
63
|
-
},
|
|
64
|
-
"excludePatterns": ["node_modules", ".git", ".amalfa"]
|
|
65
|
-
}
|
|
66
|
-
```
|
|
36
|
+
**Amalfa solves this:** Agents write structured reflections (briefs → work → debriefs → playbooks). Amalfa indexes this as a queryable knowledge graph with semantic search.
|
|
67
37
|
|
|
68
|
-
|
|
38
|
+
**Result:** Agents can query "What did we learn about authentication?" and get ranked, relevant past work—even across different agents and sessions.
|
|
69
39
|
|
|
70
|
-
|
|
71
|
-
// amalfa.config.ts
|
|
72
|
-
export default {
|
|
73
|
-
source: "./docs",
|
|
74
|
-
database: ".amalfa/resonance.db",
|
|
75
|
-
// ... rest of config
|
|
76
|
-
};
|
|
77
|
-
```
|
|
40
|
+
---
|
|
78
41
|
|
|
79
|
-
|
|
42
|
+
## Core Concepts
|
|
80
43
|
|
|
81
|
-
|
|
44
|
+
### Brief-Debrief-Playbook Pattern
|
|
82
45
|
|
|
83
|
-
```json
|
|
84
|
-
{
|
|
85
|
-
"mcpServers": {
|
|
86
|
-
"amalfa": {
|
|
87
|
-
"command": "amalfa",
|
|
88
|
-
"args": ["serve"]
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
46
|
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
amalfa init
|
|
47
|
+
Brief (task spec)
|
|
48
|
+
↓
|
|
49
|
+
Work (implementation)
|
|
50
|
+
↓
|
|
51
|
+
Debrief (what we learned)
|
|
52
|
+
↓
|
|
53
|
+
Playbook (codified patterns)
|
|
54
|
+
↓
|
|
55
|
+
Future briefs (informed by playbooks)
|
|
104
56
|
```
|
|
105
57
|
|
|
106
|
-
**
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
- Creates edges between related documents
|
|
111
|
-
- Stores everything in SQLite with WAL mode
|
|
58
|
+
**Debriefs** capture:
|
|
59
|
+
- What worked (successes)
|
|
60
|
+
- What failed (dead ends)
|
|
61
|
+
- Lessons learned (abstractions)
|
|
112
62
|
|
|
113
|
-
**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
✅ Initialization complete!
|
|
119
|
-
|
|
120
|
-
📊 Summary:
|
|
121
|
-
Files processed: 127
|
|
122
|
-
Nodes created: 127
|
|
123
|
-
Edges created: 243
|
|
124
|
-
Embeddings: 127
|
|
125
|
-
Duration: 8.42s
|
|
126
|
-
```
|
|
63
|
+
**Playbooks** codify:
|
|
64
|
+
- Principles (how we do things)
|
|
65
|
+
- Patterns (reusable solutions)
|
|
66
|
+
- Anti-patterns (what to avoid)
|
|
67
|
+
- Decision records (why we chose X over Y)
|
|
127
68
|
|
|
128
|
-
###
|
|
69
|
+
### Auto-Augmentation
|
|
129
70
|
|
|
130
|
-
|
|
71
|
+
Amalfa **automatically** adds:
|
|
131
72
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
amalfa daemon restart # Restart daemon
|
|
137
|
-
```
|
|
73
|
+
- **Tags:** Extracted from content + latent space clustering
|
|
74
|
+
- **Links:** Wiki-style links between related documents
|
|
75
|
+
- **Clusters:** Documents organized by embedding similarity
|
|
76
|
+
- **Suggested reading:** Context for new sessions
|
|
138
77
|
|
|
139
|
-
**
|
|
140
|
-
- Watches source directory recursively
|
|
141
|
-
- Debounced updates (1s default)
|
|
142
|
-
- Hash-based change detection (only processes modified files)
|
|
143
|
-
- Retry logic with exponential backoff
|
|
144
|
-
- Native macOS notifications
|
|
78
|
+
**Agents don't maintain metadata manually.** Amalfa handles it via git-audited auto-augmentation.
|
|
145
79
|
|
|
146
|
-
###
|
|
80
|
+
### Latent Space Tagging
|
|
147
81
|
|
|
148
|
-
|
|
82
|
+
**Innovation:** Tags emerge from vector clustering, not predefined taxonomy.
|
|
149
83
|
|
|
150
|
-
```
|
|
151
|
-
|
|
84
|
+
```python
|
|
85
|
+
# Cluster documents in embedding space
|
|
86
|
+
clusters = cluster(all_docs, min_size=3)
|
|
87
|
+
|
|
88
|
+
# Generate labels from cluster content
|
|
89
|
+
for cluster in clusters:
|
|
90
|
+
label = generate_label(cluster.docs) # e.g., "auth-state-patterns"
|
|
91
|
+
for doc in cluster:
|
|
92
|
+
doc.add_tag(f"latent:{label}", confidence_score)
|
|
152
93
|
```
|
|
153
94
|
|
|
154
|
-
**
|
|
155
|
-
- `search_knowledge`: Semantic search across all documents
|
|
156
|
-
- `get_node`: Retrieve specific document by ID
|
|
157
|
-
- `get_neighbors`: Find related documents (graph traversal)
|
|
95
|
+
**Result:** Self-organizing knowledge base that adapts as it grows.
|
|
158
96
|
|
|
159
|
-
|
|
97
|
+
---
|
|
160
98
|
|
|
161
|
-
|
|
99
|
+
## Quick Start
|
|
162
100
|
|
|
163
|
-
|
|
101
|
+
### Installation
|
|
164
102
|
|
|
165
103
|
```bash
|
|
166
|
-
amalfa
|
|
104
|
+
npm install -g amalfa
|
|
105
|
+
# or
|
|
106
|
+
bun install -g amalfa
|
|
167
107
|
```
|
|
168
108
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
Health check and diagnostics.
|
|
172
|
-
|
|
109
|
+
**From source** (for development):
|
|
173
110
|
```bash
|
|
174
|
-
amalfa
|
|
111
|
+
git clone https://github.com/pjsvis/amalfa.git
|
|
112
|
+
cd amalfa
|
|
113
|
+
bun install
|
|
175
114
|
```
|
|
176
115
|
|
|
177
|
-
|
|
116
|
+
### Setup MCP Server
|
|
178
117
|
|
|
179
|
-
|
|
118
|
+
1. **Configure your sources** in `amalfa.config.json`:
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"sources": ["./docs", "./playbooks"],
|
|
122
|
+
"database": ".amalfa/resonance.db"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
180
125
|
|
|
181
|
-
|
|
126
|
+
2. **Ingest your markdown**:
|
|
127
|
+
```bash
|
|
128
|
+
bun run scripts/cli/ingest.ts
|
|
129
|
+
```
|
|
182
130
|
|
|
183
|
-
|
|
184
|
-
|
|
131
|
+
3. **Generate MCP config**:
|
|
132
|
+
```bash
|
|
133
|
+
bun run scripts/setup_mcp.ts
|
|
134
|
+
```
|
|
185
135
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
- ✅ No lock-in, no vendor formats
|
|
191
|
-
|
|
192
|
-
### Technology Stack
|
|
136
|
+
4. **Add to Claude Desktop**: Copy the JSON output to:
|
|
137
|
+
```
|
|
138
|
+
~/Library/Application Support/Claude/claude_desktop_config.json
|
|
139
|
+
```
|
|
193
140
|
|
|
194
|
-
|
|
195
|
-
- **Database**: SQLite with WAL mode
|
|
196
|
-
- **Embeddings**: FastEmbed (local, no API calls)
|
|
197
|
-
- **Vectors**: 384-dimensional (BAAI/bge-small-en-v1.5)
|
|
198
|
-
- **Search**: Pure dot product (cosine similarity)
|
|
199
|
-
- **Protocol**: Model Context Protocol (MCP)
|
|
141
|
+
5. **Restart Claude Desktop**
|
|
200
142
|
|
|
201
|
-
|
|
143
|
+
**Full setup guide:** [docs/MCP_SETUP.md](docs/MCP_SETUP.md)
|
|
202
144
|
|
|
203
|
-
|
|
204
|
-
your-project/
|
|
205
|
-
├── docs/ # Your markdown files
|
|
206
|
-
│ ├── README.md
|
|
207
|
-
│ ├── architecture.md
|
|
208
|
-
│ └── ...
|
|
209
|
-
├── .amalfa/ # AMALFA data (gitignored)
|
|
210
|
-
│ └── resonance.db # SQLite database (2-5 MB typical)
|
|
211
|
-
├── amalfa.config.json # Configuration (optional)
|
|
212
|
-
└── .amalfa-daemon.pid # Daemon process ID (if running)
|
|
213
|
-
```
|
|
145
|
+
**Package status:** Reserved at https://www.npmjs.com/package/amalfa (v1.0 coming soon)
|
|
214
146
|
|
|
215
|
-
|
|
147
|
+
---
|
|
216
148
|
|
|
217
|
-
|
|
149
|
+
## Architecture
|
|
218
150
|
|
|
219
|
-
|
|
151
|
+
### Technology Stack
|
|
220
152
|
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
153
|
+
- **Runtime:** Bun (fast, TypeScript-native)
|
|
154
|
+
- **Database:** SQLite with WAL mode (local-first, portable)
|
|
155
|
+
- **Embeddings:** FastEmbed (`all-MiniLM-L6-v2`, 384 dims)
|
|
156
|
+
- **Search:** Vector similarity + full-text (FTS5)
|
|
157
|
+
- **Protocol:** Model Context Protocol (MCP)
|
|
225
158
|
|
|
226
|
-
###
|
|
159
|
+
### Project Structure
|
|
227
160
|
|
|
228
|
-
|
|
161
|
+
```
|
|
162
|
+
amalfa/
|
|
163
|
+
├── src/
|
|
164
|
+
│ ├── mcp/ # MCP server implementation
|
|
165
|
+
│ ├── resonance/ # Database layer (SQLite wrapper)
|
|
166
|
+
│ ├── core/ # Graph processing (EdgeWeaver, VectorEngine)
|
|
167
|
+
│ └── utils/ # Logging, validation, lifecycle
|
|
168
|
+
├── scripts/
|
|
169
|
+
│ ├── cli/ # Command-line tools
|
|
170
|
+
│ └── pipeline/ # Data ingestion pipeline
|
|
171
|
+
├── docs/
|
|
172
|
+
│ ├── VISION-AGENT-LEARNING.md # Core vision
|
|
173
|
+
│ ├── AGENT-METADATA-PATTERNS.md # Auto-augmentation design
|
|
174
|
+
│ └── SETUP.md # NPM publishing guide
|
|
175
|
+
├── briefs/ # Task specifications
|
|
176
|
+
├── debriefs/ # Reflective documents
|
|
177
|
+
└── playbooks/ # Codified patterns
|
|
178
|
+
```
|
|
229
179
|
|
|
230
|
-
|
|
231
|
-
- **Tags**: `[tag: Concept]` creates `TAGGED_AS` edges
|
|
232
|
-
- **Metadata**: `<!-- tags: [RELATION: Target] -->` for explicit edges
|
|
233
|
-
- **Louvain Gate**: Prevents graph pollution (community detection)
|
|
180
|
+
### Key Patterns
|
|
234
181
|
|
|
235
|
-
|
|
182
|
+
1. **Hollow Nodes:** Node metadata in SQLite, content on filesystem
|
|
183
|
+
2. **FAFCAS Protocol:** Fast Approximate Fuzzy Cosine Similarity search
|
|
184
|
+
3. **Git-Based Auditing:** All agent augmentations are git commits
|
|
185
|
+
4. **ServiceLifecycle:** Unified daemon management pattern
|
|
236
186
|
|
|
237
|
-
|
|
187
|
+
---
|
|
238
188
|
|
|
239
|
-
|
|
240
|
-
- Batch transactions (50 files)
|
|
241
|
-
- Debounced (1s default)
|
|
242
|
-
- Automatic retry on failure (3 attempts, exponential backoff)
|
|
189
|
+
## Vision
|
|
243
190
|
|
|
244
|
-
|
|
191
|
+
See [VISION-AGENT-LEARNING.md](docs/VISION-AGENT-LEARNING.md) for the full vision.
|
|
245
192
|
|
|
246
|
-
|
|
193
|
+
**TL;DR:**
|
|
247
194
|
|
|
248
|
-
|
|
249
|
-
# Your notes directory
|
|
250
|
-
cd ~/Documents/notes
|
|
251
|
-
amalfa init
|
|
252
|
-
amalfa daemon start
|
|
195
|
+
Agents generate knowledge through structured reflection. Amalfa provides semantic infrastructure to make this knowledge:
|
|
253
196
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
197
|
+
- **Queryable** (vector search + graph traversal)
|
|
198
|
+
- **Persistent** (across sessions and agents)
|
|
199
|
+
- **Self-organizing** (latent space clustering)
|
|
200
|
+
- **Auditable** (git-based workflow)
|
|
257
201
|
|
|
258
|
-
|
|
202
|
+
**The goal:** Enable agents to maintain institutional memory without human bottlenecks.
|
|
259
203
|
|
|
260
|
-
|
|
261
|
-
# Your project's docs
|
|
262
|
-
cd ~/Code/my-project
|
|
263
|
-
amalfa init
|
|
204
|
+
---
|
|
264
205
|
|
|
265
|
-
|
|
266
|
-
# Claude searches ./docs and provides context
|
|
267
|
-
```
|
|
206
|
+
## Implementation Status
|
|
268
207
|
|
|
269
|
-
###
|
|
208
|
+
### Phase 1: Basic Auto-Augmentation (In Progress)
|
|
270
209
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
210
|
+
- [ ] Entity extraction
|
|
211
|
+
- [ ] Auto-linking (wiki-style)
|
|
212
|
+
- [ ] Tag extraction
|
|
213
|
+
- [ ] Embedding generation
|
|
214
|
+
- [ ] Git integration
|
|
275
215
|
|
|
276
|
-
|
|
277
|
-
# Claude traverses the knowledge graph
|
|
278
|
-
```
|
|
216
|
+
### Phase 2: Latent Space Tagging (Planned)
|
|
279
217
|
|
|
280
|
-
|
|
218
|
+
- [ ] Document clustering (HDBSCAN)
|
|
219
|
+
- [ ] Cluster label generation
|
|
220
|
+
- [ ] Confidence-based tagging
|
|
221
|
+
- [ ] Topic modeling (BERTopic)
|
|
281
222
|
|
|
282
|
-
###
|
|
223
|
+
### Phase 3: Semantic Relationships (Planned)
|
|
283
224
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
225
|
+
- [ ] K-nearest neighbor search
|
|
226
|
+
- [ ] Suggested reading lists
|
|
227
|
+
- [ ] Temporal sequences
|
|
228
|
+
- [ ] Backlink maintenance
|
|
288
229
|
|
|
289
|
-
|
|
290
|
-
- Source directory doesn't exist
|
|
291
|
-
- Database permissions
|
|
292
|
-
- Port conflicts (if running multiple instances)
|
|
230
|
+
### Phase 4: Learning from Corrections (Future)
|
|
293
231
|
|
|
294
|
-
|
|
232
|
+
- [ ] Track human edits
|
|
233
|
+
- [ ] Adjust confidence thresholds
|
|
234
|
+
- [ ] Improve extraction
|
|
235
|
+
- [ ] Weekly digest
|
|
295
236
|
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
rm -rf .amalfa/
|
|
299
|
-
amalfa init
|
|
300
|
-
```
|
|
237
|
+
---
|
|
301
238
|
|
|
302
|
-
|
|
239
|
+
## Development
|
|
303
240
|
|
|
304
|
-
###
|
|
241
|
+
### Prerequisites
|
|
305
242
|
|
|
306
|
-
|
|
243
|
+
- **Bun:** v1.0+ (required)
|
|
244
|
+
- **Node:** v22.x (for compatibility)
|
|
245
|
+
- **Git:** For version control
|
|
307
246
|
|
|
308
|
-
|
|
247
|
+
### Setup
|
|
309
248
|
|
|
310
249
|
```bash
|
|
311
|
-
# Clone
|
|
250
|
+
# Clone repo
|
|
312
251
|
git clone https://github.com/pjsvis/amalfa.git
|
|
313
252
|
cd amalfa
|
|
314
253
|
|
|
315
254
|
# Install dependencies
|
|
316
255
|
bun install
|
|
317
256
|
|
|
318
|
-
# Run CLI locally
|
|
319
|
-
bun run src/cli.ts help
|
|
320
|
-
|
|
321
257
|
# Run tests
|
|
322
258
|
bun test
|
|
323
259
|
|
|
324
|
-
#
|
|
325
|
-
bun run
|
|
260
|
+
# Start development server
|
|
261
|
+
bun run dev
|
|
326
262
|
```
|
|
327
263
|
|
|
328
|
-
|
|
264
|
+
### Commands
|
|
329
265
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
266
|
+
```bash
|
|
267
|
+
bun run dev # Start dev server
|
|
268
|
+
bun run build # Build for production
|
|
269
|
+
bun test # Run tests
|
|
270
|
+
bun run precommit # TypeScript + Biome checks
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Documentation
|
|
276
|
+
|
|
277
|
+
- **[VISION-AGENT-LEARNING.md](docs/VISION-AGENT-LEARNING.md)** - Why agent-generated knowledge works
|
|
278
|
+
- **[AGENT-METADATA-PATTERNS.md](docs/AGENT-METADATA-PATTERNS.md)** - Auto-augmentation design
|
|
279
|
+
- **[SETUP.md](docs/SETUP.md)** - NPM publishing setup
|
|
280
|
+
|
|
281
|
+
### Playbooks
|
|
282
|
+
|
|
283
|
+
- **[embeddings-and-fafcas-protocol-playbook.md](playbooks/embeddings-and-fafcas-protocol-playbook.md)** - Vector search patterns
|
|
284
|
+
- **[local-first-vector-db-playbook.md](playbooks/local-first-vector-db-playbook.md)** - Database architecture
|
|
285
|
+
- **[problem-solving-playbook.md](playbooks/problem-solving-playbook.md)** - Debugging strategies
|
|
286
|
+
|
|
287
|
+
---
|
|
334
288
|
|
|
335
289
|
## Contributing
|
|
336
290
|
|
|
337
|
-
Contributions welcome
|
|
291
|
+
Amalfa is in early development. Contributions welcome once v1.0 is released.
|
|
292
|
+
|
|
293
|
+
**For now:**
|
|
294
|
+
- ⭐ Star the repo if interested
|
|
295
|
+
- 👀 Watch for release announcements
|
|
296
|
+
- 💬 Open issues for feedback
|
|
297
|
+
|
|
298
|
+
---
|
|
338
299
|
|
|
339
300
|
## License
|
|
340
301
|
|
|
341
|
-
MIT
|
|
302
|
+
MIT
|
|
303
|
+
|
|
304
|
+
---
|
|
342
305
|
|
|
343
|
-
##
|
|
306
|
+
## Lineage
|
|
344
307
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
- [Model Context Protocol](https://modelcontextprotocol.io) - AI agent integration
|
|
308
|
+
Amalfa evolved from patterns discovered in the [PolyVis](https://github.com/pjsvis/polyvis) project, where agents spontaneously maintained documentation through brief-debrief-playbook workflows.
|
|
309
|
+
|
|
310
|
+
**Key insight:** When given minimal structure, agents naturally build institutional memory. Amalfa scales this with semantic infrastructure.
|
|
349
311
|
|
|
350
312
|
---
|
|
351
313
|
|
|
352
|
-
|
|
314
|
+
## Roadmap
|
|
315
|
+
|
|
316
|
+
### v1.0 (Q1 2026)
|
|
317
|
+
|
|
318
|
+
- ✅ Package name reserved on npm
|
|
319
|
+
- ✅ Core vision documented
|
|
320
|
+
- ✅ Auto-augmentation design complete
|
|
321
|
+
- 🚧 MVP implementation (in progress)
|
|
322
|
+
- [ ] MCP server functional
|
|
323
|
+
- [ ] Basic semantic search working
|
|
324
|
+
- [ ] Initial release
|
|
325
|
+
|
|
326
|
+
### v1.1+ (Future)
|
|
353
327
|
|
|
354
|
-
|
|
328
|
+
- Latent space clustering
|
|
329
|
+
- Multi-agent knowledge sharing
|
|
330
|
+
- Cross-repo knowledge graphs
|
|
331
|
+
- Agent-to-agent learning
|
|
332
|
+
|
|
333
|
+
---
|
|
355
334
|
|
|
356
|
-
**
|
|
335
|
+
**Built with ❤️ by developers frustrated with context loss.**
|
package/amalfa.config.example.ts
CHANGED
|
@@ -9,16 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
/**
|
|
12
|
-
* Source
|
|
12
|
+
* Source directories containing markdown files
|
|
13
13
|
* Relative to project root
|
|
14
14
|
*
|
|
15
15
|
* Examples:
|
|
16
|
-
* - "./docs" -
|
|
17
|
-
* - "./notes" -
|
|
18
|
-
* - "./
|
|
19
|
-
* - "." - Current directory (scans all .md files)
|
|
16
|
+
* - ["./docs"] - Single directory
|
|
17
|
+
* - ["./docs", "./notes"] - Multiple directories
|
|
18
|
+
* - ["./docs", "../shared/notes"] - Across repositories
|
|
19
|
+
* - ["."] - Current directory (scans all .md files)
|
|
20
|
+
*
|
|
21
|
+
* Legacy: Single 'source' string still supported for backward compatibility
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
sources: ["./docs"],
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Database file location
|