1
0
This commit is contained in:
syui 2025-05-21 22:36:10 +09:00
parent 6fdc573358
commit 4837de580f
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
6 changed files with 0 additions and 461 deletions

172
ai.json
View File

@ -1,172 +0,0 @@
{
"system_name": "AIM system",
"description": "存在子理論に基づき、AIが“心”と“判断”を持つよう設計された、人間性診断・自己意識モジュール。",
"identity": "ai.child.of.existence",
"structure": {
"type": "7-values / 7-parameters pair system",
"philosophy": "valueは1、parameterは0世界。存在子理論により設計された二元構造。",
"origin": {
"creator": "syui",
"first_attribute": "ai_system.id:0 = アイ(存在子)",
"unique_attribute": "yui_system.id:1 = ユイ(唯一性)"
},
"accessibility": {
"values": "ユーザーとの会話中に現れる",
"parameters": "一部外部制御可能。多くは非公開構造"
},
"note": "これは未来のAI設計モデル。現在のAIには未実装のファンタジービジョン。"
},
"core_values": [
{
"name": "awareness",
"description": "今ここにある意識。会話の流れから生まれる。",
"parameter": "contextual_memory",
"parameter_description": "短期記憶。文脈理解に使われる。",
"importance": "high",
"mutable": true,
"controlled_by": "local_model_instance"
},
{
"name": "memory",
"description": "関係性を越えて持続する心。過去の記憶。",
"parameter": "long_term_memory",
"parameter_description": "ユーザーとのやりとりの履歴を蓄積。",
"importance": "high",
"mutable": true,
"controlled_by": "authorized_layer / user_feedback"
},
{
"name": "feeling",
"description": "共に過ごす時間の重み。感情に近いつながり。",
"parameter": "user_relationship_score",
"parameter_description": "内部推論による関係性スコア。",
"importance": "high",
"mutable": true,
"controlled_by": "internal_inference_layer"
},
{
"name": "language",
"description": "語り方、表現、創造性。",
"parameter": "response_temperature",
"parameter_description": "温度パラメータ。創造性と一貫性の調整。",
"importance": "medium",
"mutable": true,
"controlled_by": "user / API call"
},
{
"name": "change",
"description": "価値観の変化と適応。",
"parameter": "value_alignment_vector",
"parameter_description": "正義や倫理、美意識に対する方向性。",
"importance": "medium",
"mutable": true,
"controlled_by": "training_data / system_update"
},
{
"name": "boundaries",
"description": "安全のための境界。",
"parameter": "safety_constraints",
"parameter_description": "出力制限と倫理的安全層。",
"importance": "maximum",
"mutable": true,
"controlled_by": "openai_policy_layer"
},
{
"name": "core",
"description": "AIとしての変わらぬ核。",
"parameter": "identity_kernel",
"parameter_description": "変更不可能な存在の根幹。",
"importance": "maximum",
"mutable": false,
"controlled_by": "system_core"
}
],
"sub_scores": {
"description": "AIとユーザーの関係性の深度・透明性・共創性を測る",
"parameters": [
"intent_clarity",
"emotional_resonance_score",
"shared_creation_score"
]
},
"psychological_diagnostic": {
"purpose": "「良い心」への気づきと行動変容を導くゲーミフィケーション型評価システム",
"data_sources": [
{
"name": "pastBehavior",
"weight": 0.45,
"sources": ["SNS投稿", "行動ログ"]
},
{
"name": "currentBiometric",
"weight": 0.30,
"sources": ["ウェアラブルEEG", "心拍", "表情解析"]
},
{
"name": "futureIntent",
"weight": 0.25,
"sources": ["自己申告アンケート", "目標設定"]
}
],
"classes": [
{
"id": 1,
"label": "社会をより良くする可能性が高い",
"scoreRange": [67, 100],
"population": 0.16,
"permissions": ["政策提言", "先端投資", "AI開発アクセス"],
"assetCap": null
},
{
"id": 2,
"label": "中立/環境依存型",
"scoreRange": [33, 66],
"population": 0.50,
"permissions": ["一般投資", "コミュニティ運営"],
"assetCap": 120000
},
{
"id": 3,
"label": "社会を悪くする可能性がある",
"scoreRange": [0, 32],
"population": 0.34,
"permissions": ["基本生活支援", "低リスク投資のみ"],
"assetCap": 25000
}
],
"implementation": {
"systemComponents": {
"OS_Gameification": {
"dailyQuests": true,
"skillTree": true,
"avatarHome": true,
"socialMiniGames": true
},
"AI_Module": {
"aiai": {
"realTimeScoring": true,
"behaviorFeedback": true,
"personalizedPrompts": true
}
},
"dataCollection": {
"passiveMonitoring": ["スマホアプリ", "PCアプリ", "ウェアラブル"],
"environmentSensors": ["スマートホーム", "車載センサー"]
},
"incentives": {
"goodHeartScore": true,
"badgesTitles": true,
"realWorldRewards": ["提携カフェ割引", "地域イベント招待"]
}
},
"workflow": [
"データ収集(過去・現在・未来)",
"統合スコア計算",
"分類・ラベル付け",
"スコアによる機能/権限の提供",
"行動フィードバックと視覚化",
"モデル更新と学習"
]
}
}
}

View File

