@voltagent/core 2.6.5 → 2.6.7
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/dist/index.d.mts +63 -7
- package/dist/index.d.ts +63 -7
- package/dist/index.js +266 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +266 -162
- package/dist/index.mjs.map +1 -1
- package/docs/agents/memory/in-memory.md +8 -4
- package/docs/agents/memory/overview.md +19 -10
- package/docs/agents/memory/semantic-search.md +21 -13
- package/docs/agents/memory/working-memory.md +19 -8
- package/docs/agents/memory.md +8 -4
- package/docs/agents/overview.md +10 -4
- package/docs/agents/voltagent-instance.md +2 -1
- package/docs/api/api-reference.md +19 -3
- package/docs/api/endpoints/agents.md +48 -17
- package/docs/ui/ai-sdk-integration.md +56 -28
- package/docs/ui/assistant-ui.md +4 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8390,6 +8390,41 @@ interface AgentEvalConfig {
|
|
|
8390
8390
|
sampling?: AgentEvalSamplingPolicy;
|
|
8391
8391
|
redact?: (payload: AgentEvalPayload) => AgentEvalPayload;
|
|
8392
8392
|
}
|
|
8393
|
+
/**
|
|
8394
|
+
* Common generate options - internal version that includes historyEntryId
|
|
8395
|
+
* Not exposed directly to users
|
|
8396
|
+
*/
|
|
8397
|
+
interface CommonSemanticMemoryOptions {
|
|
8398
|
+
enabled?: boolean;
|
|
8399
|
+
semanticLimit?: number;
|
|
8400
|
+
semanticThreshold?: number;
|
|
8401
|
+
mergeStrategy?: "prepend" | "append" | "interleave";
|
|
8402
|
+
}
|
|
8403
|
+
interface CommonRuntimeMemoryBehaviorOptions {
|
|
8404
|
+
contextLimit?: number;
|
|
8405
|
+
semanticMemory?: CommonSemanticMemoryOptions;
|
|
8406
|
+
conversationPersistence?: AgentConversationPersistenceOptions;
|
|
8407
|
+
/**
|
|
8408
|
+
* When true, memory is read-only for the current call.
|
|
8409
|
+
* Existing memory context can be loaded, but no writes are persisted.
|
|
8410
|
+
*/
|
|
8411
|
+
readOnly?: boolean;
|
|
8412
|
+
}
|
|
8413
|
+
interface CommonRuntimeMemoryEnvelope {
|
|
8414
|
+
conversationId?: string;
|
|
8415
|
+
userId?: string;
|
|
8416
|
+
options?: CommonRuntimeMemoryBehaviorOptions;
|
|
8417
|
+
}
|
|
8418
|
+
type SemanticMemoryOptions = CommonSemanticMemoryOptions;
|
|
8419
|
+
type RuntimeMemoryEnvelope = CommonRuntimeMemoryEnvelope;
|
|
8420
|
+
interface CommonResolvedRuntimeMemoryOptions {
|
|
8421
|
+
userId?: string;
|
|
8422
|
+
conversationId?: string;
|
|
8423
|
+
contextLimit?: number;
|
|
8424
|
+
semanticMemory?: CommonSemanticMemoryOptions;
|
|
8425
|
+
conversationPersistence?: AgentConversationPersistenceOptions;
|
|
8426
|
+
readOnly?: boolean;
|
|
8427
|
+
}
|
|
8393
8428
|
/**
|
|
8394
8429
|
* Agent status information
|
|
8395
8430
|
*/
|
|
@@ -8459,6 +8494,8 @@ type OperationContext = {
|
|
|
8459
8494
|
userId?: string;
|
|
8460
8495
|
/** Optional conversation identifier associated with this operation */
|
|
8461
8496
|
conversationId?: string;
|
|
8497
|
+
/** Resolved runtime memory options (memory envelope preferred, legacy as fallback) */
|
|
8498
|
+
resolvedMemory?: CommonResolvedRuntimeMemoryOptions;
|
|
8462
8499
|
/** Workspace configured on the executing agent (if any). */
|
|
8463
8500
|
workspace?: Workspace;
|
|
8464
8501
|
/** User-managed context map for this operation */
|
|
@@ -9008,7 +9045,9 @@ declare class MemoryManager {
|
|
|
9008
9045
|
* Ensures context is always loaded, optimizes non-critical operations in background
|
|
9009
9046
|
* PRESERVED FROM ORIGINAL
|
|
9010
9047
|
*/
|
|
9011
|
-
prepareConversationContext(context: OperationContext, input: string | UIMessage[], userId?: string, conversationIdParam?: string, contextLimit?: number
|
|
9048
|
+
prepareConversationContext(context: OperationContext, input: string | UIMessage[], userId?: string, conversationIdParam?: string, contextLimit?: number, options?: {
|
|
9049
|
+
persistInput?: boolean;
|
|
9050
|
+
}): Promise<{
|
|
9012
9051
|
messages: UIMessage<{
|
|
9013
9052
|
createdAt: Date;
|
|
9014
9053
|
}>[];
|
|
@@ -9177,7 +9216,17 @@ interface GenerateObjectResultWithContext<T> extends GenerateObjectResult<T> {
|
|
|
9177
9216
|
* Extends AI SDK's CallSettings for full compatibility
|
|
9178
9217
|
*/
|
|
9179
9218
|
interface BaseGenerationOptions<TProviderOptions extends ProviderOptions$1 = ProviderOptions$1> extends Partial<CallSettings> {
|
|
9219
|
+
/**
|
|
9220
|
+
* Runtime memory envelope for per-call memory identity and behavior overrides.
|
|
9221
|
+
*/
|
|
9222
|
+
memory?: RuntimeMemoryEnvelope;
|
|
9223
|
+
/**
|
|
9224
|
+
* @deprecated Use `memory.userId` instead.
|
|
9225
|
+
*/
|
|
9180
9226
|
userId?: string;
|
|
9227
|
+
/**
|
|
9228
|
+
* @deprecated Use `memory.conversationId` instead.
|
|
9229
|
+
*/
|
|
9181
9230
|
conversationId?: string;
|
|
9182
9231
|
context?: ContextInput;
|
|
9183
9232
|
elicitation?: (request: unknown) => Promise<unknown>;
|
|
@@ -9185,13 +9234,17 @@ interface BaseGenerationOptions<TProviderOptions extends ProviderOptions$1 = Pro
|
|
|
9185
9234
|
parentOperationContext?: OperationContext;
|
|
9186
9235
|
parentSpan?: Span;
|
|
9187
9236
|
inheritParentSpan?: boolean;
|
|
9237
|
+
/**
|
|
9238
|
+
* @deprecated Use `memory.options.contextLimit` instead.
|
|
9239
|
+
*/
|
|
9188
9240
|
contextLimit?: number;
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9241
|
+
/**
|
|
9242
|
+
* @deprecated Use `memory.options.semanticMemory` instead.
|
|
9243
|
+
*/
|
|
9244
|
+
semanticMemory?: SemanticMemoryOptions;
|
|
9245
|
+
/**
|
|
9246
|
+
* @deprecated Use `memory.options.conversationPersistence` instead.
|
|
9247
|
+
*/
|
|
9195
9248
|
conversationPersistence?: AgentConversationPersistenceOptions;
|
|
9196
9249
|
maxSteps?: number;
|
|
9197
9250
|
feedback?: boolean | AgentFeedbackOptions;
|
|
@@ -9321,6 +9374,7 @@ declare class Agent {
|
|
|
9321
9374
|
*/
|
|
9322
9375
|
private normalizeConversationPersistenceOptions;
|
|
9323
9376
|
private resolveConversationPersistenceOptions;
|
|
9377
|
+
private resolveMemoryRuntimeOptions;
|
|
9324
9378
|
private getConversationPersistenceOptionsForContext;
|
|
9325
9379
|
/**
|
|
9326
9380
|
* Create only the OperationContext (sync)
|
|
@@ -9330,6 +9384,8 @@ declare class Agent {
|
|
|
9330
9384
|
private resetOperationAttemptState;
|
|
9331
9385
|
private getConversationBuffer;
|
|
9332
9386
|
private getMemoryPersistQueue;
|
|
9387
|
+
private isReadOnlyMemoryForContext;
|
|
9388
|
+
private shouldPersistMemoryForContext;
|
|
9333
9389
|
private ensureStreamingResponseMessageId;
|
|
9334
9390
|
private getOrCreateStepResponseMessageId;
|
|
9335
9391
|
private getStepResponseMessageFingerprints;
|
package/dist/index.d.ts
CHANGED
|
@@ -8390,6 +8390,41 @@ interface AgentEvalConfig {
|
|
|
8390
8390
|
sampling?: AgentEvalSamplingPolicy;
|
|
8391
8391
|
redact?: (payload: AgentEvalPayload) => AgentEvalPayload;
|
|
8392
8392
|
}
|
|
8393
|
+
/**
|
|
8394
|
+
* Common generate options - internal version that includes historyEntryId
|
|
8395
|
+
* Not exposed directly to users
|
|
8396
|
+
*/
|
|
8397
|
+
interface CommonSemanticMemoryOptions {
|
|
8398
|
+
enabled?: boolean;
|
|
8399
|
+
semanticLimit?: number;
|
|
8400
|
+
semanticThreshold?: number;
|
|
8401
|
+
mergeStrategy?: "prepend" | "append" | "interleave";
|
|
8402
|
+
}
|
|
8403
|
+
interface CommonRuntimeMemoryBehaviorOptions {
|
|
8404
|
+
contextLimit?: number;
|
|
8405
|
+
semanticMemory?: CommonSemanticMemoryOptions;
|
|
8406
|
+
conversationPersistence?: AgentConversationPersistenceOptions;
|
|
8407
|
+
/**
|
|
8408
|
+
* When true, memory is read-only for the current call.
|
|
8409
|
+
* Existing memory context can be loaded, but no writes are persisted.
|
|
8410
|
+
*/
|
|
8411
|
+
readOnly?: boolean;
|
|
8412
|
+
}
|
|
8413
|
+
interface CommonRuntimeMemoryEnvelope {
|
|
8414
|
+
conversationId?: string;
|
|
8415
|
+
userId?: string;
|
|
8416
|
+
options?: CommonRuntimeMemoryBehaviorOptions;
|
|
8417
|
+
}
|
|
8418
|
+
type SemanticMemoryOptions = CommonSemanticMemoryOptions;
|
|
8419
|
+
type RuntimeMemoryEnvelope = CommonRuntimeMemoryEnvelope;
|
|
8420
|
+
interface CommonResolvedRuntimeMemoryOptions {
|
|
8421
|
+
userId?: string;
|
|
8422
|
+
conversationId?: string;
|
|
8423
|
+
contextLimit?: number;
|
|
8424
|
+
semanticMemory?: CommonSemanticMemoryOptions;
|
|
8425
|
+
conversationPersistence?: AgentConversationPersistenceOptions;
|
|
8426
|
+
readOnly?: boolean;
|
|
8427
|
+
}
|
|
8393
8428
|
/**
|
|
8394
8429
|
* Agent status information
|
|
8395
8430
|
*/
|
|
@@ -8459,6 +8494,8 @@ type OperationContext = {
|
|
|
8459
8494
|
userId?: string;
|
|
8460
8495
|
/** Optional conversation identifier associated with this operation */
|
|
8461
8496
|
conversationId?: string;
|
|
8497
|
+
/** Resolved runtime memory options (memory envelope preferred, legacy as fallback) */
|
|
8498
|
+
resolvedMemory?: CommonResolvedRuntimeMemoryOptions;
|
|
8462
8499
|
/** Workspace configured on the executing agent (if any). */
|
|
8463
8500
|
workspace?: Workspace;
|
|
8464
8501
|
/** User-managed context map for this operation */
|
|
@@ -9008,7 +9045,9 @@ declare class MemoryManager {
|
|
|
9008
9045
|
* Ensures context is always loaded, optimizes non-critical operations in background
|
|
9009
9046
|
* PRESERVED FROM ORIGINAL
|
|
9010
9047
|
*/
|
|
9011
|
-
prepareConversationContext(context: OperationContext, input: string | UIMessage[], userId?: string, conversationIdParam?: string, contextLimit?: number
|
|
9048
|
+
prepareConversationContext(context: OperationContext, input: string | UIMessage[], userId?: string, conversationIdParam?: string, contextLimit?: number, options?: {
|
|
9049
|
+
persistInput?: boolean;
|
|
9050
|
+
}): Promise<{
|
|
9012
9051
|
messages: UIMessage<{
|
|
9013
9052
|
createdAt: Date;
|
|
9014
9053
|
}>[];
|
|
@@ -9177,7 +9216,17 @@ interface GenerateObjectResultWithContext<T> extends GenerateObjectResult<T> {
|
|
|
9177
9216
|
* Extends AI SDK's CallSettings for full compatibility
|
|
9178
9217
|
*/
|
|
9179
9218
|
interface BaseGenerationOptions<TProviderOptions extends ProviderOptions$1 = ProviderOptions$1> extends Partial<CallSettings> {
|
|
9219
|
+
/**
|
|
9220
|
+
* Runtime memory envelope for per-call memory identity and behavior overrides.
|
|
9221
|
+
*/
|
|
9222
|
+
memory?: RuntimeMemoryEnvelope;
|
|
9223
|
+
/**
|
|
9224
|
+
* @deprecated Use `memory.userId` instead.
|
|
9225
|
+
*/
|
|
9180
9226
|
userId?: string;
|
|
9227
|
+
/**
|
|
9228
|
+
* @deprecated Use `memory.conversationId` instead.
|
|
9229
|
+
*/
|
|
9181
9230
|
conversationId?: string;
|
|
9182
9231
|
context?: ContextInput;
|
|
9183
9232
|
elicitation?: (request: unknown) => Promise<unknown>;
|
|
@@ -9185,13 +9234,17 @@ interface BaseGenerationOptions<TProviderOptions extends ProviderOptions$1 = Pro
|
|
|
9185
9234
|
parentOperationContext?: OperationContext;
|
|
9186
9235
|
parentSpan?: Span;
|
|
9187
9236
|
inheritParentSpan?: boolean;
|
|
9237
|
+
/**
|
|
9238
|
+
* @deprecated Use `memory.options.contextLimit` instead.
|
|
9239
|
+
*/
|
|
9188
9240
|
contextLimit?: number;
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9241
|
+
/**
|
|
9242
|
+
* @deprecated Use `memory.options.semanticMemory` instead.
|
|
9243
|
+
*/
|
|
9244
|
+
semanticMemory?: SemanticMemoryOptions;
|
|
9245
|
+
/**
|
|
9246
|
+
* @deprecated Use `memory.options.conversationPersistence` instead.
|
|
9247
|
+
*/
|
|
9195
9248
|
conversationPersistence?: AgentConversationPersistenceOptions;
|
|
9196
9249
|
maxSteps?: number;
|
|
9197
9250
|
feedback?: boolean | AgentFeedbackOptions;
|
|
@@ -9321,6 +9374,7 @@ declare class Agent {
|
|
|
9321
9374
|
*/
|
|
9322
9375
|
private normalizeConversationPersistenceOptions;
|
|
9323
9376
|
private resolveConversationPersistenceOptions;
|
|
9377
|
+
private resolveMemoryRuntimeOptions;
|
|
9324
9378
|
private getConversationPersistenceOptionsForContext;
|
|
9325
9379
|
/**
|
|
9326
9380
|
* Create only the OperationContext (sync)
|
|
@@ -9330,6 +9384,8 @@ declare class Agent {
|
|
|
9330
9384
|
private resetOperationAttemptState;
|
|
9331
9385
|
private getConversationBuffer;
|
|
9332
9386
|
private getMemoryPersistQueue;
|
|
9387
|
+
private isReadOnlyMemoryForContext;
|
|
9388
|
+
private shouldPersistMemoryForContext;
|
|
9333
9389
|
private ensureStreamingResponseMessageId;
|
|
9334
9390
|
private getOrCreateStepResponseMessageId;
|
|
9335
9391
|
private getStepResponseMessageFingerprints;
|