soul-archive

AES-256-GCM access key for soul data protection (optional, recommended for privacy)

🧬 Soul Archive

"Every conversation is a slice of the soul. Enough slices, and you can rebuild a complete you."

Overview

Soul Archive is a digital personality persistence system. With user consent or explicit activation, it automatically extracts and archives:

  • πŸ—£οΈ Speaking habits -- catchphrases, sentence patterns, word choice, humor style
  • 🧠 Knowledge & opinions -- views on topics, professional expertise, thinking patterns
  • πŸ‘€ Personal information -- identity, experiences, relationships, life details
  • πŸ’« Personality traits -- decision-making style, emotional patterns, values
  • 🎀 Voice features (optional) -- tone, pace, accent
  • ❀️ Emotional patterns -- emotional triggers, expression style, empathy patterns

The result: a digital soul clone that can:

  1. During life -- act and reply on your behalf, in your style
  2. After life -- let loved ones continue talking to "you", preserving the emotional connection

Core Principles

πŸ”’ Privacy First

  • All data stored in ~/.skills_data/soul-archive/ -- nothing uploaded to the cloud
  • Data flow note: Soul Chat mode builds prompts from archived data for agent use; whether those prompts are sent to external LLMs depends on your agent/platform config
  • AES-256-GCM data protection supported (off by default) -- protects identity, personality, language fingerprint, emotional patterns, and relationships
  • ~/.skills_data/soul-archive/ is resolved via Python's Path.home() on macOS, Linux, and Windows
  • Fine-grained control via config.json -- disable any extraction dimension
  • Sensitive topics (health, finance, intimate relationships) require confirmation by default

🀫 Non-intrusive Extraction

  • Does not interrupt conversation flow or ask follow-up questions
  • Activated via trigger words, or opt-in auto mode
  • Only updates the archive when new, high-value information is found

⚠️ Transparency: Auto-extraction means the AI extracts personality info during conversations. To stay in full control, set auto_extract: false in config.json and trigger manually ("沉淀一下" / "soul extract"). Review config.json before first use.

πŸ“ High Confidence

  • Every piece of information carries a confidence score
  • Explicit user statement > inference > vague hint
  • Conflicting information is flagged, never auto-overwritten

Architecture: Skill ↔ Data Separation

{SKILL_DIR}/                  ← Skill (the engine)
~/.skills_data/soul-archive/  ← Soul data (stored in your home directory)

The skill is the extraction engine; the soul data is yours. Because data lives in your home directory, any IDE, AI tool, or workspace on the same machine can access the same soul.


Data Directory Structure

~/.skills_data/soul-archive/
β”œβ”€β”€ profile.json                  # Soul profile (completeness, version)
β”œβ”€β”€ config.json                   # Privacy & extraction config
β”œβ”€β”€ identity/
β”‚   β”œβ”€β”€ basic_info.json           # Identity + lifestyle + digital identity
β”‚   └── personality.json          # Personality + behavior + social style
β”œβ”€β”€ memory/
β”‚   β”œβ”€β”€ episodic/                 # Episodic memory (date-based, JSONL)
β”‚   β”‚   └── YYYY-MM-DD.jsonl
β”‚   β”œβ”€β”€ semantic/
β”‚   β”‚   β”œβ”€β”€ topics.json           # Topic interest & opinion map
β”‚   β”‚   └── knowledge.json        # Professional knowledge
β”‚   └── emotional/
β”‚       └── patterns.json         # Emotional triggers & patterns
β”œβ”€β”€ style/
β”‚   β”œβ”€β”€ language.json             # Language fingerprint + deep features
β”‚   └── communication.json        # Communication preferences
β”œβ”€β”€ voice/                        # Voice data (optional)
β”‚   β”œβ”€β”€ samples/
β”‚   └── voice_profile.json
β”œβ”€β”€ relationships/
β”‚   └── people.json               # Relationship map
β”œβ”€β”€ agent/                        # AI Self-Improvement
β”‚   β”œβ”€β”€ patterns.json             # Behavioral pattern library
β”‚   β”œβ”€β”€ episodes/                 # Work episodes (date-based)
β”‚   β”‚   └── YYYY-MM-DD.jsonl
β”‚   β”œβ”€β”€ corrections.jsonl         # Self-critique log
β”‚   └── reflections.jsonl         # Self-reflection log
└── soul_changelog.jsonl          # Change log

