@claude-flow/memory 3.0.0-alpha.16 → 3.0.0-alpha.17
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 +60 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,66 @@
|
|
|
28
28
|
npm install @claude-flow/memory
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
## Standalone use (without the Ruflo CLI)
|
|
32
|
+
|
|
33
|
+
This package works on its own — you don't need `@claude-flow/cli` or the
|
|
34
|
+
full Ruflo install. Use it any time you want HNSW vector search, an
|
|
35
|
+
AgentDB façade, or the v3 controller registry from your own app.
|
|
36
|
+
|
|
37
|
+
Two recipes that exercise the most-installed surface:
|
|
38
|
+
|
|
39
|
+
### Recipe 1 — HNSW index with built-in quantization (no other deps)
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
// recipe.mjs
|
|
43
|
+
import { HNSWIndex } from '@claude-flow/memory';
|
|
44
|
+
|
|
45
|
+
const index = new HNSWIndex({
|
|
46
|
+
dimensions: 8,
|
|
47
|
+
M: 16,
|
|
48
|
+
efConstruction: 200,
|
|
49
|
+
metric: 'cosine',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Add a few vectors
|
|
53
|
+
await index.addPoint('doc-a', new Float32Array([1, 0, 0, 0, 0, 0, 0, 0]));
|
|
54
|
+
await index.addPoint('doc-b', new Float32Array([0.9, 0.1, 0, 0, 0, 0, 0, 0]));
|
|
55
|
+
await index.addPoint('doc-c', new Float32Array([0, 1, 0, 0, 0, 0, 0, 0]));
|
|
56
|
+
|
|
57
|
+
// Search — top 2 nearest to "doc-a"-shaped query
|
|
58
|
+
const hits = await index.search(new Float32Array([1, 0, 0, 0, 0, 0, 0, 0]), 2);
|
|
59
|
+
console.log(hits); // [{ id: 'doc-a', distance: 0 }, { id: 'doc-b', distance: ~0.005 }]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Recipe 2 — Drive the controller registry against your own AgentDB
|
|
63
|
+
|
|
64
|
+
The registry coordinates 15+ memory controllers (learning bridge, memory
|
|
65
|
+
graph, tiered cache, vector backend, etc.) on top of an AgentDB instance
|
|
66
|
+
you own. Useful when you already have an AgentDB lifecycle and just
|
|
67
|
+
want the v3 governance layer (issue #2019 added the `agentdb` injection
|
|
68
|
+
field that makes this clean).
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { ControllerRegistry } from '@claude-flow/memory';
|
|
72
|
+
import { AgentDB } from 'agentdb';
|
|
73
|
+
|
|
74
|
+
const agentdb = new AgentDB({ dbPath: ':memory:' });
|
|
75
|
+
await agentdb.initialize();
|
|
76
|
+
|
|
77
|
+
const registry = new ControllerRegistry();
|
|
78
|
+
await registry.initialize({ agentdb });
|
|
79
|
+
|
|
80
|
+
// Now everything backed by AgentDB is reachable through the registry
|
|
81
|
+
const reflexion = registry.get('reflexion'); // ReflexionMemory
|
|
82
|
+
const vectorBackend = registry.get('vectorBackend'); // live vector backend
|
|
83
|
+
const enabled = registry.isEnabled('skills'); // true
|
|
84
|
+
|
|
85
|
+
const health = await registry.healthCheck();
|
|
86
|
+
console.log(`${health.activeControllers}/${health.controllers.length} controllers active`);
|
|
87
|
+
|
|
88
|
+
await registry.shutdown();
|
|
89
|
+
```
|
|
90
|
+
|
|
31
91
|
## Quick Start
|
|
32
92
|
|
|
33
93
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/memory",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Memory module - AgentDB unification, HNSW indexing, vector search, hybrid SQLite+AgentDB backend (ADR-009)",
|
|
6
6
|
"main": "dist/index.js",
|