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:
- Memory created on any platform
- Stored in unified
memoriestable - Linked to user ID (not platform)
- Available to all platforms
Memory Retrieval
Process:
- Any platform requests context
- Memory system queries by user ID
- Returns relevant memories
- 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:
- Event created on any platform
- Stored in
timeline_eventstable - Enriched with platform metadata
- Available in unified timeline
Event Sources
Metadata Tracking:
source- Platform (portal, discord, unity, mobile, bolobolomi)clientType- Client typeyexianInstanceId- Instance IDpersonaId- 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:
{
"userId": 123,
"eventType": "platform_activity",
"eventText": "User completed action in Unity",
"metadata": {
"source": "unity",
"platform": "unity_game",
"activity": "quest_completed"
}
}Process:
- External platform sends event
- Backend validates API key
- Creates timeline event
- Enriches with metadata
- Links to user and instance
- 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
- Create memory export API
- Design training data format
- Build batch export functionality
- Add export UI
- 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 managementbackend/src/services/timelineEvent.service.ts- Timeline managementbackend/src/routes/sync.routes.ts- Sync endpoints
Related Documentation
- Memory System - Memory storage and retrieval
- Timeline System - Timeline tracking and synchronization
- Universal Login - Authentication system
- BoloboloMi Integration - BoloboloMi sync and event ingestion
- Observer System - Unified timeline aggregation
- 06-ARCHITECTURE/API-Documentation.md - Sync API endpoints
- 00-OVERVIEW.md - Complete system overview