amalfa 1.0.1 → 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 -263
- 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 +103 -21
- package/src/config/defaults.ts +52 -12
- package/src/core/VectorEngine.ts +18 -9
- package/src/mcp/index.ts +62 -7
- package/src/resonance/DatabaseFactory.ts +3 -4
- package/src/resonance/db.ts +4 -4
- 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/CHANGELOG.md.old +0 -43
- package/README.old.md +0 -112
- package/ROADMAP.md +0 -316
- package/TEST_PLAN.md +0 -561
- 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,371 +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
|
-
"sources": ["./docs", "./notes"],
|
|
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
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
// amalfa.config.ts
|
|
74
|
-
export default {
|
|
75
|
-
source: "./docs",
|
|
76
|
-
database: ".amalfa/resonance.db",
|
|
77
|
-
// ... rest of config
|
|
78
|
-
};
|
|
79
|
-
```
|
|
40
|
+
---
|
|
80
41
|
|
|
81
|
-
|
|
42
|
+
## Core Concepts
|
|
82
43
|
|
|
83
|
-
|
|
44
|
+
### Brief-Debrief-Playbook Pattern
|
|
84
45
|
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
46
|
+
```
|
|
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)
|
|
94
56
|
```
|
|
95
57
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### `amalfa init [--force]`
|
|
58
|
+
**Debriefs** capture:
|
|
59
|
+
- What worked (successes)
|
|
60
|
+
- What failed (dead ends)
|
|
61
|
+
- Lessons learned (abstractions)
|
|
101
62
|
|
|
102
|
-
|
|
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)
|
|
103
68
|
|
|
104
|
-
|
|
105
|
-
amalfa init # With validation
|
|
106
|
-
amalfa init --force # Override warnings (use with caution)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**What it does:**
|
|
110
|
-
- **Pre-flight validation** (v1.0.1): Checks for large files, symlinks, circular references
|
|
111
|
-
- Scans your source directories for `.md` files
|
|
112
|
-
- Generates vector embeddings (384 dimensions)
|
|
113
|
-
- Extracts WikiLinks (`[[links]]`) and semantic tags
|
|
114
|
-
- Creates edges between related documents
|
|
115
|
-
- Stores metadata in SQLite (content in filesystem - "hollow nodes")
|
|
116
|
-
|
|
117
|
-
**Pre-Flight Protection** (v1.0.1):
|
|
118
|
-
- Blocks files >10MB (prevents memory issues)
|
|
119
|
-
- Detects symlink loops (prevents infinite recursion)
|
|
120
|
-
- Warns about small files (<50 bytes) and large corpora (10K+ files)
|
|
121
|
-
- Generates `.amalfa-pre-flight.log` with actionable recommendations
|
|
122
|
-
- Use `--force` to override warnings (errors still block)
|
|
123
|
-
|
|
124
|
-
**Output:**
|
|
125
|
-
```
|
|
126
|
-
📚 Starting ingestion from: ./docs
|
|
127
|
-
📁 Found 127 markdown files
|
|
128
|
-
100% (127/127)
|
|
129
|
-
✅ Initialization complete!
|
|
130
|
-
|
|
131
|
-
📊 Summary:
|
|
132
|
-
Files processed: 127
|
|
133
|
-
Nodes created: 127
|
|
134
|
-
Edges created: 243
|
|
135
|
-
Embeddings: 127
|
|
136
|
-
Duration: 8.42s
|
|
137
|
-
```
|
|
69
|
+
### Auto-Augmentation
|
|
138
70
|
|
|
139
|
-
|
|
71
|
+
Amalfa **automatically** adds:
|
|
140
72
|
|
|
141
|
-
|
|
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
|
|
142
77
|
|
|
143
|
-
|
|
144
|
-
amalfa daemon start # Start watching for changes
|
|
145
|
-
amalfa daemon stop # Stop the daemon
|
|
146
|
-
amalfa daemon status # Check if running
|
|
147
|
-
amalfa daemon restart # Restart daemon
|
|
148
|
-
```
|
|
78
|
+
**Agents don't maintain metadata manually.** Amalfa handles it via git-audited auto-augmentation.
|
|
149
79
|
|
|
150
|
-
|
|
151
|
-
- Watches source directory recursively
|
|
152
|
-
- Debounced updates (1s default)
|
|
153
|
-
- Hash-based change detection (only processes modified files)
|
|
154
|
-
- Retry logic with exponential backoff
|
|
155
|
-
- Native macOS notifications
|
|
80
|
+
### Latent Space Tagging
|
|
156
81
|
|
|
157
|
-
|
|
82
|
+
**Innovation:** Tags emerge from vector clustering, not predefined taxonomy.
|
|
158
83
|
|
|
159
|
-
|
|
84
|
+
```python
|
|
85
|
+
# Cluster documents in embedding space
|
|
86
|
+
clusters = cluster(all_docs, min_size=3)
|
|
160
87
|
|
|
161
|
-
|
|
162
|
-
|
|
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)
|
|
163
93
|
```
|
|
164
94
|
|
|
165
|
-
**
|
|
166
|
-
- `search_knowledge`: Semantic search across all documents
|
|
167
|
-
- `get_node`: Retrieve specific document by ID
|
|
168
|
-
- `get_neighbors`: Find related documents (graph traversal)
|
|
95
|
+
**Result:** Self-organizing knowledge base that adapts as it grows.
|
|
169
96
|
|
|
170
|
-
|
|
97
|
+
---
|
|
171
98
|
|
|
172
|
-
|
|
99
|
+
## Quick Start
|
|
173
100
|
|
|
174
|
-
|
|
101
|
+
### Installation
|
|
175
102
|
|
|
176
103
|
```bash
|
|
177
|
-
amalfa
|
|
104
|
+
npm install -g amalfa
|
|
105
|
+
# or
|
|
106
|
+
bun install -g amalfa
|
|
178
107
|
```
|
|
179
108
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
Health check and diagnostics.
|
|
183
|
-
|
|
109
|
+
**From source** (for development):
|
|
184
110
|
```bash
|
|
185
|
-
amalfa
|
|
111
|
+
git clone https://github.com/pjsvis/amalfa.git
|
|
112
|
+
cd amalfa
|
|
113
|
+
bun install
|
|
186
114
|
```
|
|
187
115
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
### Philosophy: Markdown is Truth
|
|
116
|
+
### Setup MCP Server
|
|
191
117
|
|
|
192
|
-
|
|
118
|
+
1. **Configure your sources** in `amalfa.config.json`:
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"sources": ["./docs", "./playbooks"],
|
|
122
|
+
"database": ".amalfa/resonance.db"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
193
125
|
|
|
194
|
-
|
|
195
|
-
|
|
126
|
+
2. **Ingest your markdown**:
|
|
127
|
+
```bash
|
|
128
|
+
bun run scripts/cli/ingest.ts
|
|
129
|
+
```
|
|
196
130
|
|
|
197
|
-
|
|
131
|
+
3. **Generate MCP config**:
|
|
132
|
+
```bash
|
|
133
|
+
bun run scripts/setup_mcp.ts
|
|
134
|
+
```
|
|
198
135
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
- ✅ No lock-in, no vendor formats
|
|
204
|
-
- ✅ Smaller databases, faster writes (v1.0.1)
|
|
205
|
-
|
|
206
|
-
### Technology Stack
|
|
136
|
+
4. **Add to Claude Desktop**: Copy the JSON output to:
|
|
137
|
+
```
|
|
138
|
+
~/Library/Application Support/Claude/claude_desktop_config.json
|
|
139
|
+
```
|
|
207
140
|
|
|
208
|
-
|
|
209
|
-
- **Database**: SQLite with WAL mode
|
|
210
|
-
- **Embeddings**: FastEmbed (local, no API calls)
|
|
211
|
-
- **Vectors**: 384-dimensional (BAAI/bge-small-en-v1.5)
|
|
212
|
-
- **Search**: Pure dot product (cosine similarity)
|
|
213
|
-
- **Protocol**: Model Context Protocol (MCP)
|
|
141
|
+
5. **Restart Claude Desktop**
|
|
214
142
|
|
|
215
|
-
|
|
143
|
+
**Full setup guide:** [docs/MCP_SETUP.md](docs/MCP_SETUP.md)
|
|
216
144
|
|
|
217
|
-
|
|
218
|
-
your-project/
|
|
219
|
-
├── docs/ # Your markdown files
|
|
220
|
-
│ ├── README.md
|
|
221
|
-
│ ├── architecture.md
|
|
222
|
-
│ └── ...
|
|
223
|
-
├── .amalfa/ # AMALFA data (gitignored)
|
|
224
|
-
│ └── resonance.db # SQLite database (schema v6 - hollow nodes)
|
|
225
|
-
├── amalfa.config.json # Configuration (optional)
|
|
226
|
-
├── .amalfa-daemon.pid # Daemon process ID (if running)
|
|
227
|
-
├── .amalfa-daemon.log # Daemon logs
|
|
228
|
-
└── .amalfa-pre-flight.log # Validation report (generated by init)
|
|
229
|
-
```
|
|
145
|
+
**Package status:** Reserved at https://www.npmjs.com/package/amalfa (v1.0 coming soon)
|
|
230
146
|
|
|
231
|
-
|
|
147
|
+
---
|
|
232
148
|
|
|
233
|
-
|
|
149
|
+
## Architecture
|
|
234
150
|
|
|
235
|
-
|
|
151
|
+
### Technology Stack
|
|
236
152
|
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
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)
|
|
241
158
|
|
|
242
|
-
###
|
|
159
|
+
### Project Structure
|
|
243
160
|
|
|
244
|
-
|
|
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
|
+
```
|
|
245
179
|
|
|
246
|
-
|
|
247
|
-
- **Tags**: `[tag: Concept]` creates `TAGGED_AS` edges
|
|
248
|
-
- **Metadata**: `<!-- tags: [RELATION: Target] -->` for explicit edges
|
|
249
|
-
- **Louvain Gate**: Prevents graph pollution (community detection)
|
|
180
|
+
### Key Patterns
|
|
250
181
|
|
|
251
|
-
|
|
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
|
|
252
186
|
|
|
253
|
-
|
|
187
|
+
---
|
|
254
188
|
|
|
255
|
-
|
|
256
|
-
- Batch transactions (50 files)
|
|
257
|
-
- Debounced (1s default)
|
|
258
|
-
- Automatic retry on failure (3 attempts, exponential backoff)
|
|
189
|
+
## Vision
|
|
259
190
|
|
|
260
|
-
|
|
191
|
+
See [VISION-AGENT-LEARNING.md](docs/VISION-AGENT-LEARNING.md) for the full vision.
|
|
261
192
|
|
|
262
|
-
|
|
193
|
+
**TL;DR:**
|
|
263
194
|
|
|
264
|
-
|
|
265
|
-
# Your notes directory
|
|
266
|
-
cd ~/Documents/notes
|
|
267
|
-
amalfa init
|
|
268
|
-
amalfa daemon start
|
|
195
|
+
Agents generate knowledge through structured reflection. Amalfa provides semantic infrastructure to make this knowledge:
|
|
269
196
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
197
|
+
- **Queryable** (vector search + graph traversal)
|
|
198
|
+
- **Persistent** (across sessions and agents)
|
|
199
|
+
- **Self-organizing** (latent space clustering)
|
|
200
|
+
- **Auditable** (git-based workflow)
|
|
273
201
|
|
|
274
|
-
|
|
202
|
+
**The goal:** Enable agents to maintain institutional memory without human bottlenecks.
|
|
275
203
|
|
|
276
|
-
|
|
277
|
-
# Your project's docs
|
|
278
|
-
cd ~/Code/my-project
|
|
279
|
-
amalfa init
|
|
204
|
+
---
|
|
280
205
|
|
|
281
|
-
|
|
282
|
-
# Claude searches ./docs and provides context
|
|
283
|
-
```
|
|
206
|
+
## Implementation Status
|
|
284
207
|
|
|
285
|
-
###
|
|
208
|
+
### Phase 1: Basic Auto-Augmentation (In Progress)
|
|
286
209
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
210
|
+
- [ ] Entity extraction
|
|
211
|
+
- [ ] Auto-linking (wiki-style)
|
|
212
|
+
- [ ] Tag extraction
|
|
213
|
+
- [ ] Embedding generation
|
|
214
|
+
- [ ] Git integration
|
|
291
215
|
|
|
292
|
-
|
|
293
|
-
# Claude traverses the knowledge graph
|
|
294
|
-
```
|
|
216
|
+
### Phase 2: Latent Space Tagging (Planned)
|
|
295
217
|
|
|
296
|
-
|
|
218
|
+
- [ ] Document clustering (HDBSCAN)
|
|
219
|
+
- [ ] Cluster label generation
|
|
220
|
+
- [ ] Confidence-based tagging
|
|
221
|
+
- [ ] Topic modeling (BERTopic)
|
|
297
222
|
|
|
298
|
-
###
|
|
223
|
+
### Phase 3: Semantic Relationships (Planned)
|
|
299
224
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
225
|
+
- [ ] K-nearest neighbor search
|
|
226
|
+
- [ ] Suggested reading lists
|
|
227
|
+
- [ ] Temporal sequences
|
|
228
|
+
- [ ] Backlink maintenance
|
|
304
229
|
|
|
305
|
-
|
|
306
|
-
- Source directory doesn't exist
|
|
307
|
-
- Database permissions
|
|
308
|
-
- Port conflicts (if running multiple instances)
|
|
230
|
+
### Phase 4: Learning from Corrections (Future)
|
|
309
231
|
|
|
310
|
-
|
|
232
|
+
- [ ] Track human edits
|
|
233
|
+
- [ ] Adjust confidence thresholds
|
|
234
|
+
- [ ] Improve extraction
|
|
235
|
+
- [ ] Weekly digest
|
|
311
236
|
|
|
312
|
-
|
|
313
|
-
```bash
|
|
314
|
-
rm -rf .amalfa/
|
|
315
|
-
amalfa init
|
|
316
|
-
```
|
|
237
|
+
---
|
|
317
238
|
|
|
318
|
-
|
|
239
|
+
## Development
|
|
319
240
|
|
|
320
|
-
###
|
|
241
|
+
### Prerequisites
|
|
321
242
|
|
|
322
|
-
|
|
243
|
+
- **Bun:** v1.0+ (required)
|
|
244
|
+
- **Node:** v22.x (for compatibility)
|
|
245
|
+
- **Git:** For version control
|
|
323
246
|
|
|
324
|
-
|
|
247
|
+
### Setup
|
|
325
248
|
|
|
326
249
|
```bash
|
|
327
|
-
# Clone
|
|
250
|
+
# Clone repo
|
|
328
251
|
git clone https://github.com/pjsvis/amalfa.git
|
|
329
252
|
cd amalfa
|
|
330
253
|
|
|
331
254
|
# Install dependencies
|
|
332
255
|
bun install
|
|
333
256
|
|
|
334
|
-
# Run CLI locally
|
|
335
|
-
bun run src/cli.ts help
|
|
336
|
-
|
|
337
257
|
# Run tests
|
|
338
258
|
bun test
|
|
339
259
|
|
|
340
|
-
#
|
|
341
|
-
bun run
|
|
260
|
+
# Start development server
|
|
261
|
+
bun run dev
|
|
342
262
|
```
|
|
343
263
|
|
|
344
|
-
|
|
264
|
+
### Commands
|
|
345
265
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
+
---
|
|
350
288
|
|
|
351
289
|
## Contributing
|
|
352
290
|
|
|
353
|
-
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
|
+
---
|
|
354
299
|
|
|
355
300
|
## License
|
|
356
301
|
|
|
357
|
-
MIT
|
|
302
|
+
MIT
|
|
303
|
+
|
|
304
|
+
---
|
|
358
305
|
|
|
359
|
-
##
|
|
306
|
+
## Lineage
|
|
360
307
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
- [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.
|
|
365
311
|
|
|
366
312
|
---
|
|
367
313
|
|
|
368
|
-
|
|
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)
|
|
369
327
|
|
|
370
|
-
|
|
328
|
+
- Latent space clustering
|
|
329
|
+
- Multi-agent knowledge sharing
|
|
330
|
+
- Cross-repo knowledge graphs
|
|
331
|
+
- Agent-to-agent learning
|
|
332
|
+
|
|
333
|
+
---
|
|
371
334
|
|
|
372
|
-
**
|
|
335
|
+
**Built with ❤️ by developers frustrated with context loss.**
|