@aigne/core 1.49.0 → 1.49.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 +7 -0
- package/lib/cjs/agents/ai-agent.d.ts +2 -0
- package/lib/cjs/agents/ai-agent.js +2 -0
- package/lib/cjs/prompt/prompt-builder.js +1 -1
- package/lib/dts/agents/ai-agent.d.ts +2 -0
- package/lib/esm/agents/ai-agent.d.ts +2 -0
- package/lib/esm/agents/ai-agent.js +2 -0
- package/lib/esm/prompt/prompt-builder.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.49.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.49.0...core-v1.49.1) (2025-08-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **core:** add optional memory context toggle for AI agent ([#350](https://github.com/AIGNE-io/aigne-framework/issues/350)) ([92322cc](https://github.com/AIGNE-io/aigne-framework/commit/92322ccaf6f2b6e4440d47a7631589061c351d64))
|
|
9
|
+
|
|
3
10
|
## [1.49.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.48.0...core-v1.49.0) (2025-08-12)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -112,6 +112,7 @@ export interface AIAgentOptions<I extends Message = Message, O extends Message =
|
|
|
112
112
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
113
113
|
*/
|
|
114
114
|
memoryPromptTemplate?: string;
|
|
115
|
+
useMemoriesFromContext?: boolean;
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
117
118
|
* Tool choice options for AI agents
|
|
@@ -253,6 +254,7 @@ export declare class AIAgent<I extends Message = any, O extends Message = any> e
|
|
|
253
254
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
254
255
|
*/
|
|
255
256
|
memoryPromptTemplate?: string;
|
|
257
|
+
useMemoriesFromContext?: boolean;
|
|
256
258
|
/**
|
|
257
259
|
* Whether to catch error from tool execution and continue processing.
|
|
258
260
|
* If set to false, the agent will throw an error if a tool fails
|
|
@@ -115,6 +115,7 @@ class AIAgent extends agent_js_1.Agent {
|
|
|
115
115
|
this.toolChoice = options.toolChoice;
|
|
116
116
|
this.memoryAgentsAsTools = options.memoryAgentsAsTools;
|
|
117
117
|
this.memoryPromptTemplate = options.memoryPromptTemplate;
|
|
118
|
+
this.useMemoriesFromContext = options.useMemoriesFromContext;
|
|
118
119
|
if (typeof options.catchToolsError === "boolean")
|
|
119
120
|
this.catchToolsError = options.catchToolsError;
|
|
120
121
|
this.structuredStreamMode = options.structuredStreamMode;
|
|
@@ -187,6 +188,7 @@ class AIAgent extends agent_js_1.Agent {
|
|
|
187
188
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
188
189
|
*/
|
|
189
190
|
memoryPromptTemplate;
|
|
191
|
+
useMemoriesFromContext;
|
|
190
192
|
/**
|
|
191
193
|
* Whether to catch error from tool execution and continue processing.
|
|
192
194
|
* If set to false, the agent will throw an error if a tool fails
|
|
@@ -79,7 +79,7 @@ class PromptBuilder {
|
|
|
79
79
|
if (options.agent && options.context) {
|
|
80
80
|
memories.push(...(await options.agent.retrieveMemories({ search: message }, { context: options.context })));
|
|
81
81
|
}
|
|
82
|
-
if (options.context?.memories?.length) {
|
|
82
|
+
if (options.agent?.useMemoriesFromContext && options.context?.memories?.length) {
|
|
83
83
|
memories.push(...options.context.memories);
|
|
84
84
|
}
|
|
85
85
|
if (memories.length)
|
|
@@ -112,6 +112,7 @@ export interface AIAgentOptions<I extends Message = Message, O extends Message =
|
|
|
112
112
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
113
113
|
*/
|
|
114
114
|
memoryPromptTemplate?: string;
|
|
115
|
+
useMemoriesFromContext?: boolean;
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
117
118
|
* Tool choice options for AI agents
|
|
@@ -253,6 +254,7 @@ export declare class AIAgent<I extends Message = any, O extends Message = any> e
|
|
|
253
254
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
254
255
|
*/
|
|
255
256
|
memoryPromptTemplate?: string;
|
|
257
|
+
useMemoriesFromContext?: boolean;
|
|
256
258
|
/**
|
|
257
259
|
* Whether to catch error from tool execution and continue processing.
|
|
258
260
|
* If set to false, the agent will throw an error if a tool fails
|
|
@@ -112,6 +112,7 @@ export interface AIAgentOptions<I extends Message = Message, O extends Message =
|
|
|
112
112
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
113
113
|
*/
|
|
114
114
|
memoryPromptTemplate?: string;
|
|
115
|
+
useMemoriesFromContext?: boolean;
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
117
118
|
* Tool choice options for AI agents
|
|
@@ -253,6 +254,7 @@ export declare class AIAgent<I extends Message = any, O extends Message = any> e
|
|
|
253
254
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
254
255
|
*/
|
|
255
256
|
memoryPromptTemplate?: string;
|
|
257
|
+
useMemoriesFromContext?: boolean;
|
|
256
258
|
/**
|
|
257
259
|
* Whether to catch error from tool execution and continue processing.
|
|
258
260
|
* If set to false, the agent will throw an error if a tool fails
|
|
@@ -112,6 +112,7 @@ export class AIAgent extends Agent {
|
|
|
112
112
|
this.toolChoice = options.toolChoice;
|
|
113
113
|
this.memoryAgentsAsTools = options.memoryAgentsAsTools;
|
|
114
114
|
this.memoryPromptTemplate = options.memoryPromptTemplate;
|
|
115
|
+
this.useMemoriesFromContext = options.useMemoriesFromContext;
|
|
115
116
|
if (typeof options.catchToolsError === "boolean")
|
|
116
117
|
this.catchToolsError = options.catchToolsError;
|
|
117
118
|
this.structuredStreamMode = options.structuredStreamMode;
|
|
@@ -184,6 +185,7 @@ export class AIAgent extends Agent {
|
|
|
184
185
|
* The template receives a {{memories}} variable containing serialized memory content.
|
|
185
186
|
*/
|
|
186
187
|
memoryPromptTemplate;
|
|
188
|
+
useMemoriesFromContext;
|
|
187
189
|
/**
|
|
188
190
|
* Whether to catch error from tool execution and continue processing.
|
|
189
191
|
* If set to false, the agent will throw an error if a tool fails
|
|
@@ -76,7 +76,7 @@ export class PromptBuilder {
|
|
|
76
76
|
if (options.agent && options.context) {
|
|
77
77
|
memories.push(...(await options.agent.retrieveMemories({ search: message }, { context: options.context })));
|
|
78
78
|
}
|
|
79
|
-
if (options.context?.memories?.length) {
|
|
79
|
+
if (options.agent?.useMemoriesFromContext && options.context?.memories?.length) {
|
|
80
80
|
memories.push(...options.context.memories);
|
|
81
81
|
}
|
|
82
82
|
if (memories.length)
|