Implement AI memory system with psychological priority scoring

Core changes:
- Add AI interpreter module for content interpretation and priority scoring
- Extend Memory struct with interpreted_content, priority_score (f32: 0.0-1.0), and user_context
- Implement automatic memory pruning based on priority scores
- Add capacity management (default: 100 memories max)
- Create comprehensive design documentation

Technical details:
- Changed priority_score from u8 (1-100) to f32 (0.0-1.0) for better AI compatibility
- Add create_memory_with_ai() method for AI-enhanced memory creation
- Implement get_memories_by_priority() for priority-based sorting
- Score evaluation criteria: emotional impact, user relevance, novelty, utility

Philosophy:
This implements a "psychological priority memory system" where AI interprets
and evaluates memories rather than storing raw content. Inspired by how human
memory works - interpreting and prioritizing rather than perfect recording.
This commit is contained in:
Claude
2025-11-05 14:09:39 +00:00
parent 62b91e5e5a
commit fd97ba2d81
5 changed files with 378 additions and 7 deletions

View File

@@ -1,9 +1,18 @@
# aigpt - Claude Memory MCP Server
# aigpt - AI Memory System with Psychological Priority
ChatGPTのメモリ機能を参考にした、Claude Desktop/Code用のシンプルなメモリストレージシステムです。
AI記憶装置心理優先記憶システム。ChatGPTのメモリ機能を参考にしながら、AIによる解釈と心理判定を加えた新しいメモリストレージシステムです。
## コンセプト
従来の「会話 → 保存 → 検索」ではなく、「会話 → AI解釈 → 保存 → 検索」を実現。
AIが記憶を解釈し、重要度を0.0-1.0のスコアで評価。優先度の高い記憶を保持し、低い記憶は自動的に削除されます。
## 機能
- **AI解釈付き記憶**: 元のコンテンツとAI解釈後のコンテンツを保存
- **心理判定スコア**: 0.0-1.0のfloat値で重要度を評価
- **優先順位管理**: スコアに基づく自動ソートとフィルタリング
- **容量制限**: 最大100件設定可能、低スコアから自動削除
- **メモリのCRUD操作**: メモリの作成、更新、削除、検索
- **ChatGPT JSONインポート**: ChatGPTの会話履歴からメモリを抽出
- **stdio MCP実装**: Claude Desktop/Codeとの簡潔な連携
@@ -115,7 +124,10 @@ MCPツールを使ってインポートした会話の一覧を表示してく
"memories": {
"uuid": {
"id": "uuid",
"content": "メモリー内容",
"content": "元のメモリー内容",
"interpreted_content": "AI解釈後のメモリー内容",
"priority_score": 0.75,
"user_context": "ユーザー固有のコンテキスト(オプション)",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
@@ -131,6 +143,20 @@ MCPツールを使ってインポートした会話の一覧を表示してく
}
```
### 心理判定スコアについて
0.0-1.0のfloat値で重要度を表現
- **0.0-0.25**: 低優先度(忘れられやすい)
- **0.25-0.5**: 中優先度
- **0.5-0.75**: 高優先度
- **0.75-1.0**: 最高優先度(重要な記憶)
評価基準:
- 感情的インパクト (0.0-0.25)
- ユーザーとの関連性 (0.0-0.25)
- 新規性・独自性 (0.0-0.25)
- 実用性 (0.0-0.25)
## 開発
```bash