Skip to content

cheez95/letta_dual_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

雙系統 Agent Prototype

測試「情緒 + 意識」分離架構的概念驗證。

架構

用戶輸入 
    │
    ▼
┌─────────────────┐
│   情緒 Agent    │  ← 解讀事件的情緒意義
│   (持續狀態)    │  ← 更新情緒向量
└────────┬────────┘
         │ 情緒狀態
         ▼
┌─────────────────┐
│   意識 Agent    │  ← 生成對話回應
│   (讀取情緒)    │  ← 回應風格受情緒影響
└────────┬────────┘
         │
         ▼
     Agent 回應

兩個版本

1. 簡化版(推薦先試這個)

只需要 OpenAI API,快速驗證概念。

pip install openai
export OPENAI_API_KEY=your_key

# 互動模式
python dual_agent_simple.py

# 跑預設測試場景
python dual_agent_simple.py test

2. Letta 版

完整使用 Letta 的記憶系統。

pip install letta-client

# 使用 Letta Cloud
export LETTA_API_KEY=your_key

# 或使用本地 Letta server
export LETTA_BASE_URL=http://localhost:8283

python dual_agent.py

觀察重點

  1. 情緒累積:連續正面/負面互動是否會累積影響?
  2. 回應風格:當 valence 低時,回應是否明顯更簡短保守?
  3. 情緒衰減:輸入 decay 觸發時間流逝,觀察情緒是否自然回歸中性
  4. 一致性:情緒變化是否合理,還是隨機跳動?

指令

指令 說明
emotion 顯示當前情緒狀態 JSON
decay 觸發情緒衰減(模擬時間流逝)
quit 退出

下一步可以嘗試

  1. 加入更多情緒維度(信任度、疲勞度)
  2. 讓情緒 Agent 有自己的長期記憶(什麼事情會讓它敏感)
  3. 嘗試不同的「情緒 → 行為」映射規則
  4. 加入情緒的週期性變化(模擬心情起伏)

核心假設

這個 prototype 測試的假設是:

如果情緒作為一個獨立的、持續運作的系統,而不只是 prompt 裡的一行描述, AI 的回應會更像「有內在狀態的存在」嗎?

試用後想想:你覺得有差別嗎?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages