Skip to main content

Interface Project

The Project object represents the high-level container for all your data. It defines the identity and the AI models (embedder/reranker) used for this specific workspace.
PropertyTypeDescription
project_idstringRequired. The unique identifier for the project.
org_idstringRequired. The organization ID this project belongs to.
descriptionstringOptional. A brief summary of the project’s purpose.
configobjectOptional. Technical settings including the embedder and reranker model names.

Interface MemoryContext

While a Project is the broad container, the MemoryContext allows you to narrow your focus to specific users, sessions, or agents. This ensures that the AI only retrieves memories relevant to the current interaction.
PropertyTypeDescription
session_idstringOptional. Filters memory to a specific conversation or session.
user_idstring | string[]Optional. Filters memory to one or more specific user identifiers.
agent_idstring | string[]Optional. Filters memory to one or more specific AI agent identifiers.
group_idstringOptional. Filters memory to a specific team or group ID.

Usage Example

The context is usually passed when initializing the memory engine to ensure all subsequent searches are “scoped” correctly.
import { MemMachineClient } from '@memmachine/client';

const client = new MemMachineClient({ base_url: 'your-base-url' });

// 1. Access the Project workspace
const projectInstance = client.project({ 
  org_id: 'acme_corp', 
  project_id: 'customer_support' 
});

// 2. Narrow the scope to a specific user and session
const memory = projectInstance.memory({
  user_id: 'user_99',
  session_id: 'chat_session_alpha',
  agent_id: 'support_bot_v2'
});

// Any search now only looks at 'user_99' memories within this session
const results = await memory.search("What did we discuss last time?");