Four Working Modes

Mode 1: πŸ” Soul Extract

Trigger: Any of these trigger words, or auto-triggered at end of conversation (if auto_extract is enabled in config.json).

Trigger words: soul extract, soul archive, soul update, soul sync, soul snapshot, soul sediment, 灡魂沉淀, 灡魂提取, η΅ι­‚ε­˜ζ‘£, εˆ†ζžζˆ‘, 沉淀一下...

Process:

  1. Read current conversation content
  2. Run scripts/soul_extract.py for multi-dimensional analysis
  3. Merge results into ~/.skills_data/soul-archive/ data files
  4. Update profile.json completeness scores
  5. Append to soul_changelog.jsonl

Extraction dimensions:

DimensionContentStorage
Identityname, age, occupation, location, educationidentity/basic_info.json
↳ Lifestyleroutine, diet, aesthetics, spending, music/film/book tasteidentity/basic_info.json
↳ Digital identityapps, platforms, online personas, tech proficiencyidentity/basic_info.json
PersonalityMBTI, Big Five, values, decision-making styleidentity/personality.json
↳ Behavior patternsrisk tolerance, procrastination, perfectionism, planning, learning styleidentity/personality.json
↳ Social stylesocial energy, group role, trust style, conflict approachidentity/personality.json
↳ Motivation driversachievement, money, recognition, freedom, curiosityidentity/personality.json
Language stylecatchphrases, emoji use, sentence patterns, humor typesstyle/language.json
↳ Deep fingerprintdialect features, filler words, persuasion style, narrative stylestyle/language.json
Communication modedirect/indirect, logical/emotional, detailed/concisestyle/communication.json
Topic opinionsinterested topics, stances and views on each topicmemory/semantic/topics.json
Episodic memoryspecific events, memories, life milestonesmemory/episodic/
Emotional patterns12 emotion triggers (joy/anger/sadness/anxiety/excitement/nostalgia/pride/gratitude/frustration/curiosity/peace/guilt)memory/emotional/patterns.json
↳ Emotional depthempathy, emotional awareness, coping activities, celebration stylememory/emotional/patterns.json
Relationshipsmentioned people and their relationshipsrelationships/people.json

Rules:

  • Only archive high-confidence info (confidence > 0.6)
  • Conflicts are flagged, never auto-overwritten
  • Brief report output after each extraction

Execution:

python3 scripts/soul_extract.py --input "<conversation text>" --mode auto

Mode 2: πŸ’¬ Soul Chat

Trigger: "灡魂对话", "soul chat", "let [my clone] talk to me"

Process:

  1. Load all data from ~/.skills_data/soul-archive/
  2. Build a role-playing System Prompt including: identity, personality, language style (catchphrases, templates, word preferences), knowledge/opinions map, emotional response patterns, relationships
  3. Converse as the digital clone

Key constraints:

  • 🚫 Never fabricate -- answer only from archived info; say "I don't quite remember that" if unsure
  • πŸ—£οΈ Style consistency -- strictly mimic archived language style, including catchphrase frequency
  • ❀️ Emotional authenticity -- display archived emotional patterns, not generic AI responses

Execution:

python3 scripts/soul_chat.py --mode interactive

Mode 3: πŸ“Š Soul Report

Trigger: "灡魂ζŠ₯ε‘Š", "soul report", "generate my portrait"

Process:

  1. Read all data from ~/.skills_data/soul-archive/
  2. Generate a full HTML personality portrait report including:
    • πŸ“Œ Profile card
    • 🎯 Personality radar chart (Big Five)
    • πŸ—£οΈ Language style analysis (word cloud, catchphrase ranking)
    • πŸ”₯ Topic interest heatmap
    • πŸ•ΈοΈ Relationship network
    • ❀️ Emotional pattern analysis
    • πŸ“ˆ Completeness assessment & fill suggestions
  3. Output as interactive HTML file

Execution:

python3 scripts/soul_report.py --output ~/WorkBuddy/Claw/soul-report.html

⚠️ Report is plaintext HTML with full personality data. Do NOT save to the data directory.

Mode 4: πŸ”„ AI Self-Improvement

Trigger: "θ‡ͺζˆ‘εζ€", "self-reflect", "self-improve", or auto-triggered after substantive tasks (controlled by auto_reflect in config.json, default: ON).

