Skip to main content

Interface SearchMemoryOptions

Fine-tune your semantic search by applying filters, limits, and specifying which memory types to scan.
PropertyTypeDescription
limitnumberOptional. The maximum number of results to return.
filterRecord<string, unknown>Optional. Metadata filters to narrow the search scope.
typesMemoryType[]Optional. Search within episodic, semantic, or both.

Interface SearchMemoryResult

The search response provides a structured view of retrieved information, categorized by memory “depth” and type.
PropertyTypeDescription
statusnumberThe status code of the search operation.
contentobjectThe container for all retrieved memory data.

The content Object

The search engine returns a tiered memory structure: Episodic Memory (content.episodic_memory)
  • short_term_memory: Recent interactions as EpisodicMemory[].
  • long_term_memory: Historical data as EpisodicMemory[].
  • episode_summary: A list of strings summarizing the found episodes.
Semantic Memory (content.semantic_memory)

Usage Example

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

const memory = client.project({ org_id: 'org_1', project_id: 'proj_1' }).memory();

const results = await memory.search("What are the user's favorite colors?");

if (results.status === 200) {
  // Accessing different "layers" of memory
  const { short_term_memory, long_term_memory } = results.content.episodic_memory;
  
  console.log(`Found ${short_term_memory.length} recent context clues.`);
  console.log(`Summary: ${results.content.episodic_memory.episode_summary[0]}`);
  
  // Accessing semantic knowledge
  const knowledge = results.content.semantic_memory;
  console.log(`Semantic Knowledge: ${knowledge.length} items found.`);
}