@mastra/memory 1.23.1-alpha.0 → 1.23.1-alpha.1
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/CHANGELOG.md +9 -0
- package/dist/{chunk-OHNH3BMB.cjs → chunk-YNTQFC3L.cjs} +56 -25
- package/dist/chunk-YNTQFC3L.cjs.map +1 -0
- package/dist/{chunk-2DC67EL3.js → chunk-YXN553WT.js} +56 -25
- package/dist/chunk-YXN553WT.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +47 -47
- package/dist/docs/references/docs-long-running-agents-background-tasks.md +2 -2
- package/dist/docs/references/docs-memory-observational-memory.md +77 -2
- package/dist/docs/references/docs-memory-overview.md +4 -0
- package/dist/docs/references/reference-memory-observational-memory.md +21 -0
- package/dist/docs/references/reference-processors-token-limiter-processor.md +1 -3
- package/dist/docs/references/reference-vectors-mongodb.md +2 -0
- package/dist/index.cjs +15 -15
- package/dist/index.js +1 -1
- package/dist/{observational-memory-WJPGK55S.cjs → observational-memory-OD3W7JXC.cjs} +29 -29
- package/dist/{observational-memory-WJPGK55S.cjs.map → observational-memory-OD3W7JXC.cjs.map} +1 -1
- package/dist/{observational-memory-DH3LMZPZ.js → observational-memory-ZYY4KPCN.js} +3 -3
- package/dist/{observational-memory-DH3LMZPZ.js.map → observational-memory-ZYY4KPCN.js.map} +1 -1
- package/dist/processors/index.cjs +27 -27
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -1
- package/dist/processors/observational-memory/reflector-runner.d.ts.map +1 -1
- package/dist/processors/observational-memory/retry.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-2DC67EL3.js.map +0 -1
- package/dist/chunk-OHNH3BMB.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,133 +1,133 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.23.1-alpha.
|
|
2
|
+
"version": "1.23.1-alpha.1",
|
|
3
3
|
"package": "@mastra/memory",
|
|
4
4
|
"exports": {
|
|
5
5
|
"Extractor": {
|
|
6
6
|
"types": "dist/processors/index.d.ts",
|
|
7
|
-
"implementation": "dist/chunk-
|
|
7
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
8
8
|
"line": 316
|
|
9
9
|
},
|
|
10
10
|
"ModelByInputTokens": {
|
|
11
11
|
"types": "dist/processors/index.d.ts",
|
|
12
|
-
"implementation": "dist/chunk-
|
|
12
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
13
13
|
"line": 1354
|
|
14
14
|
},
|
|
15
15
|
"OBSERVER_SYSTEM_PROMPT": {
|
|
16
16
|
"types": "dist/processors/index.d.ts",
|
|
17
|
-
"implementation": "dist/chunk-
|
|
17
|
+
"implementation": "dist/chunk-YXN553WT.js"
|
|
18
18
|
},
|
|
19
19
|
"ObservationalMemory": {
|
|
20
20
|
"types": "dist/processors/index.d.ts",
|
|
21
|
-
"implementation": "dist/chunk-
|
|
22
|
-
"line":
|
|
21
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
22
|
+
"line": 28549
|
|
23
23
|
},
|
|
24
24
|
"ObservationalMemoryProcessor": {
|
|
25
25
|
"types": "dist/processors/index.d.ts",
|
|
26
|
-
"implementation": "dist/chunk-
|
|
27
|
-
"line":
|
|
26
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
27
|
+
"line": 31183
|
|
28
28
|
},
|
|
29
29
|
"TokenCounter": {
|
|
30
30
|
"types": "dist/processors/index.d.ts",
|
|
31
|
-
"implementation": "dist/chunk-
|
|
32
|
-
"line":
|
|
31
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
32
|
+
"line": 22331
|
|
33
33
|
},
|
|
34
34
|
"WorkingMemoryExtractor": {
|
|
35
35
|
"types": "dist/processors/index.d.ts",
|
|
36
|
-
"implementation": "dist/chunk-
|
|
37
|
-
"line":
|
|
36
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
37
|
+
"line": 22998
|
|
38
38
|
},
|
|
39
39
|
"buildObserverPrompt": {
|
|
40
40
|
"types": "dist/processors/index.d.ts",
|
|
41
|
-
"implementation": "dist/chunk-
|
|
41
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
42
42
|
"line": 4504
|
|
43
43
|
},
|
|
44
44
|
"buildObserverSystemPrompt": {
|
|
45
45
|
"types": "dist/processors/index.d.ts",
|
|
46
|
-
"implementation": "dist/chunk-
|
|
46
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
47
47
|
"line": 3771
|
|
48
48
|
},
|
|
49
49
|
"combineObservationGroupRanges": {
|
|
50
50
|
"types": "dist/processors/index.d.ts",
|
|
51
|
-
"implementation": "dist/chunk-
|
|
51
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
52
52
|
"line": 1446
|
|
53
53
|
},
|
|
54
54
|
"deriveObservationGroupProvenance": {
|
|
55
55
|
"types": "dist/processors/index.d.ts",
|
|
56
|
-
"implementation": "dist/chunk-
|
|
56
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
57
57
|
"line": 1480
|
|
58
58
|
},
|
|
59
59
|
"extractCurrentTask": {
|
|
60
60
|
"types": "dist/processors/index.d.ts",
|
|
61
|
-
"implementation": "dist/chunk-
|
|
61
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
62
62
|
"line": 4627
|
|
63
63
|
},
|
|
64
64
|
"formatMessagesForObserver": {
|
|
65
65
|
"types": "dist/processors/index.d.ts",
|
|
66
|
-
"implementation": "dist/chunk-
|
|
66
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
67
67
|
"line": 4226
|
|
68
68
|
},
|
|
69
69
|
"getObservationsAsOf": {
|
|
70
70
|
"types": "dist/processors/index.d.ts",
|
|
71
|
-
"implementation": "dist/chunk-
|
|
72
|
-
"line":
|
|
71
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
72
|
+
"line": 31405
|
|
73
73
|
},
|
|
74
74
|
"hasCurrentTaskSection": {
|
|
75
75
|
"types": "dist/processors/index.d.ts",
|
|
76
|
-
"implementation": "dist/chunk-
|
|
76
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
77
77
|
"line": 4615
|
|
78
78
|
},
|
|
79
79
|
"injectAnchorIds": {
|
|
80
80
|
"types": "dist/processors/index.d.ts",
|
|
81
|
-
"implementation": "dist/chunk-
|
|
81
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
82
82
|
"line": 3326
|
|
83
83
|
},
|
|
84
84
|
"optimizeObservationsForContext": {
|
|
85
85
|
"types": "dist/processors/index.d.ts",
|
|
86
|
-
"implementation": "dist/chunk-
|
|
86
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
87
87
|
"line": 4638
|
|
88
88
|
},
|
|
89
89
|
"parseAnchorId": {
|
|
90
90
|
"types": "dist/processors/index.d.ts",
|
|
91
|
-
"implementation": "dist/chunk-
|
|
91
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
92
92
|
"line": 3299
|
|
93
93
|
},
|
|
94
94
|
"parseObservationGroups": {
|
|
95
95
|
"types": "dist/processors/index.d.ts",
|
|
96
|
-
"implementation": "dist/chunk-
|
|
96
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
97
97
|
"line": 1415
|
|
98
98
|
},
|
|
99
99
|
"parseObserverOutput": {
|
|
100
100
|
"types": "dist/processors/index.d.ts",
|
|
101
|
-
"implementation": "dist/chunk-
|
|
101
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
102
102
|
"line": 4518
|
|
103
103
|
},
|
|
104
104
|
"reconcileObservationGroupsFromReflection": {
|
|
105
105
|
"types": "dist/processors/index.d.ts",
|
|
106
|
-
"implementation": "dist/chunk-
|
|
106
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
107
107
|
"line": 1504
|
|
108
108
|
},
|
|
109
109
|
"renderObservationGroupsForReflection": {
|
|
110
110
|
"types": "dist/processors/index.d.ts",
|
|
111
|
-
"implementation": "dist/chunk-
|
|
111
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
112
112
|
"line": 1460
|
|
113
113
|
},
|
|
114
114
|
"stripEphemeralAnchorIds": {
|
|
115
115
|
"types": "dist/processors/index.d.ts",
|
|
116
|
-
"implementation": "dist/chunk-
|
|
116
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
117
117
|
"line": 3356
|
|
118
118
|
},
|
|
119
119
|
"stripObservationGroups": {
|
|
120
120
|
"types": "dist/processors/index.d.ts",
|
|
121
|
-
"implementation": "dist/chunk-
|
|
121
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
122
122
|
"line": 1437
|
|
123
123
|
},
|
|
124
124
|
"summarizeConversation": {
|
|
125
125
|
"types": "dist/processors/index.d.ts",
|
|
126
|
-
"implementation": "dist/chunk-
|
|
126
|
+
"implementation": "dist/chunk-YXN553WT.js"
|
|
127
127
|
},
|
|
128
128
|
"wrapInObservationGroup": {
|
|
129
129
|
"types": "dist/processors/index.d.ts",
|
|
130
|
-
"implementation": "dist/chunk-
|
|
130
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
131
131
|
"line": 1408
|
|
132
132
|
},
|
|
133
133
|
"OBSERVATIONAL_MEMORY_DEFAULTS": {
|
|
@@ -148,44 +148,44 @@
|
|
|
148
148
|
},
|
|
149
149
|
"Memory": {
|
|
150
150
|
"types": "dist/index.d.ts",
|
|
151
|
-
"implementation": "dist/chunk-
|
|
152
|
-
"line":
|
|
151
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
152
|
+
"line": 24423
|
|
153
153
|
},
|
|
154
154
|
"MessageHistory": {
|
|
155
155
|
"types": "dist/index.d.ts",
|
|
156
|
-
"implementation": "dist/chunk-
|
|
156
|
+
"implementation": "dist/chunk-YXN553WT.js"
|
|
157
157
|
},
|
|
158
158
|
"SUMMARIZE_THREAD_DEFAULTS": {
|
|
159
159
|
"types": "dist/index.d.ts",
|
|
160
|
-
"implementation": "dist/chunk-
|
|
160
|
+
"implementation": "dist/chunk-YXN553WT.js"
|
|
161
161
|
},
|
|
162
162
|
"SemanticRecall": {
|
|
163
163
|
"types": "dist/index.d.ts",
|
|
164
|
-
"implementation": "dist/chunk-
|
|
164
|
+
"implementation": "dist/chunk-YXN553WT.js"
|
|
165
165
|
},
|
|
166
166
|
"WorkingMemory": {
|
|
167
167
|
"types": "dist/index.d.ts",
|
|
168
|
-
"implementation": "dist/chunk-
|
|
168
|
+
"implementation": "dist/chunk-YXN553WT.js"
|
|
169
169
|
},
|
|
170
170
|
"deepMergeWorkingMemory": {
|
|
171
171
|
"types": "dist/index.d.ts",
|
|
172
|
-
"implementation": "dist/chunk-
|
|
173
|
-
"line":
|
|
172
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
173
|
+
"line": 24062
|
|
174
174
|
},
|
|
175
175
|
"extractWorkingMemoryContent": {
|
|
176
176
|
"types": "dist/index.d.ts",
|
|
177
|
-
"implementation": "dist/chunk-
|
|
178
|
-
"line":
|
|
177
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
178
|
+
"line": 24378
|
|
179
179
|
},
|
|
180
180
|
"extractWorkingMemoryTags": {
|
|
181
181
|
"types": "dist/index.d.ts",
|
|
182
|
-
"implementation": "dist/chunk-
|
|
183
|
-
"line":
|
|
182
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
183
|
+
"line": 24346
|
|
184
184
|
},
|
|
185
185
|
"removeWorkingMemoryTags": {
|
|
186
186
|
"types": "dist/index.d.ts",
|
|
187
|
-
"implementation": "dist/chunk-
|
|
188
|
-
"line":
|
|
187
|
+
"implementation": "dist/chunk-YXN553WT.js",
|
|
188
|
+
"line": 24359
|
|
189
189
|
},
|
|
190
190
|
"WORKING_MEMORY_STATE_ID": {
|
|
191
191
|
"types": "dist/index.d.ts",
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"processors": {
|
|
206
206
|
"index": "dist/processors/index.js",
|
|
207
207
|
"chunks": [
|
|
208
|
-
"chunk-
|
|
208
|
+
"chunk-YXN553WT.js",
|
|
209
209
|
"chunk-LSJJAJAF.js"
|
|
210
210
|
]
|
|
211
211
|
}
|
|
@@ -8,7 +8,7 @@ Observational Memory (OM) is Mastra's memory system for long-context agentic mem
|
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Ensure you have `@mastra/memory` installed in your project. Set `observationalMemory: true` in your Memory config to enable Observational Memory.
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Memory } from '@mastra/memory'
|
|
@@ -27,7 +27,54 @@ export const agent = new Agent({
|
|
|
27
27
|
})
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
**For AI agents:** Using Observational Memory requires a storage provider! You either need to set it on the Mastra instance at `src/mastra/index.ts` or pass it to the Agent constructor.
|
|
31
|
+
|
|
32
|
+
The following script creates a local LibSQL database, enables Observational Memory, and uses one resource and thread across two agent calls:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { Agent } from '@mastra/core/agent'
|
|
36
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
37
|
+
import { Memory } from '@mastra/memory'
|
|
38
|
+
|
|
39
|
+
const memory = new Memory({
|
|
40
|
+
storage: new LibSQLStore({
|
|
41
|
+
id: 'memory-storage',
|
|
42
|
+
url: 'file:./memory.db',
|
|
43
|
+
}),
|
|
44
|
+
options: {
|
|
45
|
+
observationalMemory: {
|
|
46
|
+
model: 'openai/gpt-5-mini',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const agent = new Agent({
|
|
52
|
+
id: 'memory-agent',
|
|
53
|
+
name: 'Memory Agent',
|
|
54
|
+
instructions: 'You are a helpful assistant.',
|
|
55
|
+
model: 'openai/gpt-5-mini',
|
|
56
|
+
memory,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const memoryOptions = {
|
|
60
|
+
resource: 'user-123',
|
|
61
|
+
thread: 'conversation-123',
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const firstResponse = await agent.generate('Remember that my favorite color is blue.', {
|
|
65
|
+
memory: memoryOptions,
|
|
66
|
+
})
|
|
67
|
+
console.log(firstResponse.text)
|
|
68
|
+
|
|
69
|
+
const secondResponse = await agent.generate('What is my favorite color?', {
|
|
70
|
+
memory: memoryOptions,
|
|
71
|
+
})
|
|
72
|
+
console.log(secondResponse.text)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The `resource` identifies the user or entity, while the `thread` identifies the conversation. Reuse both values to continue the same conversation. Observational Memory processes the stored history as it grows and replaces older messages with observations when its activation conditions are met.
|
|
76
|
+
|
|
77
|
+
The agent now has humanlike long-term memory that persists across conversations. Setting `observationalMemory: true` uses `google/gemini-2.5-flash` by default. To use a different model, pass it in the config object:
|
|
31
78
|
|
|
32
79
|
```typescript
|
|
33
80
|
const memory = new Memory({
|
|
@@ -237,6 +284,34 @@ new Extractor({
|
|
|
237
284
|
})
|
|
238
285
|
```
|
|
239
286
|
|
|
287
|
+
#### Read extracted values from a stream
|
|
288
|
+
|
|
289
|
+
Extractor results are emitted when OM completes an observation or reflection. Read both completion data parts from the stream:
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
const stream = await agent.stream('Remember that I prefer dark mode.')
|
|
293
|
+
|
|
294
|
+
for await (const chunk of stream.fullStream) {
|
|
295
|
+
if (chunk.type === 'data-om-observation-end' || chunk.type === 'data-om-buffering-end') {
|
|
296
|
+
const { operationType, extractedValues = {}, extractionFailures = [] } = chunk.data
|
|
297
|
+
|
|
298
|
+
for (const [slug, value] of Object.entries(extractedValues)) {
|
|
299
|
+
console.log(`${operationType} extractor ${slug}:`, value)
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
for (const failure of extractionFailures) {
|
|
303
|
+
console.error(`Extractor ${failure.slug} failed:`, failure.error)
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
`extractedValues` uses each extractor's slug as its key. Both result fields are optional, and a failed extractor doesn't remove values from successful extractors.
|
|
310
|
+
|
|
311
|
+
`data-om-observation-end` reports a synchronous completion. `data-om-buffering-end` reports completed background work. Its extractor metadata is persisted immediately, but the buffered content remains inactive until activation. Check `operationType` to determine whether the completed work was an observation or reflection.
|
|
312
|
+
|
|
313
|
+
See the [`data-om-observation-end`](https://mastra.ai/reference/memory/observational-memory) and [`data-om-buffering-end`](https://mastra.ai/reference/memory/observational-memory) reference tables for the complete payloads.
|
|
314
|
+
|
|
240
315
|
### Working memory updates
|
|
241
316
|
|
|
242
317
|
Use `observationalMemory.observation.manageWorkingMemory` to let the Observer manage working memory automatically. The main agent no longer needs to call the working memory tool while it handles the user request, so working memory updates don't depend on the agent remembering to make them.
|
|
@@ -81,6 +81,8 @@ Use memory when your agent needs to maintain multi-turn conversations that refer
|
|
|
81
81
|
|
|
82
82
|
3. Add the storage provider to your main Mastra instance to enable memory across all configured agents.
|
|
83
83
|
|
|
84
|
+
**For AI agents:** Important: Add `id` to `LibSQLStore`.
|
|
85
|
+
|
|
84
86
|
```typescript
|
|
85
87
|
import { Mastra } from '@mastra/core'
|
|
86
88
|
import { LibSQLStore } from '@mastra/libsql'
|
|
@@ -151,6 +153,8 @@ To list all threads for a resource, or retrieve a specific thread, [use the memo
|
|
|
151
153
|
|
|
152
154
|
For long-running conversations, raw message history grows until it fills the context window, degrading agent performance. [Observational Memory](https://mastra.ai/docs/memory/observational-memory) solves this by running background agents that compress old messages into dense observations, keeping the context window small while preserving long-term memory.
|
|
153
155
|
|
|
156
|
+
**For AI agents:** Using Observational Memory requires a storage provider! You either need to set it on the Mastra instance at `src/mastra/index.ts` or pass it to the Agent constructor.
|
|
157
|
+
|
|
154
158
|
```typescript
|
|
155
159
|
import { Agent } from '@mastra/core/agent'
|
|
156
160
|
import { Memory } from '@mastra/memory'
|
|
@@ -408,6 +408,27 @@ Setting `bufferTokens: false` disables both observation and reflection async buf
|
|
|
408
408
|
|
|
409
409
|
Observational Memory emits typed data parts during agent execution that clients can use for real-time UI feedback. These are streamed alongside the agent's response.
|
|
410
410
|
|
|
411
|
+
### Read extractor results
|
|
412
|
+
|
|
413
|
+
Both completion events carry extractor output in their `data` payload. The extractor fields are:
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
interface DataOmObservationEndPart {
|
|
417
|
+
type: 'data-om-observation-end'
|
|
418
|
+
data: {
|
|
419
|
+
/** Whether the completed work was an observation or reflection */
|
|
420
|
+
operationType: 'observation' | 'reflection'
|
|
421
|
+
/** Values extracted during this OM operation, keyed by extractor slug */
|
|
422
|
+
extractedValues?: Record<string, unknown>
|
|
423
|
+
/** Extractor failures from this OM operation. Successful extractor values are still included */
|
|
424
|
+
extractionFailures?: Array<{ slug: string; error: string }>
|
|
425
|
+
// ...other fields documented in the tables below
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Both extractor fields are optional. A completion can include values, failures, both, or neither. `data-om-observation-end` reports synchronous completion. `data-om-buffering-end` reports completed background work whose buffered content still awaits activation, although extractor metadata is already persisted. `DataOmBufferingEndPart` carries the same extractor fields, and both types are exported from `@mastra/memory/processors`. See [Read extracted values from a stream](https://mastra.ai/docs/memory/observational-memory) for a consumer example.
|
|
431
|
+
|
|
411
432
|
### `data-om-status`
|
|
412
433
|
|
|
413
434
|
Emitted once per agent loop step, before model generation. Provides a snapshot of the current memory state, including token usage for both context windows and the state of any async buffered content.
|
|
@@ -85,9 +85,7 @@ export const agent = new Agent({
|
|
|
85
85
|
name: 'context-limited-agent',
|
|
86
86
|
instructions: 'You are a helpful assistant',
|
|
87
87
|
model: 'openai/gpt-5.5',
|
|
88
|
-
memory: new Memory({
|
|
89
|
-
/* ... */
|
|
90
|
-
}),
|
|
88
|
+
memory: new Memory({/* ... */}),
|
|
91
89
|
inputProcessors: [
|
|
92
90
|
new TokenLimiterProcessor({ limit: 4000 }), // Limits historical messages to ~4000 tokens
|
|
93
91
|
],
|
|
@@ -89,6 +89,8 @@ Creates a new vector index (collection) in MongoDB.
|
|
|
89
89
|
|
|
90
90
|
**metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search (Default: `cosine`)
|
|
91
91
|
|
|
92
|
+
**filterFields** (`string[]`): Metadata field names to declare as filter fields in the Atlas vectorSearch index (registered as metadata.\<field>). Queries that filter only on declared fields are pushed directly into $vectorSearch instead of pre-filtering candidate \_ids, avoiding the 16 MB BSON limit on large result sets. Filters that reference an undeclared field, or use an operator $vectorSearch does not support, fall back to the pre-filter automatically.
|
|
93
|
+
|
|
92
94
|
### `waitForIndexReady()`
|
|
93
95
|
|
|
94
96
|
Waits for an index to become ready after creation. Useful when you need to ensure an index is ready before performing operations.
|
package/dist/index.cjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYNTQFC3L_cjs = require('./chunk-YNTQFC3L.cjs');
|
|
4
4
|
var chunk43FJOLKM_cjs = require('./chunk-43FJOLKM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Extractor", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkYNTQFC3L_cjs.Extractor; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "Memory", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkYNTQFC3L_cjs.Memory; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "MessageHistory", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkYNTQFC3L_cjs.MessageHistory; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ModelByInputTokens", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkYNTQFC3L_cjs.ModelByInputTokens; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "SUMMARIZE_THREAD_DEFAULTS", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkYNTQFC3L_cjs.SUMMARIZE_THREAD_DEFAULTS; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "SemanticRecall", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkYNTQFC3L_cjs.SemanticRecall; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "WorkingMemory", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkYNTQFC3L_cjs.WorkingMemory; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "WorkingMemoryExtractor", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkYNTQFC3L_cjs.WorkingMemoryExtractor; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "deepMergeWorkingMemory", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkYNTQFC3L_cjs.deepMergeWorkingMemory; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "extractWorkingMemoryContent", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkYNTQFC3L_cjs.extractWorkingMemoryContent; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "extractWorkingMemoryTags", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkYNTQFC3L_cjs.extractWorkingMemoryTags; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkYNTQFC3L_cjs.getObservationsAsOf; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "removeWorkingMemoryTags", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkYNTQFC3L_cjs.removeWorkingMemoryTags; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "summarizeConversation", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkYNTQFC3L_cjs.summarizeConversation; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "WORKING_MEMORY_STATE_ID", {
|
|
65
65
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Extractor, Memory, MessageHistory, ModelByInputTokens, SUMMARIZE_THREAD_DEFAULTS, SemanticRecall, WorkingMemory, WorkingMemoryExtractor, deepMergeWorkingMemory, extractWorkingMemoryContent, extractWorkingMemoryTags, getObservationsAsOf, removeWorkingMemoryTags, summarizeConversation } from './chunk-
|
|
1
|
+
export { Extractor, Memory, MessageHistory, ModelByInputTokens, SUMMARIZE_THREAD_DEFAULTS, SemanticRecall, WorkingMemory, WorkingMemoryExtractor, deepMergeWorkingMemory, extractWorkingMemoryContent, extractWorkingMemoryTags, getObservationsAsOf, removeWorkingMemoryTags, summarizeConversation } from './chunk-YXN553WT.js';
|
|
2
2
|
export { WORKING_MEMORY_STATE_ID, WORKING_MEMORY_STATE_PROCESSOR_ID, WorkingMemoryStateProcessor } from './chunk-WCGXQIEN.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|