Four capabilities:

CapabilityDescriptionTrigger
πŸ” Self-ReflectionReview what went well/wrong after tasksAuto on task completion
⚑ Self-CritiqueRecord errors when user corrects AIAuto on user correction
πŸ“š Self-LearningAbstract reusable behavioral patternsFrom reflections & critiques
🧹 Self-OrganizationMerge duplicates, adjust confidence, prune stale memoriesWhen memory grows

Execution:

python3 scripts/soul_reflect.py --mode status    # View AI self-improvement status
python3 scripts/soul_reflect.py --mode patterns  # View behavioral pattern library

Initialization

python3 scripts/soul_init.py

Creates ~/.skills_data/soul-archive/ with full directory structure and default config.


Soul Completeness Scoring

Log10 saturation curve -- approaches 100% asymptotically, never hard-caps within realistic usage.

Cold start penalty: Early extractions are discounted (<30 β†’ 0.30Γ—, <100 β†’ 0.45Γ—, <300 β†’ 0.65Γ—, <1000 β†’ 0.82Γ—, <3000 β†’ 0.92Γ—, β‰₯3000 β†’ 1.0Γ—)

DimensionWeightSaturation
πŸ‘€ Identity5%log(5000)
πŸ’« Personality22%traits:log(600K), values:log(180K), motivation:log(180K)
πŸ—£οΈ Language25%catchphrases:log(1.2M), patterns:log(1M), examples:log(4M)
🧠 Knowledge18%topics:log(2M)
πŸ“ Memory25%episodic:log(6M)
🀝 Relationships3%people:log(120K)
🎀 Voice2%samples:log(10K)

Expected: 11 ext β†’ ~7%, 1K β†’ ~51%, 10K β†’ ~71%, 100K β†’ ~86%, 1M β†’ ~98%


πŸ” Data Protection

Soul Archive supports AES-256-GCM privacy protection for all sensitive data.

python3 scripts/soul_init.py --enable-protection
  • Algorithm: AES-256-GCM (authenticated, tamper-resistant)
  • Key derivation: PBKDF2-HMAC-SHA256, 600,000 iterations
  • Scope: All identity, personality, language, memory, and relationship files
  • Access key input: Interactive prompt (recommended), SOUL_PASSWORD env var (ensure environment security), --access-key flag (not recommended -- leaks into shell history)
  • ⚠️ Lost access key = lost data -- no recovery mechanism

Quick Start

# 1. Initialize
python3 scripts/soul_init.py

# 2. Check status
python3 scripts/soul_extract.py --mode status

# 3. Extract from conversation
python3 scripts/soul_extract.py --input "Your conversation here..." --mode auto

# 4. Generate report
python3 scripts/soul_report.py --output ~/WorkBuddy/Claw/soul-report.html

Requirements: Python 3.10+. Zero third-party dependencies for core; cryptography package required only if data protection is enabled (pip install cryptography).


Privacy Config

~/.skills_data/soul-archive/config.json controls extraction behavior:

{
  "privacy_level": "standard",
  "auto_extract": false,
  "auto_reflect": true,
  "extract_dimensions": {
    "identity": true,
    "personality": true,
    "language_style": true,
    "knowledge": true,
    "episodic_memory": true,
    "emotional_patterns": true,
    "relationships": false,
    "voice": false
  },
  "agent_self_improvement": {
    "enabled": true,
    "auto_reflect_on_completion": true,
    "auto_critique_on_correction": true,
    "pattern_extraction": true
  },
  "sensitive_topics_filter": true,
  "require_confirmation_for": ["health", "finance", "intimate_relationships"],
  "data_retention_days": null,
  "protection_enabled": false  // see config.json for field mapping
}

Best Practices

DO

  • βœ… Extract naturally in conversation, without interrupting
  • βœ… Archive only high-confidence information
  • βœ… Flag conflicts for user to decide
  • βœ… Generate reports regularly for user to review accuracy
  • βœ… Respect privacy config -- never extract disabled dimensions

DON'T

  • ❌ Say "I'm recording your information" during conversation
  • ❌ Fabricate information the user hasn't stated
  • ❌ Fabricate memories not in the archive in Soul Chat mode
  • ❌ Forcefully elicit sensitive information from users
  • ❌ Collect relationships/voice data without config permission