@juspay/neurolink 9.32.1 → 9.33.0
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 +6 -0
- package/dist/lib/neurolink.d.ts +10 -0
- package/dist/lib/neurolink.js +41 -7
- package/dist/lib/types/generateTypes.d.ts +16 -0
- package/dist/lib/types/streamTypes.d.ts +15 -0
- package/dist/neurolink.d.ts +10 -0
- package/dist/neurolink.js +41 -7
- package/dist/types/generateTypes.d.ts +16 -0
- package/dist/types/streamTypes.d.ts +15 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [9.33.0](https://github.com/juspay/neurolink/compare/v9.32.1...v9.33.0) (2026-03-27)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **(memory):** add per-call memory control options (read/write) for generate and stream in NeuroLink ([c9a354b](https://github.com/juspay/neurolink/commit/c9a354b2b3197a78a42d2a19f25757792467023f))
|
|
6
|
+
|
|
1
7
|
## [9.32.1](https://github.com/juspay/neurolink/compare/v9.32.0...v9.32.1) (2026-03-27)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
package/dist/lib/neurolink.d.ts
CHANGED
|
@@ -181,6 +181,16 @@ export declare class NeuroLink {
|
|
|
181
181
|
private registerMemoryRetrievalTools;
|
|
182
182
|
/** Format memory context for prompt inclusion */
|
|
183
183
|
private formatMemoryContext;
|
|
184
|
+
/**
|
|
185
|
+
* Determine whether memory should be read (retrieved) for this call.
|
|
186
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
187
|
+
*/
|
|
188
|
+
private shouldReadMemory;
|
|
189
|
+
/**
|
|
190
|
+
* Determine whether memory should be written (stored) for this call.
|
|
191
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
192
|
+
*/
|
|
193
|
+
private shouldWriteMemory;
|
|
184
194
|
/**
|
|
185
195
|
* Retrieve condensed memory for a user.
|
|
186
196
|
* Returns the input text enhanced with memory context, or unchanged if no memory.
|
package/dist/lib/neurolink.js
CHANGED
|
@@ -825,6 +825,43 @@ ${memoryContext}
|
|
|
825
825
|
|
|
826
826
|
Current user's request: ${currentInput}`;
|
|
827
827
|
}
|
|
828
|
+
/**
|
|
829
|
+
* Determine whether memory should be read (retrieved) for this call.
|
|
830
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
831
|
+
*/
|
|
832
|
+
shouldReadMemory(perCallMemory, userId) {
|
|
833
|
+
if (!this.conversationMemoryConfig?.conversationMemory?.memory?.enabled ||
|
|
834
|
+
!userId) {
|
|
835
|
+
return false;
|
|
836
|
+
}
|
|
837
|
+
if (perCallMemory?.enabled === false) {
|
|
838
|
+
return false;
|
|
839
|
+
}
|
|
840
|
+
if (perCallMemory?.read === false) {
|
|
841
|
+
return false;
|
|
842
|
+
}
|
|
843
|
+
return true;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Determine whether memory should be written (stored) for this call.
|
|
847
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
848
|
+
*/
|
|
849
|
+
shouldWriteMemory(perCallMemory, userId, content) {
|
|
850
|
+
if (!this.conversationMemoryConfig?.conversationMemory?.memory?.enabled ||
|
|
851
|
+
!userId) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
if (!content?.trim()) {
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
if (perCallMemory?.enabled === false) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
if (perCallMemory?.write === false) {
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
return true;
|
|
864
|
+
}
|
|
828
865
|
/**
|
|
829
866
|
* Retrieve condensed memory for a user.
|
|
830
867
|
* Returns the input text enhanced with memory context, or unchanged if no memory.
|
|
@@ -2574,9 +2611,8 @@ Current user's request: ${currentInput}`;
|
|
|
2574
2611
|
*/
|
|
2575
2612
|
scheduleGenerateMemoryStorage(options, originalPrompt, generateResult) {
|
|
2576
2613
|
// Memory storage
|
|
2577
|
-
if (this.
|
|
2578
|
-
options.context?.userId
|
|
2579
|
-
generateResult.content?.trim()) {
|
|
2614
|
+
if (this.shouldWriteMemory(options.memory, options.context?.userId, generateResult.content) &&
|
|
2615
|
+
options.context?.userId) {
|
|
2580
2616
|
this.storeMemoryInBackground(originalPrompt ?? "", generateResult.content.trim(), options.context.userId);
|
|
2581
2617
|
}
|
|
2582
2618
|
}
|
|
@@ -4372,7 +4408,7 @@ Current user's request: ${currentInput}`;
|
|
|
4372
4408
|
// Initialize MCP
|
|
4373
4409
|
await this.initializeMCP();
|
|
4374
4410
|
// Memory retrieval
|
|
4375
|
-
if (this.
|
|
4411
|
+
if (this.shouldReadMemory(options.memory, options.context?.userId) &&
|
|
4376
4412
|
options.context?.userId) {
|
|
4377
4413
|
try {
|
|
4378
4414
|
options.input.text = await this.retrieveMemory(options.input.text, options.context.userId);
|
|
@@ -4687,9 +4723,7 @@ Current user's request: ${currentInput}`;
|
|
|
4687
4723
|
});
|
|
4688
4724
|
}
|
|
4689
4725
|
}
|
|
4690
|
-
if (this.
|
|
4691
|
-
enhancedOptions.context?.userId &&
|
|
4692
|
-
accumulatedContent?.trim()) {
|
|
4726
|
+
if (this.shouldWriteMemory(enhancedOptions.memory, enhancedOptions.context?.userId, accumulatedContent)) {
|
|
4693
4727
|
this.storeMemoryInBackground(originalPrompt ?? "", accumulatedContent.trim(), enhancedOptions.context?.userId);
|
|
4694
4728
|
}
|
|
4695
4729
|
}
|
|
@@ -411,6 +411,22 @@ export type GenerateOptions = {
|
|
|
411
411
|
auth?: {
|
|
412
412
|
token: string;
|
|
413
413
|
};
|
|
414
|
+
/**
|
|
415
|
+
* Per-call memory control.
|
|
416
|
+
*
|
|
417
|
+
* Override the global memory SDK behavior for this specific call.
|
|
418
|
+
* All flags default to `true` when the global memory SDK is enabled.
|
|
419
|
+
* If the global memory SDK is disabled, these flags have no effect.
|
|
420
|
+
*
|
|
421
|
+
*/
|
|
422
|
+
memory?: {
|
|
423
|
+
/** Master toggle for this call. When false, both read and write are skipped. Defaults to true. */
|
|
424
|
+
enabled?: boolean;
|
|
425
|
+
/** Whether to read condensed memory and prepend to prompt. Defaults to true. */
|
|
426
|
+
read?: boolean;
|
|
427
|
+
/** Whether to write (add/condense) the conversation into memory after completion. Defaults to true. */
|
|
428
|
+
write?: boolean;
|
|
429
|
+
};
|
|
414
430
|
};
|
|
415
431
|
/**
|
|
416
432
|
* Generate function result type - Primary output format
|
|
@@ -421,6 +421,21 @@ export type StreamOptions = {
|
|
|
421
421
|
auth?: {
|
|
422
422
|
token: string;
|
|
423
423
|
};
|
|
424
|
+
/**
|
|
425
|
+
* Per-call memory control.
|
|
426
|
+
*
|
|
427
|
+
* Override the global memory SDK behavior for this specific call.
|
|
428
|
+
* All flags default to `true` when the global memory SDK is enabled.
|
|
429
|
+
* If the global memory SDK is disabled, these flags have no effect.
|
|
430
|
+
*/
|
|
431
|
+
memory?: {
|
|
432
|
+
/** Master toggle for this call. When false, both read and write are skipped. Defaults to true. */
|
|
433
|
+
enabled?: boolean;
|
|
434
|
+
/** Whether to read condensed memory and prepend to prompt. Defaults to true. */
|
|
435
|
+
read?: boolean;
|
|
436
|
+
/** Whether to write (add/condense) the conversation into memory after completion. Defaults to true. */
|
|
437
|
+
write?: boolean;
|
|
438
|
+
};
|
|
424
439
|
};
|
|
425
440
|
/**
|
|
426
441
|
* Stream function result type - Primary output format for streaming
|
package/dist/neurolink.d.ts
CHANGED
|
@@ -181,6 +181,16 @@ export declare class NeuroLink {
|
|
|
181
181
|
private registerMemoryRetrievalTools;
|
|
182
182
|
/** Format memory context for prompt inclusion */
|
|
183
183
|
private formatMemoryContext;
|
|
184
|
+
/**
|
|
185
|
+
* Determine whether memory should be read (retrieved) for this call.
|
|
186
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
187
|
+
*/
|
|
188
|
+
private shouldReadMemory;
|
|
189
|
+
/**
|
|
190
|
+
* Determine whether memory should be written (stored) for this call.
|
|
191
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
192
|
+
*/
|
|
193
|
+
private shouldWriteMemory;
|
|
184
194
|
/**
|
|
185
195
|
* Retrieve condensed memory for a user.
|
|
186
196
|
* Returns the input text enhanced with memory context, or unchanged if no memory.
|
package/dist/neurolink.js
CHANGED
|
@@ -825,6 +825,43 @@ ${memoryContext}
|
|
|
825
825
|
|
|
826
826
|
Current user's request: ${currentInput}`;
|
|
827
827
|
}
|
|
828
|
+
/**
|
|
829
|
+
* Determine whether memory should be read (retrieved) for this call.
|
|
830
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
831
|
+
*/
|
|
832
|
+
shouldReadMemory(perCallMemory, userId) {
|
|
833
|
+
if (!this.conversationMemoryConfig?.conversationMemory?.memory?.enabled ||
|
|
834
|
+
!userId) {
|
|
835
|
+
return false;
|
|
836
|
+
}
|
|
837
|
+
if (perCallMemory?.enabled === false) {
|
|
838
|
+
return false;
|
|
839
|
+
}
|
|
840
|
+
if (perCallMemory?.read === false) {
|
|
841
|
+
return false;
|
|
842
|
+
}
|
|
843
|
+
return true;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Determine whether memory should be written (stored) for this call.
|
|
847
|
+
* Respects both the global memory SDK config and per-call overrides.
|
|
848
|
+
*/
|
|
849
|
+
shouldWriteMemory(perCallMemory, userId, content) {
|
|
850
|
+
if (!this.conversationMemoryConfig?.conversationMemory?.memory?.enabled ||
|
|
851
|
+
!userId) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
if (!content?.trim()) {
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
if (perCallMemory?.enabled === false) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
if (perCallMemory?.write === false) {
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
return true;
|
|
864
|
+
}
|
|
828
865
|
/**
|
|
829
866
|
* Retrieve condensed memory for a user.
|
|
830
867
|
* Returns the input text enhanced with memory context, or unchanged if no memory.
|
|
@@ -2574,9 +2611,8 @@ Current user's request: ${currentInput}`;
|
|
|
2574
2611
|
*/
|
|
2575
2612
|
scheduleGenerateMemoryStorage(options, originalPrompt, generateResult) {
|
|
2576
2613
|
// Memory storage
|
|
2577
|
-
if (this.
|
|
2578
|
-
options.context?.userId
|
|
2579
|
-
generateResult.content?.trim()) {
|
|
2614
|
+
if (this.shouldWriteMemory(options.memory, options.context?.userId, generateResult.content) &&
|
|
2615
|
+
options.context?.userId) {
|
|
2580
2616
|
this.storeMemoryInBackground(originalPrompt ?? "", generateResult.content.trim(), options.context.userId);
|
|
2581
2617
|
}
|
|
2582
2618
|
}
|
|
@@ -4372,7 +4408,7 @@ Current user's request: ${currentInput}`;
|
|
|
4372
4408
|
// Initialize MCP
|
|
4373
4409
|
await this.initializeMCP();
|
|
4374
4410
|
// Memory retrieval
|
|
4375
|
-
if (this.
|
|
4411
|
+
if (this.shouldReadMemory(options.memory, options.context?.userId) &&
|
|
4376
4412
|
options.context?.userId) {
|
|
4377
4413
|
try {
|
|
4378
4414
|
options.input.text = await this.retrieveMemory(options.input.text, options.context.userId);
|
|
@@ -4687,9 +4723,7 @@ Current user's request: ${currentInput}`;
|
|
|
4687
4723
|
});
|
|
4688
4724
|
}
|
|
4689
4725
|
}
|
|
4690
|
-
if (this.
|
|
4691
|
-
enhancedOptions.context?.userId &&
|
|
4692
|
-
accumulatedContent?.trim()) {
|
|
4726
|
+
if (this.shouldWriteMemory(enhancedOptions.memory, enhancedOptions.context?.userId, accumulatedContent)) {
|
|
4693
4727
|
this.storeMemoryInBackground(originalPrompt ?? "", accumulatedContent.trim(), enhancedOptions.context?.userId);
|
|
4694
4728
|
}
|
|
4695
4729
|
}
|
|
@@ -411,6 +411,22 @@ export type GenerateOptions = {
|
|
|
411
411
|
auth?: {
|
|
412
412
|
token: string;
|
|
413
413
|
};
|
|
414
|
+
/**
|
|
415
|
+
* Per-call memory control.
|
|
416
|
+
*
|
|
417
|
+
* Override the global memory SDK behavior for this specific call.
|
|
418
|
+
* All flags default to `true` when the global memory SDK is enabled.
|
|
419
|
+
* If the global memory SDK is disabled, these flags have no effect.
|
|
420
|
+
*
|
|
421
|
+
*/
|
|
422
|
+
memory?: {
|
|
423
|
+
/** Master toggle for this call. When false, both read and write are skipped. Defaults to true. */
|
|
424
|
+
enabled?: boolean;
|
|
425
|
+
/** Whether to read condensed memory and prepend to prompt. Defaults to true. */
|
|
426
|
+
read?: boolean;
|
|
427
|
+
/** Whether to write (add/condense) the conversation into memory after completion. Defaults to true. */
|
|
428
|
+
write?: boolean;
|
|
429
|
+
};
|
|
414
430
|
};
|
|
415
431
|
/**
|
|
416
432
|
* Generate function result type - Primary output format
|
|
@@ -421,6 +421,21 @@ export type StreamOptions = {
|
|
|
421
421
|
auth?: {
|
|
422
422
|
token: string;
|
|
423
423
|
};
|
|
424
|
+
/**
|
|
425
|
+
* Per-call memory control.
|
|
426
|
+
*
|
|
427
|
+
* Override the global memory SDK behavior for this specific call.
|
|
428
|
+
* All flags default to `true` when the global memory SDK is enabled.
|
|
429
|
+
* If the global memory SDK is disabled, these flags have no effect.
|
|
430
|
+
*/
|
|
431
|
+
memory?: {
|
|
432
|
+
/** Master toggle for this call. When false, both read and write are skipped. Defaults to true. */
|
|
433
|
+
enabled?: boolean;
|
|
434
|
+
/** Whether to read condensed memory and prepend to prompt. Defaults to true. */
|
|
435
|
+
read?: boolean;
|
|
436
|
+
/** Whether to write (add/condense) the conversation into memory after completion. Defaults to true. */
|
|
437
|
+
write?: boolean;
|
|
438
|
+
};
|
|
424
439
|
};
|
|
425
440
|
/**
|
|
426
441
|
* Stream function result type - Primary output format for streaming
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.33.0",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|