fixed bugs:

This commit is contained in:
Sreeram Sreedhar 2026-04-18 14:34:50 -07:00
parent eb3eb6da44
commit 21fbcf0037
3 changed files with 7 additions and 6 deletions

View file

@ -44,7 +44,8 @@ export interface SupermemoryMastraOptions extends SupermemoryBaseOptions {
containerTag: string
/**
* Custom ID for grouping messages into the same document (e.g., conversation ID)
* Custom ID for grouping messages into the same document (e.g., conversation ID).
* Required for Mastra processors.
*/
customId: string
}

View file

@ -13,19 +13,19 @@ export class MemoryCache<T = string> {
* Normalizes the message by trimming and collapsing whitespace.
*
* @param containerTag - The container tag/user ID
* @param conversationId - Optional conversation ID
* @param customId - Custom ID for grouping messages (e.g., conversation ID)
* @param mode - The memory retrieval mode
* @param message - The user message content
* @returns A unique cache key for this turn
*/
static makeTurnKey(
containerTag: string,
conversationId: string | undefined,
customId: string | undefined,
mode: MemoryMode,
message: string,
): string {
const normalizedMessage = message.trim().replace(/\s+/g, " ")
return `${containerTag}:${conversationId || ""}:${mode}:${normalizedMessage}`
return `${containerTag}:${customId || ""}:${mode}:${normalizedMessage}`
}
/**

View file

@ -121,8 +121,8 @@ export interface SupermemoryBaseOptions {
apiKey?: string
/** Custom Supermemory API base URL */
baseUrl?: string
/** Conversation ID to group messages into the same document for a conversation */
conversationId?: string
/** Custom ID to group messages into the same document (e.g., conversation ID, thread ID) */
customId?: string
/** Memory retrieval mode */
mode?: MemoryMode
/** Memory persistence mode */