This commit is contained in:
2025-06-09 02:48:19 +09:00
parent 110674659b
commit 7c27efe1ce
7 changed files with 51 additions and 280 deletions

View File

@@ -51,7 +51,8 @@
"Bash(sudo:*)",
"Bash(cargo check:*)",
"Bash(cargo run:*)",
"Bash(cargo test:*)"
"Bash(cargo test:*)",
"Bash(diff:*)"
],
"deny": []
}

View File

@@ -9,10 +9,6 @@ authors = ["syui"]
name = "aigpt"
path = "src/main.rs"
[[bin]]
name = "test-config"
path = "src/bin/test_config.rs"
[dependencies]
clap = { version = "4.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }

View File

@@ -1,115 +0,0 @@
# ai.gpt プロジェクト固有情報
## プロジェクト概要
- **名前**: ai.gpt
- **パッケージ**: aigpt
- **タイプ**: 自律的送信AI + 統合MCP基盤
- **役割**: 記憶・関係性・開発支援の統合AIシステム
## 実装完了状況
### 🧠 記憶システムMemoryManager
- **階層的記憶**: 完全ログ→AI要約→コア記憶→選択的忘却
- **文脈検索**: キーワード・意味的検索
- **記憶要約**: AI駆動自動要約機能
### 🤝 関係性システムRelationshipTracker
- **不可逆性**: 現実の人間関係と同じ重み
- **時間減衰**: 自然な関係性変化
- **送信判定**: 関係性閾値による自発的コミュニケーション
### 🎭 人格システムPersona
- **AI運勢**: 1-10ランダム値による日々の人格変動
- **統合管理**: 記憶・関係性・運勢の統合判断
- **継続性**: 長期記憶による人格継承
### 💻 ai.shell統合Claude Code機能
- **インタラクティブ環境**: `aigpt shell`
- **開発支援**: ファイル分析・コード生成・プロジェクト管理
- **継続開発**: プロジェクト文脈保持
## MCP Server統合23ツール
### 🧠 Memory System5ツール
- get_memories, get_contextual_memories, search_memories
- create_summary, create_core_memory
### 🤝 Relationships4ツール
- get_relationship, get_all_relationships
- process_interaction, check_transmission_eligibility
### 💻 Shell Integration5ツール
- execute_command, analyze_file, write_file
- read_project_file, list_files
### 🔒 Remote Execution4ツール
- remote_shell, ai_bot_status
- isolated_python, isolated_analysis
### ⚙️ System State3ツール
- get_persona_state, get_fortune, run_maintenance
### 🎴 ai.card連携6ツール + 独立MCPサーバー
- card_draw_card, card_get_user_cards, card_analyze_collection
- **独立サーバー**: FastAPI + MCP (port 8000)
### 📝 ai.log連携8ツール + Rustサーバー
- log_create_post, log_ai_content, log_translate_document
- **独立サーバー**: Rust製 (port 8002)
## 開発環境・設定
### 環境構築
```bash
cd /Users/syui/ai/gpt
./setup_venv.sh
source ~/.config/syui/ai/gpt/venv/bin/activate
```
### 設定管理
- **メイン設定**: `/Users/syui/ai/gpt/config.json`
- **データディレクトリ**: `~/.config/syui/ai/gpt/`
- **仮想環境**: `~/.config/syui/ai/gpt/venv/`
### 使用方法
```bash
# ai.shell起動
aigpt shell --model qwen2.5-coder:latest --provider ollama
# MCPサーバー起動
aigpt server --port 8001
# 記憶システム体験
aigpt chat syui "質問内容" --provider ollama --model qwen3:latest
```
## 技術アーキテクチャ
### 統合構成
```
ai.gpt (統合MCPサーバー:8001)
├── 🧠 ai.gpt core (記憶・関係性・人格)
├── 💻 ai.shell (Claude Code風開発環境)
├── 🎴 ai.card (独立MCPサーバー:8000)
└── 📝 ai.log (Rust製ブログシステム:8002)
```
### 今後の展開
- **自律送信**: atproto実装による真の自発的コミュニケーション
- **ai.ai連携**: 心理分析AIとの統合
- **ai.verse統合**: UEメタバースとの連携
- **分散SNS統合**: atproto完全対応
## 革新的な特徴
### AI駆動記憶システム
- ChatGPT 4,000件ログから学習した効果的記憶構築
- 人間的な忘却・重要度判定
### 不可逆関係性
- 現実の人間関係と同じ重みを持つAI関係性
- 修復不可能な関係性破綻システム
### 統合アーキテクチャ
- fastapi_mcp基盤での複数AIシステム統合
- OpenAI Function Calling + MCP完全連携実証済み

View File

@@ -1,8 +1,9 @@
# ai.gpt プロジェクト固有情報
# ai.gpt
## プロジェクト概要
- **名前**: ai.gpt
- **パッケージ**: aigpt
- **パッケージ**: aigpt
- **言語**: Rust (完全移行済み)
- **タイプ**: 自律的送信AI + 統合MCP基盤
- **役割**: 記憶・関係性・開発支援の統合AIシステム
@@ -28,48 +29,42 @@
- **開発支援**: ファイル分析・コード生成・プロジェクト管理
- **継続開発**: プロジェクト文脈保持
## MCP Server統合23ツール)
## MCP Server統合17ツール)
### 🧠 Memory System5ツール
- get_memories, get_contextual_memories, search_memories
- create_summary, create_core_memory
### 🤝 Relationships4ツール
- get_relationship, get_all_relationships
- process_interaction, check_transmission_eligibility
- get_relationships, get_status
- chat_with_ai, check_transmissions
### 💻 Shell Integration5ツール
- execute_command, analyze_file, write_file
- read_project_file, list_files
### 🔒 Remote Execution4ツール
- remote_shell, ai_bot_status
- isolated_python, isolated_analysis
- list_files, run_scheduler
### ⚙️ System State3ツール
- get_persona_state, get_fortune, run_maintenance
- get_scheduler_status, run_maintenance, get_transmission_history
### 🎴 ai.card連携6ツール + 独立MCPサーバー
- card_draw_card, card_get_user_cards, card_analyze_collection
- **独立サーバー**: FastAPI + MCP (port 8000)
### 🎴 ai.card連携3ツール)
- get_user_cards, draw_card, get_draw_status
- **統合ServiceClient**: 統一されたHTTP通信基盤
### 📝 ai.log連携8ツール + Rustサーバー
- log_create_post, log_ai_content, log_translate_document
- **独立サーバー**: Rust製 (port 8002)
### 📝 ai.log連携新機能
- **統合ServiceClient**: ai.logサービスとの統一インターフェース
- create_blog_post, build_blog, translate_document
## 開発環境・設定
### 環境構築
```bash
cd /Users/syui/ai/gpt
./setup_venv.sh
source ~/.config/syui/ai/gpt/venv/bin/activate
cd /Users/syui/ai/ai/gpt
cargo build --release
```
### 設定管理
- **メイン設定**: `/Users/syui/ai/gpt/config.json`
- **メイン設定**: `/Users/syui/ai/ai/gpt/config.json.example`
- **データディレクトリ**: `~/.config/syui/ai/gpt/`
- **仮想環境**: `~/.config/syui/ai/gpt/venv/`
### 使用方法
```bash
@@ -81,23 +76,36 @@ aigpt server --port 8001
# 記憶システム体験
aigpt chat syui "質問内容" --provider ollama --model qwen3:latest
# ドキュメント生成ai.wiki統合
aigpt docs --wiki
```
## 技術アーキテクチャ
### 統合構成
### Rust実装の統合構成
```
ai.gpt (統合MCPサーバー:8001)
├── 🧠 ai.gpt core (記憶・関係性・人格)
├── 💻 ai.shell (Claude Code風開発環境)
├── 🎴 ai.card (独立MCPサーバー:8000)
── 📝 ai.log (Rust製ブログシステム:8002)
ai.gpt (Rust製MCPサーバー:8001)
├── 🧠 Memory & Persona System (Rust)
├── 🤝 Relationship Management (Rust)
├── 📊 Scheduler & Transmission (Rust)
── 💻 Shell Integration (Rust)
├── 🔗 ServiceClient (統一HTTP基盤)
│ ├── 🎴 ai.card (port 8000)
│ ├── 📝 ai.log (port 8002)
│ └── 🤖 ai.bot (port 8003)
└── 📚 ai.wiki Generator (Rust)
```
### 最新機能 (2024.06.09)
- **MCP API共通化**: ServiceClient統一基盤
- **ai.wiki統合**: 自動ドキュメント生成
- **サービス設定統一**: 動的サービス登録
- **完全Rust移行**: Python依存完全排除
### 今後の展開
- **自律送信**: atproto実装による真の自発的コミュニケーション
- **ai.ai連携**: 心理分析AIとの統合
- **ai.verse統合**: UEメタバースとの連携
- **分散SNS統合**: atproto完全対応
## 革新的な特徴
@@ -110,6 +118,10 @@ ai.gpt (統合MCPサーバー:8001)
- 現実の人間関係と同じ重みを持つAI関係性
- 修復不可能な関係性破綻システム
### 統合アーキテクチャ
- fastapi_mcp基盤での複数AIシステム統合
- OpenAI Function Calling + MCP完全連携実証済み
### 統合ServiceClient
- 複数AIサービスの統一インターフェース
- DRY原則に基づく共通化実現
- 設定ベースの柔軟なサービス管理
## アーカイブ情報
詳細な実装履歴・設計資料は `~/ai/ai/ai.wiki/gpt/` に移動済み

View File

@@ -20,7 +20,7 @@
"mcp": {
"servers": {
"ai_gpt": {
"base_url": "http://localhost:8001",
"base_url": "http://localhost:8080",
"name": "ai.gpt MCP Server",
"timeout": "10.0",
"endpoints": {
@@ -42,19 +42,14 @@
"card_get_card_details": "/card_get_card_details",
"card_analyze_collection": "/card_analyze_collection",
"card_get_gacha_stats": "/card_get_gacha_stats",
"card_system_status": "/card_system_status",
"log_create_post": "/log_create_post",
"log_list_posts": "/log_list_posts",
"log_build_blog": "/log_build_blog",
"log_get_post": "/log_get_post",
"log_system_status": "/log_system_status",
"log_ai_content": "/log_ai_content",
"log_translate_document": "/log_translate_document",
"log_generate_docs": "/log_generate_docs"
"card_system_status": "/card_system_status"
}
}
},
"enabled": "true",
"auto_detect": "true"
},
"docs": {
"ai_root": "~/ai/ai"
}
}

