Table of Contents

Constructor UserScopedMemory

Namespace
LMKit.Agents.Memory
Assembly
LM-Kit.NET.dll

UserScopedMemory(AgentMemory, string)

Initializes a new instance of the UserScopedMemory class.

public UserScopedMemory(AgentMemory sharedMemory, string userId)

Parameters

sharedMemory AgentMemory

The shared AgentMemory instance that stores all users' data.

userId string

A unique identifier for the user. This value is used to namespace data source identifiers and must not contain the "::" separator.

Examples

Example: Creating a user-scoped memory

var sharedMemory = new AgentMemory(embeddingModel);
var userMemory = new UserScopedMemory(sharedMemory, "user_42");

Exceptions

ArgumentNullException

Thrown when sharedMemory or userId is null.

ArgumentException

Thrown when userId is empty, whitespace, or contains the reserved "::" separator.