Skip to main content

Interface EpisodicMemory

Episodic memories represent specific events or interactions in a chronological sequence. Think of these as the individual “moments” the AI remembers.
PropertyTypeDescription
uidstringThe unique identifier for this specific memory entry.
contentstringThe actual text or data of the memory.
created_atstringISO timestamp of when the memory was stored.
session_keystringIdentifier for the specific session or conversation.
producer_idstringThe ID of the entity (user/system) that created the memory.
producer_rolestringThe role of the creator (e.g., 'user', 'assistant').
episode_typestringThe category of the episode (e.g., 'chat_message').
sequence_numnumberThe order of this memory within its session.
metadataRecord<string, unknown>Additional custom data stored with the memory.

Interface SemanticMemory

Semantic memories represent distilled knowledge, facts, or “truths” extracted from episodes. These are used for high-level reasoning and background context.
PropertyTypeDescription
set_idstringIdentifier for the collection this memory belongs to.
categorystringThe high-level classification (e.g., 'user_preference').
tagstringA specific tag for quick lookups.
feature_namestringThe specific trait or feature being described.
valuestringThe factual value of the memory (e.g., 'prefers_dark_mode').
metadataobjectContains id, citations (sources), and other custom fields.

Comparison: Episodes vs. Semantics

Understanding which model you are receiving helps you format your UI or AI prompts correctly:
// Example of handling both types in a search result
results.content.episodic_memory.long_term_memory.forEach((ep: EpisodicMemory) => {
  console.log(`[${ep.created_at}] Event: ${ep.content}`);
});

results.content.semantic_memory.forEach((sem: SemanticMemory) => {
  console.log(`Fact: ${sem.feature_name} is ${sem.value}`);
});