@rbalchii/anchor-engine 4.7.0 → 4.8.0
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 +337 -317
- package/engine/package.json +105 -105
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,317 +1,337 @@
|
|
|
1
|
-
# Anchor Engine ⚓
|
|
2
|
-
|
|
3
|
-
**Deterministic semantic memory for LLMs – local-first, graph traversal, <1GB RAM**
|
|
4
|
-
|
|
5
|
-
[](https://github.com/RSBalchII/anchor-engine-node/releases)
|
|
6
|
-
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
7
|
-
[](http://makeapullrequest.com)
|
|
8
|
-
[](https://doi.org/10.5281/zenodo.18841399)
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 🌟 Why Anchor Engine?
|
|
13
|
-
|
|
14
|
-
Modern AI memory is broken.
|
|
15
|
-
|
|
16
|
-
Vector databases demand GPUs, gigabytes of RAM, and cloud infrastructure. They're opaque, expensive, and fundamentally incompatible with personal, local‑first AI.
|
|
17
|
-
|
|
18
|
-
**Anchor Engine takes a different path.**
|
|
19
|
-
|
|
20
|
-
It's a **deterministic, explainable, CPU‑only memory engine** that runs on anything—from a $200 laptop to a workstation—and retrieves context using a physics‑inspired graph algorithm instead of dense vectors.
|
|
21
|
-
|
|
22
|
-
If you want:
|
|
23
|
-
- **Local‑first AI** – your data stays yours
|
|
24
|
-
- **Explainable retrieval** – know *why* something was returned
|
|
25
|
-
- **Deterministic results** – same query, same answer, every time
|
|
26
|
-
- **Zero cloud dependency** – no API keys, no servers
|
|
27
|
-
- **<1GB RAM usage** – runs alongside your browser
|
|
28
|
-
- **High‑speed ingestion** – 100MB in minutes
|
|
29
|
-
|
|
30
|
-
…then Anchor Engine is built for you.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## ⚡ Quick Start (5 Minutes)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| **
|
|
80
|
-
| **
|
|
81
|
-
| **
|
|
82
|
-
|
|
83
|
-
**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
| **
|
|
100
|
-
| **
|
|
101
|
-
| **
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
###
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
##
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
###
|
|
262
|
-
- **
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
- **
|
|
279
|
-
- **
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
**
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
- [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
1
|
+
# Anchor Engine ⚓
|
|
2
|
+
|
|
3
|
+
**Deterministic semantic memory for LLMs – local-first, graph traversal, <1GB RAM**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/RSBalchII/anchor-engine-node/releases)
|
|
6
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
7
|
+
[](http://makeapullrequest.com)
|
|
8
|
+
[](https://doi.org/10.5281/zenodo.18841399)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🌟 Why Anchor Engine?
|
|
13
|
+
|
|
14
|
+
Modern AI memory is broken.
|
|
15
|
+
|
|
16
|
+
Vector databases demand GPUs, gigabytes of RAM, and cloud infrastructure. They're opaque, expensive, and fundamentally incompatible with personal, local‑first AI.
|
|
17
|
+
|
|
18
|
+
**Anchor Engine takes a different path.**
|
|
19
|
+
|
|
20
|
+
It's a **deterministic, explainable, CPU‑only memory engine** that runs on anything—from a $200 laptop to a workstation—and retrieves context using a physics‑inspired graph algorithm instead of dense vectors.
|
|
21
|
+
|
|
22
|
+
If you want:
|
|
23
|
+
- **Local‑first AI** – your data stays yours
|
|
24
|
+
- **Explainable retrieval** – know *why* something was returned
|
|
25
|
+
- **Deterministic results** – same query, same answer, every time
|
|
26
|
+
- **Zero cloud dependency** – no API keys, no servers
|
|
27
|
+
- **<1GB RAM usage** – runs alongside your browser
|
|
28
|
+
- **High‑speed ingestion** – 100MB in minutes
|
|
29
|
+
|
|
30
|
+
…then Anchor Engine is built for you.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## ⚡ Quick Start (5 Minutes)
|
|
35
|
+
|
|
36
|
+
### Option 1: npm Install (Recommended)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Install the package
|
|
40
|
+
npm install @rbalchii/anchor-engine
|
|
41
|
+
|
|
42
|
+
# Or globally for CLI access
|
|
43
|
+
npm install -g @rbalchii/anchor-engine
|
|
44
|
+
|
|
45
|
+
# Start the engine
|
|
46
|
+
anchor start
|
|
47
|
+
|
|
48
|
+
# Open your browser
|
|
49
|
+
open http://localhost:3160
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Option 2: From Source
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 1. Clone & Install
|
|
56
|
+
git clone https://github.com/RSBalchII/anchor-engine-node.git
|
|
57
|
+
cd anchor-engine-node
|
|
58
|
+
pnpm install
|
|
59
|
+
pnpm build
|
|
60
|
+
|
|
61
|
+
# 2. Start the engine
|
|
62
|
+
pnpm start
|
|
63
|
+
|
|
64
|
+
# 3. Open your browser
|
|
65
|
+
open http://localhost:3160
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
That's it! You now have a sovereign memory system for your LLM.
|
|
69
|
+
|
|
70
|
+
**Full installation guide:** [INSTALL_NPM.md](INSTALL_NPM.md)
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 📊 Anchor Engine vs. Vector RAG
|
|
75
|
+
|
|
76
|
+
| Feature | Anchor Engine | Vector RAG |
|
|
77
|
+
|---------|---------------|------------|
|
|
78
|
+
| **Hardware** | CPU‑only | GPU preferred |
|
|
79
|
+
| **RAM Usage** | <1GB | 4–8GB |
|
|
80
|
+
| **Explainability** | Native (tags, hops, decay) | None (black box) |
|
|
81
|
+
| **Deterministic** | ✅ Yes | ❌ No |
|
|
82
|
+
| **Cloud Required** | ❌ No | Often |
|
|
83
|
+
| **Retrieval Complexity** | O(k·d̄) linear | O(n log n) |
|
|
84
|
+
| **License** | AGPL-3.0 (open) | Varies (often proprietary) |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🧠 The STAR Algorithm
|
|
89
|
+
|
|
90
|
+
Anchor Engine uses **STAR** (Semantic Temporal Associative Retrieval)—a physics‑inspired scoring equation that combines:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
W(q,a) = |T(q) ∩ T(a)| · γ^d(q,a) × e^(−λΔt) × (1 − H(h_q, h_a)/64)
|
|
94
|
+
↑ Semantic Gravity ↑ Temporal Decay ↑ Structural Gravity
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
| Component | What It Does |
|
|
98
|
+
|-----------|--------------|
|
|
99
|
+
| **Semantic Gravity** | Shared tags × hop‑distance damping (γ = 0.85) |
|
|
100
|
+
| **Temporal Decay** | Recent memories pull harder (half-life ~115 min) |
|
|
101
|
+
| **Structural Gravity** | SimHash proximity (64-bit fingerprints) |
|
|
102
|
+
|
|
103
|
+
**Result:** O(k·d̄) retrieval—dramatically faster than vector ANN for personal datasets. Every atom includes **provenance**: shared tags, hop distance, recency, and byte‑range pointers.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## ⚓ Why "Anchor"?
|
|
108
|
+
|
|
109
|
+
> **Drop a query into your memory graph.**
|
|
110
|
+
> **The Anchor finds the semantic bottom.**
|
|
111
|
+
> **The chain plays out to your chosen radius.**
|
|
112
|
+
> **What's retrieved is what's relevant—nothing more, nothing less.**
|
|
113
|
+
> **Same anchor, same spot, same result. Every time.**
|
|
114
|
+
> **This isn't a metaphor. It's the algorithm.**
|
|
115
|
+
|
|
116
|
+
| Anchor Quality | How It Maps to STAR |
|
|
117
|
+
|----------------|---------------------|
|
|
118
|
+
| **Drops to a point** | Query finds seed atoms (anchor discovery) |
|
|
119
|
+
| **Defines a radius** | Chain length = token budget (hop distance) |
|
|
120
|
+
| **Holds against drift** | Deterministic retrieval (no semantic drift) |
|
|
121
|
+
| **Connects to the ship** | Retrieved context → LLM (your ship) |
|
|
122
|
+
| **Works in deep water** | Scales from 10MB to 10GB graphs |
|
|
123
|
+
|
|
124
|
+
The name isn't marketing. It's architecture.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 📥 Ingest Your Data
|
|
129
|
+
|
|
130
|
+
### Option 1: Web UI (Easiest)
|
|
131
|
+
1. Open http://localhost:3160
|
|
132
|
+
2. Click **"Manage Paths"** → Add folders to watch
|
|
133
|
+
3. Or use **"Paste & Ingest"** tab for quick text
|
|
134
|
+
|
|
135
|
+
### Option 2: API
|
|
136
|
+
```bash
|
|
137
|
+
curl -X POST http://localhost:3160/v1/research/upload-raw \
|
|
138
|
+
-H "Content-Type: application/json" \
|
|
139
|
+
-d '{
|
|
140
|
+
"content": "Your text here...",
|
|
141
|
+
"filename": "notes.md",
|
|
142
|
+
"bucket": "inbox"
|
|
143
|
+
}'
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Option 3: MCP (Claude, Cursor, Qwen Code)
|
|
147
|
+
```
|
|
148
|
+
/anchor_ingest_text content="Meeting notes..." filename="meeting.md" bucket="inbox"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 🔍 Search Your Memory
|
|
154
|
+
|
|
155
|
+
### Web UI
|
|
156
|
+
- Natural language queries
|
|
157
|
+
- Adjustable token budget slider
|
|
158
|
+
- Filter by buckets/tags
|
|
159
|
+
|
|
160
|
+
### API
|
|
161
|
+
```bash
|
|
162
|
+
curl -X POST http://localhost:3160/v1/memory/search \
|
|
163
|
+
-H "Content-Type: application/json" \
|
|
164
|
+
-d '{
|
|
165
|
+
"query": "What did we discuss about OAuth?",
|
|
166
|
+
"token_budget": 2048
|
|
167
|
+
}'
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### MCP Tools
|
|
171
|
+
```
|
|
172
|
+
/anchor_query query="OAuth authentication setup"
|
|
173
|
+
/anchor_search_index query="career planning"
|
|
174
|
+
/anchor_fetch_session session_id="abc-123"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 🏛️ Our Philosophy: AI Memory Should Work Like Your Brain
|
|
180
|
+
|
|
181
|
+
Human memory is remarkably efficient. It runs on ~20 watts, forgets irrelevant details, and over time clarifies core truths rather than drowning in noise. It doesn't store raw experiences—it stores *patterns*, *relationships*, and *meaning*.
|
|
182
|
+
|
|
183
|
+
Most AI memory systems do the opposite: they hoard data, brute‑force compute similarity, and require massive infrastructure.
|
|
184
|
+
|
|
185
|
+
**Anchor Engine was built on a different premise: AI memory should work like the human mind—lightweight, connected, and self‑clarifying.**
|
|
186
|
+
|
|
187
|
+
| Principle | What It Means | How Anchor Implements It |
|
|
188
|
+
|-----------|---------------|--------------------------|
|
|
189
|
+
| **🧠 Forgetting is a feature** | The brain forgets constantly, leaving only what matters | `distill:` command removes redundancy; temporal decay |
|
|
190
|
+
| **🔗 Meaning lives in relationships** | We store how concepts connect, not isolated facts | Graph model with typed edges; STAR algorithm |
|
|
191
|
+
| **⚡ Low power, high efficiency** | The brain achieves its magic on ~20 watts | Pointer‑only database; content on disk; <1GB RAM |
|
|
192
|
+
| **💎 Clarity through distillation** | Memory builds higher‑level abstractions over time | Decision Records v2.0 extract the *why* |
|
|
193
|
+
| **🔍 Explainability builds trust** | You know *why* a memory came to mind | Provenance tracking; receipts with timestamps |
|
|
194
|
+
|
|
195
|
+
> **Why This Matters:** Most AI memory systems are built for **scale**, not for **sense**. Anchor Engine is designed for **sense‑making**—for agents that need to remember not just *what* happened, but *why*, and to get *clearer* over time.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🏗️ Architecture at a Glance
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
203
|
+
│ YOU │
|
|
204
|
+
└────────────────────┬────────────────────────────────────────┘
|
|
205
|
+
│
|
|
206
|
+
▼
|
|
207
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
208
|
+
│ ⚡ ANCHOR ENGINE │
|
|
209
|
+
│ (Deterministic Memory Layer) │
|
|
210
|
+
│ │
|
|
211
|
+
│ - Graph traversal (STAR algorithm) │
|
|
212
|
+
│ - Pointer-only index (<1GB RAM) │
|
|
213
|
+
│ - Deterministic retrieval (same query = same result) │
|
|
214
|
+
└────────────────────┬────────────────────────────────────────┘
|
|
215
|
+
│
|
|
216
|
+
┌───────────┼───────────┐
|
|
217
|
+
│ │ │
|
|
218
|
+
▼ ▼ ▼
|
|
219
|
+
┌──────────────┐ ┌──────────┐ ┌─────────────┐
|
|
220
|
+
│ PGlite │ │ mirrored │ │ MCP Clients │
|
|
221
|
+
│ (WASM DB) │ │ _brain/ │ │ (Claude, │
|
|
222
|
+
│ │ │ (Content)│ │ Cursor) │
|
|
223
|
+
└──────────────┘ └──────────┘ └─────────────┘
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Key Insight:** Content lives in `mirrored_brain/` filesystem. Database stores **pointers only** (byte offsets + metadata). This makes the database **disposable and rebuildable**—wipe it and restore in minutes.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 📊 Benchmarks (Real Production Data)
|
|
231
|
+
|
|
232
|
+
**Dataset:** 91MB chat history (~25M tokens)
|
|
233
|
+
|
|
234
|
+
| Metric | Result |
|
|
235
|
+
|--------|--------|
|
|
236
|
+
| **Molecules** | 280,000 |
|
|
237
|
+
| **Atoms** | 151,876 |
|
|
238
|
+
| **Files** | 436 |
|
|
239
|
+
| **Ingestion Time** | 178 seconds |
|
|
240
|
+
| **Search Latency (p95)** | <200ms |
|
|
241
|
+
| **Memory (idle)** | ~600MB |
|
|
242
|
+
| **Memory (peak)** | ~1.6GB |
|
|
243
|
+
| **Restore Speed** | 281,690 atoms in 13.8 min |
|
|
244
|
+
|
|
245
|
+
**Hardware:** AMD Ryzen / Intel i7, 16GB RAM, NVMe SSD, no GPU.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 🛠️ What's New in v4.8.0
|
|
250
|
+
|
|
251
|
+
### MCP Write Operations
|
|
252
|
+
- **`anchor_ingest_text`** - Ingest raw text directly
|
|
253
|
+
- **`anchor_ingest_file`** - Ingest files from filesystem
|
|
254
|
+
- Security toggle (opt-in via `user_settings.json`)
|
|
255
|
+
|
|
256
|
+
### Session Index
|
|
257
|
+
- **`anchor_search_index`** - Fast chat session lookup
|
|
258
|
+
- **`anchor_fetch_session`** - Targeted session retrieval
|
|
259
|
+
- Two-tier memory retrieval
|
|
260
|
+
|
|
261
|
+
### Web UI Improvements
|
|
262
|
+
- **Paste & Ingest** tab - Quick text ingestion
|
|
263
|
+
- Version badge (v4.8.0)
|
|
264
|
+
- Bucket selector (inbox vs external-inbox)
|
|
265
|
+
|
|
266
|
+
### Documentation Overhaul
|
|
267
|
+
- 5 new docs (API, Deployment, Troubleshooting, Source Overview, Testing)
|
|
268
|
+
- Philosophy embedded throughout
|
|
269
|
+
- 7 redundant files archived
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 📚 Documentation
|
|
274
|
+
|
|
275
|
+
### Getting Started
|
|
276
|
+
- **[Quick Start](#-quick-start-5-minutes)** - Install & first query
|
|
277
|
+
- **[docs/API.md](docs/API.md)** - Complete API reference
|
|
278
|
+
- **[docs/DEPLOYMENT.md](docs/DEPLOYMENT.md)** - Deployment guide (local, Docker, VPS, K8s)
|
|
279
|
+
- **[docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** - Common issues & fixes
|
|
280
|
+
|
|
281
|
+
### Deep Dive
|
|
282
|
+
- **[docs/whitepaper.md](docs/whitepaper.md)** - STAR algorithm whitepaper
|
|
283
|
+
- **[specs/spec.md](specs/spec.md)** - System specification with diagrams
|
|
284
|
+
- **[specs/current-standards/](specs/current-standards/)** - Active standards (001-010)
|
|
285
|
+
- **[engine/src/README.md](engine/src/README.md)** - Source code overview
|
|
286
|
+
|
|
287
|
+
### Integration
|
|
288
|
+
- **[mcp-server/README.md](mcp-server/README.md)** - MCP integration (Claude, Cursor, Qwen)
|
|
289
|
+
- **[tests/README.md](tests/README.md)** - Testing guide
|
|
290
|
+
- **[benchmarks/README.md](benchmarks/README.md)** - Performance benchmarks
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 🤝 Contributing
|
|
295
|
+
|
|
296
|
+
We're building in the open and welcome your input!
|
|
297
|
+
|
|
298
|
+
- **Star the repo** – Helps others find it
|
|
299
|
+
- **Open an issue** – Bugs, features, questions
|
|
300
|
+
- **Start a discussion** – Share use cases
|
|
301
|
+
- **Contribute** – PRs welcome!
|
|
302
|
+
|
|
303
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for guidelines.
|
|
304
|
+
|
|
305
|
+
**Community Health:**
|
|
306
|
+
- [`CODEOWNERS`](.github/CODEOWNERS) - Automatic reviewer assignment
|
|
307
|
+
- [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) - Community standards
|
|
308
|
+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) - Contribution guide
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 📜 License
|
|
313
|
+
|
|
314
|
+
AGPL-3.0 – see [LICENSE](LICENSE).
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## 🙏 Acknowledgments
|
|
319
|
+
|
|
320
|
+
Built with ❤️ by Robert Balch II and contributors.
|
|
321
|
+
Inspired by the r/LocalLLaMA and r/aiagents communities.
|
|
322
|
+
|
|
323
|
+
**Citation:**
|
|
324
|
+
```bibtex
|
|
325
|
+
@software{anchor_engine,
|
|
326
|
+
title = {STAR: Semantic Temporal Associative Retrieval},
|
|
327
|
+
author = {Balch II, R.S.},
|
|
328
|
+
version = {4.8.0},
|
|
329
|
+
date = {2026-03-18},
|
|
330
|
+
url = {https://github.com/RSBalchII/anchor-engine-node},
|
|
331
|
+
doi = {10.5281/zenodo.18841399}
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
*Your AI's anchor to reality.* ⚓
|
package/engine/package.json
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "anchor-engine",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Anchor Headless Context Engine & Knowledge Graph",
|
|
6
|
-
"main": "src/index.js",
|
|
7
|
-
"bin": "src/index.js",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"start": "node --expose-gc dist/index.js",
|
|
10
|
-
"dev": "node --loader ts-node/esm src/index.ts",
|
|
11
|
-
"migrate": "node src/migrate_history.js",
|
|
12
|
-
"read-all": "node src/read_all.js",
|
|
13
|
-
"hydrate": "node src/hydrate.js",
|
|
14
|
-
"test:vitest": "vitest run --config vitest.config.ts",
|
|
15
|
-
"test:vitest:watch": "vitest --config vitest.config.ts",
|
|
16
|
-
"test": "node tests/suite.js",
|
|
17
|
-
"test:routes": "node tests/all_routes_and_services.js",
|
|
18
|
-
"test:quick": "node tests/suite.js",
|
|
19
|
-
"test:benchmark": "node tests/benchmark.js",
|
|
20
|
-
"test:context": "node tests/context_experiments.js",
|
|
21
|
-
"test:context-quality": "ts-node ../tests/unit/test_context_quality_improvements.ts",
|
|
22
|
-
"test:date-extractor": "node --loader ts-node/esm tests/unit/test_date_extractor.ts",
|
|
23
|
-
"test:unit": "ts-node ../tests/unit/test_context_quality_improvements.ts",
|
|
24
|
-
"test:vector": "node --loader ts-node/esm tests/unit/test_vector_service.ts",
|
|
25
|
-
"benchmark": "node tests/benchmark.js",
|
|
26
|
-
"build": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc",
|
|
27
|
-
"build:npm-native": "echo \"Native modules now handled via npm packages\"",
|
|
28
|
-
"build:standalone": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc && pkg dist/index.js --target node18-linux-arm64 --output dist-android/anchor-engine --compress GZip && pkg dist/index.js --target node18-win-x64 --output dist-win/anchor-engine.exe --compress GZip",
|
|
29
|
-
"build:win": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc && pkg dist/index.js --target node18-win-x64 --output dist-win/anchor-engine.exe --compress GZip",
|
|
30
|
-
"build:android": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc && pkg dist/index.js --target node18-linux-arm64 --output dist-android/anchor-engine --compress GZip",
|
|
31
|
-
"build:universal": "npm run build",
|
|
32
|
-
"lint": "eslint src/ --ext .ts,.js",
|
|
33
|
-
"chat": "ts-node tools/chat.ts",
|
|
34
|
-
"chat-api": "node dist/server-8080.js",
|
|
35
|
-
"lint:fix": "eslint src/ --ext .ts,.js --fix",
|
|
36
|
-
"generate-synonyms": "node --loader ts-node/esm src/commands/generate-synonyms.ts",
|
|
37
|
-
"audit-tags": "node --loader ts-node/esm src/commands/audit-tags.ts",
|
|
38
|
-
"distill": "node --loader ts-node/esm src/commands/distill.ts"
|
|
39
|
-
},
|
|
40
|
-
"pkg": {
|
|
41
|
-
"scripts": [
|
|
42
|
-
"dist/**/*.js"
|
|
43
|
-
],
|
|
44
|
-
"assets": [
|
|
45
|
-
"dist/**/*",
|
|
46
|
-
"context_data/**/*",
|
|
47
|
-
"user_settings.json",
|
|
48
|
-
"node_modules/@electric-sql/pglite/**/*",
|
|
49
|
-
"node_modules/@rbalchii/anchor-atomizer-wasm/**/*",
|
|
50
|
-
"node_modules/@rbalchii/anchor-fingerprint-wasm/**/*",
|
|
51
|
-
"node_modules/@rbalchii/anchor-keyextract-wasm/**/*",
|
|
52
|
-
"node_modules/@rbalchii/anchor-tagwalker-wasm/**/*",
|
|
53
|
-
"node_modules/wink-eng-lite-web-model/**/*",
|
|
54
|
-
"node_modules/wink-nlp/**/*"
|
|
55
|
-
],
|
|
56
|
-
"targets": [
|
|
57
|
-
"node18-linux-arm64"
|
|
58
|
-
],
|
|
59
|
-
"outputPath": "dist-android",
|
|
60
|
-
"compress": "GZip"
|
|
61
|
-
},
|
|
62
|
-
"dependencies": {
|
|
63
|
-
"@anchor/shared": "file:../shared",
|
|
64
|
-
"@electric-sql/pglite": "^0.2.0",
|
|
65
|
-
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
66
|
-
"@rbalchii/anchor-atomizer-wasm": "^1.0.0",
|
|
67
|
-
"@rbalchii/anchor-fingerprint-wasm": "^1.0.0",
|
|
68
|
-
"@rbalchii/anchor-keyextract-wasm": "^1.0.0",
|
|
69
|
-
"@rbalchii/anchor-tagwalker-wasm": "^1.0.0",
|
|
70
|
-
"@rbalchii/dse": "^1.0.0",
|
|
71
|
-
"@types/body-parser": "^1.19.6",
|
|
72
|
-
"@types/turndown": "^5.0.6",
|
|
73
|
-
"axios": "^1.13.2",
|
|
74
|
-
"body-parser": "^1.20.2",
|
|
75
|
-
"cheerio": "^1.1.2",
|
|
76
|
-
"chokidar": "^3.6.0",
|
|
77
|
-
"cors": "^2.8.5",
|
|
78
|
-
"express": "^4.18.2",
|
|
79
|
-
"express-rate-limit": "^7.4.0",
|
|
80
|
-
"got": "^14.6.6",
|
|
81
|
-
"got-scraping": "^4.1.3",
|
|
82
|
-
"js-yaml": "^4.1.1",
|
|
83
|
-
"sharp": "^0.34.5",
|
|
84
|
-
"tar": "^7.5.10",
|
|
85
|
-
"turndown": "^7.2.2",
|
|
86
|
-
"uuid": "^13.0.0",
|
|
87
|
-
"wink-eng-lite-web-model": "^1.7.1",
|
|
88
|
-
"wink-nlp": "^2.3.0",
|
|
89
|
-
"winston": "^3.19.0",
|
|
90
|
-
"winston-daily-rotate-file": "^5.0.0",
|
|
91
|
-
"zod": "^4.3.6"
|
|
92
|
-
},
|
|
93
|
-
"devDependencies": {
|
|
94
|
-
"@types/cors": "^2.8.19",
|
|
95
|
-
"@types/express": "^5.0.6",
|
|
96
|
-
"@types/js-yaml": "^4.0.9",
|
|
97
|
-
"@types/node": "^25.0.7",
|
|
98
|
-
"@types/tar": "^6.1.13",
|
|
99
|
-
"@yao-pkg/pkg": "^5.12.0",
|
|
100
|
-
"eslint": "^8.56.0",
|
|
101
|
-
"ts-node": "^10.9.2",
|
|
102
|
-
"typescript": "^5.9.3",
|
|
103
|
-
"vitest": "^4.0.18"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "anchor-engine",
|
|
3
|
+
"version": "4.8.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Anchor Headless Context Engine & Knowledge Graph",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"bin": "src/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "node --expose-gc dist/index.js",
|
|
10
|
+
"dev": "node --loader ts-node/esm src/index.ts",
|
|
11
|
+
"migrate": "node src/migrate_history.js",
|
|
12
|
+
"read-all": "node src/read_all.js",
|
|
13
|
+
"hydrate": "node src/hydrate.js",
|
|
14
|
+
"test:vitest": "vitest run --config vitest.config.ts",
|
|
15
|
+
"test:vitest:watch": "vitest --config vitest.config.ts",
|
|
16
|
+
"test": "node tests/suite.js",
|
|
17
|
+
"test:routes": "node tests/all_routes_and_services.js",
|
|
18
|
+
"test:quick": "node tests/suite.js",
|
|
19
|
+
"test:benchmark": "node tests/benchmark.js",
|
|
20
|
+
"test:context": "node tests/context_experiments.js",
|
|
21
|
+
"test:context-quality": "ts-node ../tests/unit/test_context_quality_improvements.ts",
|
|
22
|
+
"test:date-extractor": "node --loader ts-node/esm tests/unit/test_date_extractor.ts",
|
|
23
|
+
"test:unit": "ts-node ../tests/unit/test_context_quality_improvements.ts",
|
|
24
|
+
"test:vector": "node --loader ts-node/esm tests/unit/test_vector_service.ts",
|
|
25
|
+
"benchmark": "node tests/benchmark.js",
|
|
26
|
+
"build": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc",
|
|
27
|
+
"build:npm-native": "echo \"Native modules now handled via npm packages\"",
|
|
28
|
+
"build:standalone": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc && pkg dist/index.js --target node18-linux-arm64 --output dist-android/anchor-engine --compress GZip && pkg dist/index.js --target node18-win-x64 --output dist-win/anchor-engine.exe --compress GZip",
|
|
29
|
+
"build:win": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc && pkg dist/index.js --target node18-win-x64 --output dist-win/anchor-engine.exe --compress GZip",
|
|
30
|
+
"build:android": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && tsc && pkg dist/index.js --target node18-linux-arm64 --output dist-android/anchor-engine --compress GZip",
|
|
31
|
+
"build:universal": "npm run build",
|
|
32
|
+
"lint": "eslint src/ --ext .ts,.js",
|
|
33
|
+
"chat": "ts-node tools/chat.ts",
|
|
34
|
+
"chat-api": "node dist/server-8080.js",
|
|
35
|
+
"lint:fix": "eslint src/ --ext .ts,.js --fix",
|
|
36
|
+
"generate-synonyms": "node --loader ts-node/esm src/commands/generate-synonyms.ts",
|
|
37
|
+
"audit-tags": "node --loader ts-node/esm src/commands/audit-tags.ts",
|
|
38
|
+
"distill": "node --loader ts-node/esm src/commands/distill.ts"
|
|
39
|
+
},
|
|
40
|
+
"pkg": {
|
|
41
|
+
"scripts": [
|
|
42
|
+
"dist/**/*.js"
|
|
43
|
+
],
|
|
44
|
+
"assets": [
|
|
45
|
+
"dist/**/*",
|
|
46
|
+
"context_data/**/*",
|
|
47
|
+
"user_settings.json",
|
|
48
|
+
"node_modules/@electric-sql/pglite/**/*",
|
|
49
|
+
"node_modules/@rbalchii/anchor-atomizer-wasm/**/*",
|
|
50
|
+
"node_modules/@rbalchii/anchor-fingerprint-wasm/**/*",
|
|
51
|
+
"node_modules/@rbalchii/anchor-keyextract-wasm/**/*",
|
|
52
|
+
"node_modules/@rbalchii/anchor-tagwalker-wasm/**/*",
|
|
53
|
+
"node_modules/wink-eng-lite-web-model/**/*",
|
|
54
|
+
"node_modules/wink-nlp/**/*"
|
|
55
|
+
],
|
|
56
|
+
"targets": [
|
|
57
|
+
"node18-linux-arm64"
|
|
58
|
+
],
|
|
59
|
+
"outputPath": "dist-android",
|
|
60
|
+
"compress": "GZip"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@anchor/shared": "file:../shared",
|
|
64
|
+
"@electric-sql/pglite": "^0.2.0",
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
66
|
+
"@rbalchii/anchor-atomizer-wasm": "^1.0.0",
|
|
67
|
+
"@rbalchii/anchor-fingerprint-wasm": "^1.0.0",
|
|
68
|
+
"@rbalchii/anchor-keyextract-wasm": "^1.0.0",
|
|
69
|
+
"@rbalchii/anchor-tagwalker-wasm": "^1.0.0",
|
|
70
|
+
"@rbalchii/dse": "^1.0.0",
|
|
71
|
+
"@types/body-parser": "^1.19.6",
|
|
72
|
+
"@types/turndown": "^5.0.6",
|
|
73
|
+
"axios": "^1.13.2",
|
|
74
|
+
"body-parser": "^1.20.2",
|
|
75
|
+
"cheerio": "^1.1.2",
|
|
76
|
+
"chokidar": "^3.6.0",
|
|
77
|
+
"cors": "^2.8.5",
|
|
78
|
+
"express": "^4.18.2",
|
|
79
|
+
"express-rate-limit": "^7.4.0",
|
|
80
|
+
"got": "^14.6.6",
|
|
81
|
+
"got-scraping": "^4.1.3",
|
|
82
|
+
"js-yaml": "^4.1.1",
|
|
83
|
+
"sharp": "^0.34.5",
|
|
84
|
+
"tar": "^7.5.10",
|
|
85
|
+
"turndown": "^7.2.2",
|
|
86
|
+
"uuid": "^13.0.0",
|
|
87
|
+
"wink-eng-lite-web-model": "^1.7.1",
|
|
88
|
+
"wink-nlp": "^2.3.0",
|
|
89
|
+
"winston": "^3.19.0",
|
|
90
|
+
"winston-daily-rotate-file": "^5.0.0",
|
|
91
|
+
"zod": "^4.3.6"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@types/cors": "^2.8.19",
|
|
95
|
+
"@types/express": "^5.0.6",
|
|
96
|
+
"@types/js-yaml": "^4.0.9",
|
|
97
|
+
"@types/node": "^25.0.7",
|
|
98
|
+
"@types/tar": "^6.1.13",
|
|
99
|
+
"@yao-pkg/pkg": "^5.12.0",
|
|
100
|
+
"eslint": "^8.56.0",
|
|
101
|
+
"ts-node": "^10.9.2",
|
|
102
|
+
"typescript": "^5.9.3",
|
|
103
|
+
"vitest": "^4.0.18"
|
|
104
|
+
}
|
|
105
|
+
}
|