Skip to main content

Type Alias MemoryType

The MemoryType defines which memory engine is targeted during storage or retrieval. You will frequently use these values when filtering search results or specifying where a new memory should be saved.
ValueDescription
'episodic'Time-based memory representing specific events or conversation history.
'semantic'Fact-based memory representing distilled knowledge and persistent traits.

Type Alias MemoryProducerRole

The MemoryProducerRole identifies the entity responsible for creating a memory entry. This is used by the AI to distinguish between human input, agent responses, and system-level events.
ValueDescription
'user'Information or messages provided by the human user.
'assistant'Responses or actions generated by the AI assistant.
'system'Automated entries, instructions, or environmental context.

Technical Implementation

In TypeScript, these are defined as string literal unions. You can import them directly to ensure your variables match the expected API values:
import { MemoryType, MemoryProducerRole } from '@memmachine/client';

// Example: Specifying memory storage types
const typesToStore: MemoryType[] = ['episodic', 'semantic'];

// Example: Categorizing a new memory
const role: MemoryProducerRole = 'assistant';