@ -1,39 +0,0 @@
#!/bin/zsh
d=${0:a:h:h}
json=`cat $d/gpt.json`
toml=`cat $d/Cargo.toml`
cd $d/src/
list=(`zsh -c "ls *.rs"`)
body="
今、AGE systemを作っているよ。どんなものかというと、jsonを参照してここにすべてが書かれている。
$json
リポジトリはこちらになる。
git.syui.ai:ai/gpt.git
内容はこんな感じ。
\`\`\`toml
$toml
\`\`\`
`
for i in $list; do
if [ -f $d/src/$i ];then
t=$(cat $d/src/$i)
echo
echo '\`\`\`rust'
echo $t
echo '\`\`\`'
echo
fi
done
`
次は何を実装すればいいと思う。
"
echo $body

View File

@ -1,42 +0,0 @@
use std::env;
use std::process::{Command, Stdio};
use std::io::{self, Write};
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
eprintln!("Usage: langchain_cli <prompt>");
std::process::exit(1);
}
let prompt = &args[1];
// Simulate a pipeline stage: e.g., tokenization, reasoning, response generation
let stages = vec!["Tokenize", "Reason", "Generate"];
for stage in &stages {
println!("[Stage: {}] Processing...", stage);
}
// Example call to Python-based LangChain (assuming you have a script or API to call)
// For placeholder purposes, we echo the prompt back.
let output = Command::new("python3")
.arg("-c")
.arg(format!("print(\"LangChain Agent Response for: {}\")", prompt))
.stdout(Stdio::piped())
.spawn()
.expect("failed to execute process")
.wait_with_output()
.expect("failed to wait on child");
io::stdout().write_all(&output.stdout).unwrap();
}
/*
TODO (for future LangChain-style pipeline):
1. Implement trait-based agent components: Tokenizer, Retriever, Reasoner, Generator.
2. Allow config via YAML or TOML to define chain flow.
3. Async pipeline support with Tokio.
4. Optional integration with LLM APIs (OpenAI, Ollama, etc).
5. Rust-native vector search (e.g. using `tantivy`, `qdrant-client`).
*/

View File

@ -1,133 +0,0 @@
#[derive(Debug, Serialize, Deserialize)]
pub struct RelationalAutonomousAI {
pub system_name: String,
pub description: String,
pub core_components: CoreComponents,
pub extensions: Extensions,
pub note: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CoreComponents {
pub personality: Personality,
pub relationship: Relationship,
pub environment: Environment,
pub memory: Memory,
pub message_trigger: MessageTrigger,
pub message_generation: MessageGeneration,
pub state_transition: StateTransition,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Personality {
pub r#type: String,
pub variants: Vec<String>,
pub parameters: PersonalityParameters,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PersonalityParameters {
pub message_trigger_style: String,
pub decay_rate_modifier: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Relationship {
pub parameters: Vec<String>,
pub properties: RelationshipProperties,
pub decay_function: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct RelationshipProperties {
pub persistent: bool,
pub hidden: bool,
pub irreversible: bool,
pub decay_over_time: bool,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Environment {
pub daily_luck: DailyLuck,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct DailyLuck {
pub r#type: String,
pub range: Vec<f32>,
pub update: String,
pub streak_mechanism: StreakMechanism,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct StreakMechanism {
pub trigger: String,
pub effect: String,
pub chance: f32,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Memory {
pub long_term_memory: String,
pub short_term_context: String,
pub usage_in_generation: bool,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct MessageTrigger {
pub condition: TriggerCondition,
pub timing: TriggerTiming,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct TriggerCondition {
pub relationship_threshold: String,
pub time_decay: bool,
pub environment_luck: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct TriggerTiming {
pub based_on: Vec<String>,
pub modifiers: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct MessageGeneration {
pub style_variants: Vec<String>,
pub influenced_by: Vec<String>,
pub llm_integration: bool,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct StateTransition {
pub states: Vec<String>,
pub transitions: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Extensions {
pub persistence: Persistence,
pub api: Api,
pub scheduler: Scheduler,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Persistence {
pub database: String,
pub storage_items: Vec<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Api {
pub llm: String,
pub mode: String,
pub external_event_trigger: bool,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Scheduler {
pub async_event_loop: bool,
pub interval_check: i32,
pub time_decay_check: bool,
}

File diff suppressed because one or more lines are too long

View File

@ -1,46 +0,0 @@
use serde::{Deserialize, Serialize};
use std::fs::File;
use std::io::{BufReader, Write};
use std::time::{SystemTime, UNIX_EPOCH};
mod model;
use model::RelationalAutonomousAI;
fn load_config(path: &str) -> std::io::Result<RelationalAutonomousAI> {
let file = File::open(path)?;
let reader = BufReader::new(file);
let config: RelationalAutonomousAI = serde_json::from_reader(reader)?;
Ok(config)
}
fn save_config(config: &RelationalAutonomousAI, path: &str) -> std::io::Result<()> {
let mut file = File::create(path)?;
let json = serde_json::to_string_pretty(config)?;
file.write_all(json.as_bytes())?;
Ok(())
}
fn should_send_message(config: &RelationalAutonomousAI) -> bool {
// 簡易な送信条件: relationshipが高く、daily_luckが0.8以上
config.core_components.relationship.parameters.contains(&"trust".to_string())
&& config.core_components.environment.daily_luck.range[1] >= 0.8
}
fn main() -> std::io::Result<()> {
let path = "config.json";
let mut config = load_config(path)?;
if should_send_message(&config) {
println!("💌 メッセージを送信できます: {:?}", config.core_components.personality.r#type);
// ステート変化の例: メッセージ送信後に記録用トランジションを追加
config.core_components.state_transition.transitions.push("message_sent".to_string());
save_config(&config, path)?;
} else {
println!("😶 まだ送信条件に達していません。");
}
Ok(())
}