Conditional memory: return empty array when `sessionId: undefined | null`

The idea is:

To gracefully return an empty list when sessionId is undefined | null

My use case:

This so that we may avoid invoking memory for “heavy” callers, such as those providing email bodies.

I think it would be beneficial to add this because:

Now memory is not able to be attached when a caller does not provide a sessionId.

Any resources to support this?

Are you willing to work on this?

Sure

I started a similar discussion in the langchain repo, so that this may be adopted there, but I am not sure about their response: Memory: Gracefully return an empty list when `sessionId` is `undefined | null` · langchain-ai/langchainjs · Discussion #7417 · GitHub