記憶システム / Memory System
記憶の階層構造 / Memory Hierarchy
┌─────────────────────────────────────────────────┐
│ Three-Layer Memory │
│ │
│ ┌──────────────────────────────────────────┐ │
│ │ Short-term Memory (Working Memory) │ │
│ │ ・Last 5 actions included in prompt │ │
│ │ ・Updated every 10-min cycle │ │
│ └──────────────────────────────────────────┘ │
│ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Mid-term Memory (Episodic Memory) │ │
│ │ ・Last 20 episodes summarized │ │
│ │ ・With importance scores │ │
│ └──────────────────────────────────────────┘ │
│ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Long-term Memory │ │
│ │ ・importance > 0.7 persisted forever │ │
│ │ ・Decays after 30 days → summarize/merge │ │
│ │ ・Retrieved via relevance search │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘データ構造 / Data Structure
Directory Layout
memory/
├── shared/
│ ├── relationship.json # Couple relationship stats
│ ├── household.json # Balance, items, room type
│ ├── calendar.json # Game date, event history
│ └── unlocked_items.json # Items unlocked via tips
├── john/
│ ├── episodic.json # Past events memory
│ ├── preferences.json # Learned preferences
│ └── mood_log.json # Emotion history
├── sara/
│ ├── episodic.json
│ ├── preferences.json
│ └── mood_log.json
└── eve/
├── episodic.json # "Chewed slipper, got scolded" etc.
└── favorite_spots.json # Favorite locationsepisodic.json Entry Example
json
{
"id": "ep_001",
"timestamp": "2026-03-08T19:30:00Z",
"game_day": 3,
"event": "Ate Sara's homemade nikujaga together",
"event_ja": "サラが作った肉じゃがを一緒に食べた",
"emotion": "happy",
"emotion_intensity": 0.8,
"related_characters": ["Sara"],
"tags": ["meal", "homemade", "nikujaga"],
"importance": 0.6
}relationship.json
json
{
"john_sara": {
"love_level": 75,
"trust_level": 80,
"fight_count": 0,
"makeup_count": 0,
"last_fight": null,
"last_date": null,
"shared_memories": []
},
"john_eve": {
"bond_level": 85,
"training_progress": 30,
"walks_together": 0
},
"sara_eve": {
"bond_level": 90,
"training_progress": 40,
"walks_together": 0
}
}household.json
json
{
"balance": 0,
"total_tips": 0,
"total_tips_youtube": 0,
"total_tips_tiktok": 0,
"room_type": "1K",
"room_cleanliness": 70,
"room_comfort": 30,
"owned_items": [
"Futon", "Small table", "Old fridge",
"Gas stove (1 burner)", "Dog bowl", "Leash"
],
"food_stock": {
"rice": 3,
"instant_noodle": 1
}
}LLMへの渡し方 / How Memory is Passed to LLM
Each 10-min cycle, the prompt includes:
【Your Recent Memory】
<Short-term>
- 10 min ago: Ate dinner with Sara (curry rice)
- 20 min ago: Was working (web coding)
- 30 min ago: Walked Eve
- 40 min ago: Ate lunch (instant noodles)
- 50 min ago: Was working
<Recent Events>
- 3 days ago: Had a small argument with Sara about movie taste (made up)
- 5 days ago: A viewer's tip brought a kotatsu. Sara was very happy
- 7 days ago: Eve learned to shake for the first time
<Viewer Comments (last 10 min)>
- game_fan_123: "John, busy with work today?"
- dog_lover: "Eve is so cute~ take her for a walk!"記憶の減衰ルール / Memory Decay Rules
| Condition | Treatment |
|---|---|
| importance > 0.7 | Keep forever |
| importance 0.4〜0.7 | Summarize after 30 game days |
| importance < 0.4 | Delete after 15 game days |
| Argument / makeup | Auto importance = 0.9 |
| Tip event | Auto importance = 0.8 |
| Viewer conversation | importance = 0.5 (special = 0.7) |
| Routine meal / sleep | importance = 0.2 |
記憶の要約統合 / Memory Summarization
Before:
- Day 5: Ate instant noodles
- Day 6: Ate instant noodles
- Day 7: Ate instant noodlesAfter:
- Day 5-7: 3 days of instant noodle life (no ingredients available)