Memory Types

MemSync uses two distinct types of memories to capture different kinds of information from user interactions. Understanding these types helps you optimize how your AI application stores and retrieves context.

Semantic Memories

Semantic memories represent stable, lasting facts that are not tied to a specific time or place. These are the core truths about a user that remain relatively constant over time.

Characteristics

  • Persistent: Don’t change frequently
  • Context-independent: True regardless of when or where they were mentioned
  • Factual: Represent established knowledge about the user
  • Searchable: Highly valuable for providing relevant context

Examples

Identity

  • “User is a software engineer at Google”
  • “Lives in San Francisco, California”
  • “Graduated from Stanford with a CS degree”

Skills & Expertise

  • “Experienced in Python and machine learning”
  • “Specializes in natural language processing”
  • “Has 5 years of backend development experience”

Preferences

  • “Prefers working in collaborative environments”
  • “Enjoys technical challenges and problem-solving”
  • “Values work-life balance”

Interests

  • “Passionate about hiking and photography”
  • “Interested in AI ethics and responsible development”
  • “Enjoys reading science fiction novels”

Episodic Memories

Episodic memories relate to current situations, goals, or projects that might change over time. They are tied to specific moments and could evolve or become outdated.

Characteristics

  • Time-bound: Relevant to a specific period or context
  • Dynamic: May change, complete, or become irrelevant over time
  • Situational: Tied to particular circumstances or goals
  • Contextual: Provide important background for current interactions

Examples

Current Projects

  • “Currently working on a new iOS app for AI model monetization”
  • “Leading a team of 3 engineers and 1 marketing person”
  • “Planning to launch the app in Q2 2024”

Active Goals

  • “Learning how to cook new recipes for weight loss”
  • “Training for a marathon in 6 months”
  • “Studying for AWS certification exam”

Recent Events

  • “Just moved to a new apartment last week”
  • “Recently started using MemSync for their chatbot”
  • “Had a great conversation about AI safety yesterday”

Temporary States

  • “Currently traveling in Europe for 2 weeks”
  • “Taking a break from social media this month”
  • “Working from home while recovering from injury”

How MemSync Determines Memory Types

MemSync uses advanced language models to automatically classify memories during extraction. The system analyzes several factors:

Semantic Memory Indicators

# Examples of content that becomes semantic memory
user_input = [
    "I work as a data scientist at Microsoft",  # Job/identity
    "I have two cats named Luna and Max",       # Personal facts
    "I prefer Python over JavaScript",         # Preferences
    "I studied computer science at MIT"        # Background/education
]

Episodic Memory Indicators

# Examples of content that becomes episodic memory
user_input = [
    "I'm currently working on a React project",     # Current project
    "I'm learning Spanish this semester",           # Active learning
    "I just started a new diet plan",              # Recent change
    "I'm planning to visit Japan next month"       # Future plans
]

Memory Classification Process

1

Conversation Analysis

MemSync analyzes the full conversation context to understand what information is being shared.
2

Fact Extraction

The system extracts meaningful facts using advanced prompts designed to identify important information.
3

Type Classification

Each extracted fact is classified as semantic or episodic based on temporal indicators, context, and content analysis.
4

Storage & Indexing

Memories are stored with their type classification and made searchable through vector embeddings.

Best Practices for Memory Types

For Developers

Memory Evolution

Semantic Memory Updates

When new information conflicts with existing semantic memories, MemSync intelligently handles updates:
// Original semantic memory
{
  "memory": "Works as a software engineer at Google",
  "type": "semantic",
  "categories": ["career"]
}

// New information: "I just got promoted to Senior Software Engineer"
// Results in updated memory:
{
  "memory": "Works as a Senior Software Engineer at Google",
  "type": "semantic", 
  "categories": ["career"]
}

Episodic Memory Transitions

Episodic memories can evolve or transition to semantic memories:
// Original episodic memory
{
  "memory": "Currently learning React for a new project",
  "type": "episodic",
  "categories": ["learning", "career"]
}

// After project completion: "I've become proficient in React"
// May become semantic memory:
{
  "memory": "Proficient in React development",
  "type": "semantic",
  "categories": ["career"]
}
Understanding memory types helps optimize search queries:
# Good for finding stable facts
memories = memsync.search_memories(
    query="What are the user's technical skills?",
    categories=["career"],
    limit=10
)
# Good for finding current context
memories = memsync.search_memories(
    query="What is the user currently working on?",
    categories=["career", "learning"],
    limit=5
)
# Best for comprehensive personalization
memories = memsync.search_memories(
    query="Tell me about the user's background and current projects",
    limit=15,
    rerank=True
)

Memory Type Distribution

In typical usage, you’ll see different distributions of memory types:
  • Semantic memories: 60-70% of total memories
  • Episodic memories: 30-40% of total memories
This distribution can vary based on:
  • User interaction patterns
  • Application type (task-focused vs. general chat)
  • Conversation topics and context

Next Steps