Skip to main content

Overview

MemoryContext provides an additional layer of segmentation within a project. While ProjectContext handles broad isolation, MemoryContext allows you to track and retrieve data for specific entities or conversation threads.

Properties

PropertyTypeDescription
user_idstringOptional. The ID of the end-user associated with the memory.
session_idstringOptional. A unique ID for a specific conversation session or thread.
agent_idstringOptional. The ID of the specific AI agent instance.
group_idstringOptional. An ID used to group related entities or users.

Usage Example

import { MemoryContext } from '@memmachine/client';

const userSession: MemoryContext = {
  user_id: 'user_99',
  session_id: 'chat_hash_abc123'
};