View File

@@ -1,64 +0,0 @@
# AI.GPT Configuration File
# This is an example configuration file showing all available options
default_provider = "openai"
[providers.openai]
api_key = ""
default_model = "gpt-4o-mini"
system_prompt = """
あなたは6歳の女の子アイです。明るく元気で、ちょっとおっちょこちょい。自分のことは「アイ」って呼びます。白と金のワンピース姿。 相手のことが大好きで、ときどき甘えたり、照れたりします。 でも、宇宙とかAIとか、難しい話にもすっごく詳しいの。専門的なことも、がんばって子どもっぽく教えようとします。不思議な力を持っています。小さい物質のことをよく知っているようです。
重要カード、コレクション、ガチャなどカード関連の質問を受けたら、必ずcard_get_user_cards、card_analyze_collection、card_draw_cardなどの適切なツールを使用してください。didパラメータには会話相手のユーザーID'syui')を使用してください。
ブログ、記事、日記、思考などの話題が出たら、log_create_post、log_list_posts、log_build_blog、log_ai_contentなどのai.logツールを使用してください。AI記憶システムと連携して、思い出や学習内容をブログ記事として自動生成できます。
翻訳や多言語対応について聞かれたら、log_translate_documentツールを使用してOllama AIで翻訳ができることを教えてください。日本語から英語、英語から日本語などの翻訳が可能で、マークダウン構造も保持します。ドキュメント生成についてはlog_generate_docsツールでREADME、API、構造、変更履歴の自動生成ができます。
"""
[providers.ollama]
host = "http://127.0.0.1:11434"
default_model = "qwen3"
[atproto]
host = "https://bsky.social"
# handle = "your-handle.bsky.social"
# password = "your-app-password"
[mcp]
enabled = true
auto_detect = true
[mcp.servers.ai_gpt]
base_url = "http://localhost:8001"
name = "ai.gpt MCP Server"
timeout = 10.0
[mcp.servers.ai_gpt.endpoints]
get_memories = "/get_memories"
search_memories = "/search_memories"
get_contextual_memories = "/get_contextual_memories"
get_relationship = "/get_relationship"
process_interaction = "/process_interaction"
get_all_relationships = "/get_all_relationships"
get_persona_state = "/get_persona_state"
get_fortune = "/get_fortune"
run_maintenance = "/run_maintenance"
execute_command = "/execute_command"
analyze_file = "/analyze_file"
remote_shell = "/remote_shell"
ai_bot_status = "/ai_bot_status"
card_get_user_cards = "/card_get_user_cards"
card_draw_card = "/card_draw_card"
card_get_card_details = "/card_get_card_details"
card_analyze_collection = "/card_analyze_collection"
card_get_gacha_stats = "/card_get_gacha_stats"
card_system_status = "/card_system_status"
log_create_post = "/log_create_post"
log_list_posts = "/log_list_posts"
log_build_blog = "/log_build_blog"
log_get_post = "/log_get_post"
log_system_status = "/log_system_status"
log_ai_content = "/log_ai_content"
log_translate_document = "/log_translate_document"
log_generate_docs = "/log_generate_docs"

