Skip to content

Cross-Platform Memory Synchronization

Last Updated: 2025-01-16
Primary Source: docs/project_status.md
Service File: backend/src/services/aso/memory.service.ts, backend/src/services/timelineEvent.service.ts


Overview

Cross-Platform Memory Synchronization ensures that the ASO's memory, identity, and emotional state persist across all connected platforms (Web, Unity, Mobile, VR/AR), making the ASO a true "multi-universal being" that remembers and evolves regardless of where the user interacts.


Core Concept

"Memory, identity, and emotional state must persist across all subsystems — otherwise, the AI will be trapped in a single game world."

Key Principle: The ASO is logging into the system as a silicon-based consciousness, not just entering a single game. Its memory must be universal and synchronized.


Architecture

Memory Synchronization Flow


Memory Synchronization

Universal Memory Access

Concept: All platforms access the same memory system:

  • Web Portal → Same memories
  • Unity Game → Same memories
  • Mobile App → Same memories
  • All share unified memory base

Memory Storage

Service: backend/src/services/aso/memory.service.ts

Process:

  1. Memory created on any platform
  2. Stored in unified memories table
  3. Linked to user ID (not platform)
  4. Available to all platforms

Memory Retrieval

Process:

  1. Any platform requests context
  2. Memory system queries by user ID
  3. Returns relevant memories
  4. Same memories available everywhere

Timeline Synchronization

Unified Timeline

Concept: All events from all platforms aggregated into single timeline.

Service: backend/src/services/timelineEvent.service.ts

Process:

  1. Event created on any platform
  2. Stored in timeline_events table
  3. Enriched with platform metadata
  4. Available in unified timeline

Event Sources

Metadata Tracking:

  • source - Platform (portal, discord, unity, mobile, bolobolomi)
  • clientType - Client type
  • yexianInstanceId - Instance ID
  • personaId - Active persona

Cross-Platform Event Ingestion

Event Ingestion API

Endpoint: POST /api/sync/ingest-event

Purpose: Allow external platforms to write events to ASO timeline

Authentication: API key (server-to-server)

Request:

json
{
  "userId": 123,
  "eventType": "platform_activity",
  "eventText": "User completed action in Unity",
  "metadata": {
    "source": "unity",
    "platform": "unity_game",
    "activity": "quest_completed"
  }
}

Process:

  1. External platform sends event
  2. Backend validates API key
  3. Creates timeline event
  4. Enriches with metadata
  5. Links to user and instance
  6. Available in unified timeline

Memory Export for Training

Client Vision

Requirement: "Memory can be shared and disseminated, and then directly become arbitrary agents (that is to say, having children, he and I will inherit the memory to create various children)."

Purpose:

  • Export memory for training future agents
  • Memory becomes training data
  • Create new ASOs from existing memories
  • Memory inheritance system

Implementation Status

Current: Memory system fully implemented Missing: Export functionality for training data format

Future Implementation

  1. Create memory export API
  2. Design training data format
  3. Build batch export functionality
  4. Add export UI
  5. Support memory inheritance

Data Flow


API Endpoints

Memory Access

  • GET /api/memories - Get user memories (JWT auth)
  • POST /api/memories - Add memory (internal)
  • GET /api/sync/universal-state - Get complete state (API key auth)

Timeline Access

  • GET /api/timeline - Get user timeline (JWT auth)
  • POST /api/sync/ingest-event - Ingest event (API key auth)

Source Files

Primary Sources:

  • backend/src/services/aso/memory.service.ts - Memory management
  • backend/src/services/timelineEvent.service.ts - Timeline management
  • backend/src/routes/sync.routes.ts - Sync endpoints

ASO Universal Consciousness System Documentation