Skip to content

feat: Integrate AoTai Hike Demo with MemOS Multi-View Memory System#1078

Merged
CaralHsi merged 68 commits intoMemTensor:poly-view-with-game-demofrom
CaralHsi:feat/poly-view-mem
Feb 12, 2026
Merged

feat: Integrate AoTai Hike Demo with MemOS Multi-View Memory System#1078
CaralHsi merged 68 commits intoMemTensor:poly-view-with-game-demofrom
CaralHsi:feat/poly-view-mem

Conversation

@CaralHsi
Copy link
Collaborator

@CaralHsi CaralHsi commented Feb 11, 2026

Description

Summary

This PR integrates the AoTai Hike game demo with MemOS's multi-view memory capabilities, demonstrating how multiple game roles can maintain independent memory spaces and extract memories from their own first-person perspectives.

Key Features

1. Multi-View Memory Integration

  • World Memory: Stores global game events accessible to all roles (cube_{user_id}_world)
  • Role Memory: Each role has an independent memory space (cube_{role_id}_{role_id})
  • Automatic Mode Detection: MemOS automatically enables multi_view mode when messages contain role_id or role_name fields

2. Memory Flow

GameService.act
  ├─ add_event (world memory write with role_id/role_name)
  ├─ search (world memory retrieval)
  └─ CompanionBrain.generate
        ├─ search_memory (role memory retrieval)
        ├─ chat_complete (LLM generation)
        └─ add_memory (role memory write-back with multi-view extraction)

3. Core Implementation

MemoryAdapter (adapters/memory.py):

  • Wraps MemOS API calls (/product/add, /product/search, /product/chat/complete)
  • Supports multi-view memory writing and retrieval
  • Handles world memory and role memory isolation

CompanionBrain (adapters/companion.py):

  • Generates NPC dialogue based on role memory
  • Uses MemOS chat_complete API with role-specific context
  • Writes dialogue back to role memory with multi-view extraction

GameService (services/game_service.py):

  • Coordinates game logic with memory system
  • Formats and writes game events to memory
  • Retrieves world memory for NPC dialogue context

Technical Details

Multi-View Memory Detection

When messages contain role_id or role_name, MemOS automatically:

  1. Switches to multi_view mode
  2. Extracts memories from the role's first-person perspective
  3. Filters irrelevant information
  4. Maintains role memory isolation

Memory Namespace

  • Role memory: cube_{role_id}_{role_id}
  • World memory: cube_{user_id}_world

Files Changed

  • demos/AOTAI_Hike/backend/aotai_hike/adapters/memory.py - MemOS memory adapter
  • demos/AOTAI_Hike/backend/aotai_hike/adapters/companion.py - NPC dialogue generation
  • demos/AOTAI_Hike/backend/aotai_hike/services/game_service.py - Game service with memory integration
  • demos/AOTAI_Hike/backend/aotai_hike/router.py - API routes
  • demos/AOTAI_Hike/README.md - Updated documentation
  • demos/AOTAI_Hike/INTRODUCTION_ZH.md - Chinese documentation
  • demos/AOTAI_Hike/INTRODUCTION_EN.md - English documentation

Related Issue

Related Issue (Required): Fixes #1084

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

Reviewer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed
  • Tests have been provided

@CaralHsi CaralHsi changed the title Feat/poly view mem feat: poly view mem Feb 11, 2026
@CaralHsi CaralHsi changed the title feat: poly view mem feat: Integrate AoTai Hike Demo with MemOS Multi-View Memory System Feb 12, 2026
@CaralHsi CaralHsi marked this pull request as ready for review February 12, 2026 04:49
@CaralHsi CaralHsi merged commit aee3aea into MemTensor:poly-view-with-game-demo Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant