@pyxmate/memory 0.1.3-beta → 0.1.4-beta
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/package.json
CHANGED
|
@@ -98,19 +98,20 @@ import { Memory } from '@pyx-memory/core';
|
|
|
98
98
|
const memory = new Memory({ dataDir: './data' });
|
|
99
99
|
await memory.initialize(); // REQUIRED — throws if you skip this
|
|
100
100
|
|
|
101
|
-
// Store (default targets: sqlite + vector)
|
|
101
|
+
// Store (default targets: sqlite + vector; or sqlite + vector + graph when graphStore configured)
|
|
102
|
+
// When graphStore is configured, graph is auto-included in defaults.
|
|
103
|
+
// If no entities provided, graph is silently skipped.
|
|
102
104
|
await memory.store({
|
|
103
105
|
content: 'User prefers dark mode',
|
|
104
106
|
type: 'long-term',
|
|
105
107
|
metadata: { source: 'settings' },
|
|
106
108
|
});
|
|
107
109
|
|
|
108
|
-
// Store with graph
|
|
110
|
+
// Store with entities — graph is populated automatically when graphStore configured
|
|
109
111
|
await memory.store({
|
|
110
112
|
content: 'Alice works at Acme Corp',
|
|
111
113
|
type: 'long-term',
|
|
112
114
|
metadata: {},
|
|
113
|
-
targets: ['sqlite', 'vector', 'graph'],
|
|
114
115
|
entities: [
|
|
115
116
|
{ name: 'Alice', type: 'PERSON' },
|
|
116
117
|
{ name: 'Acme Corp', type: 'ORGANIZATION' },
|
|
@@ -187,7 +188,7 @@ For RAG strategies, bi-temporal model, consolidation, and community detection, s
|
|
|
187
188
|
|
|
188
189
|
- **DO** call `await memory.initialize()` before any operation
|
|
189
190
|
- **DO** call `await memory.shutdown()` when done (releases SQLite + LanceDB)
|
|
190
|
-
- **DO** provide `entities`
|
|
191
|
+
- **DO** provide `entities` to populate the graph — graph is auto-included in defaults when graphStore is configured, but silently skipped if no entities are provided
|
|
191
192
|
- **DO** initialize GraphStore BEFORE constructing Memory
|
|
192
193
|
- **DO** use `new Memory()` when you need lifecycle methods (ExtendedMemoryInterface)
|
|
193
194
|
- **DO** use `':memory:'` dataDir for tests
|
|
@@ -199,8 +200,7 @@ For RAG strategies, bi-temporal model, consolidation, and community detection, s
|
|
|
199
200
|
### DON'T
|
|
200
201
|
|
|
201
202
|
- **DON'T** assume `createMemory()` returns `ExtendedMemoryInterface` — it returns `MemoryInterface`
|
|
202
|
-
- **DON'T** use `targets: ['graph']` without
|
|
203
|
-
- **DON'T** use `targets: ['graph']` without a configured `graphStore` — throws MemoryError
|
|
203
|
+
- **DON'T** use `targets: ['graph']` without a configured `graphStore` — throws MemoryError (but graph without entities is fine — silently skipped)
|
|
204
204
|
- **DON'T** use `strategy: 'graph'` without passing `graphStore` — throws "RAG strategy not registered"
|
|
205
205
|
- **DON'T** use `strategy: 'agentic'` without passing `reasoningProvider`
|
|
206
206
|
- **DON'T** construct multiple Memory instances with the same `dataDir` — LanceDB singleton causes conflicts
|