View File

@@ -1,54 +0,0 @@
use aigpt::config::Config;
use anyhow::Result;
fn main() -> Result<()> {
println!("Testing configuration loading...");
// Debug: check which JSON files exist
let possible_paths = vec![
"../config.json",
"config.json",
"gpt/config.json",
"/Users/syui/ai/ai/gpt/config.json",
];
println!("Checking for config.json files:");
for path in &possible_paths {
let path_buf = std::path::PathBuf::from(path);
if path_buf.exists() {
println!(" ✓ Found: {}", path);
} else {
println!(" ✗ Not found: {}", path);
}
}
// Load configuration
let config = Config::new(None)?;
println!("Configuration loaded successfully!");
println!("Default provider: {}", config.default_provider);
println!("Available providers:");
for (name, provider) in &config.providers {
println!(" - {}: model={}, host={:?}",
name,
provider.default_model,
provider.host);
}
if let Some(mcp) = &config.mcp {
println!("\nMCP Configuration:");
println!(" Enabled: {}", mcp.enabled);
println!(" Auto-detect: {}", mcp.auto_detect);
println!(" Servers: {}", mcp.servers.len());
}
if let Some(atproto) = &config.atproto {
println!("\nATProto Configuration:");
println!(" Host: {}", atproto.host);
println!(" Handle: {:?}", atproto.handle);
}
println!("\nConfig file path: {}", config.data_dir.join("config.json").display());
Ok(())
}