Skip to content

who96/soulcraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ SoulCraft

English | ไธญๆ–‡

Craft AI souls from humanity's greatest minds.

SoulCraft is a data-driven persona extraction pipeline that transforms real human data (interviews, speeches, letters, social media) into structured AI personality definitions compatible with multi-agent systems like OpenClaw, Claude Code, and Codex.

"We don't write personas. We extract them from reality."


๐ŸŒŸ Vision

Imagine a world where the greatest minds in human history can collaborate:

  • Cao Cao (ๆ›นๆ“) routes and reviews all decisions as your CEO
  • Warren Buffett reviews your investment thesis
  • Elon Musk challenges your product with first-principles thinking
  • Linus Torvalds reviews your code architecture
  • Zhuge Liang (่ฏธ่‘›ไบฎ) architects your system design

SoulCraft makes this possible โ€” not through shallow role-play prompts, but through deep, evidence-based persona extraction from real human data. Each soul is an atomic, reusable unit. Mix and match freely across teams.


๐Ÿ—๏ธ Architecture

L0 Adapter          L1 Extraction       L1.5 Aggregation    L2 Profile          +1 System Prompt
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€         โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€       โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€          โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Heterogeneous  โ”€โ”€โ†’  Structured     โ”€โ”€โ†’  Knowledge      โ”€โ”€โ†’  Persona        โ”€โ”€โ†’  soul.md /
Data Sources        Extraction          Bible               Profile             System Prompt
(interviews,        (per-file)          (unified)           (ABCDE layers)      (deployable)
letters, tweets)

The ABCDE Persona Model

Layer Name What it captures
A Soul Core identity, worldview, beliefs
B Cognition Knowledge systems, theories, intellectual sources
C Expression Speech patterns, catchphrases, rhetorical style
D Behavior Situational responses, teaching style, preferences
E Meta Blind spots (explicit + inferred), conflict resolution patterns

๐Ÿ“ฆ Components

L0 Adapter โ€” Data Source Converter

Converts heterogeneous data into a unified transcript format. Zero LLM dependency โ€” pure structural conversion.

# Interview subtitles โ†’ dialogue format
python -m l0_adapter --type DLG \
  --input podcast_interview.srt \
  --output transcripts/ \
  --target-speaker "Elon Musk"

# Shareholder letters โ†’ monologue format
python -m l0_adapter --type MON \
  --input "buffett_letters/*.pdf" \
  --output transcripts/ \
  --target-speaker "Warren Buffett"

# Tweets โ†’ grouped micro-burst format
python -m l0_adapter --type MIC \
  --input tweets.json \
  --output transcripts/ \
  --target-speaker "Elon Musk" \
  --group-by thread

Source types by communication mode:

Type Mode Sources
DLG Dialogue Interviews, podcasts, email threads
MON Monologue Letters, speeches, blog posts
MIC Micro-burst Tweets, social media posts
ATT Attributed Biographies, news articles

3+1 Pipeline โ€” Persona Extraction Engine

A 4-stage pipeline driven by a master prompt template:

  1. L1 Knowledge Extraction โ€” Per-file structured extraction with source tracing
  2. L1.5 Aggregation โ€” Knowledge graph + persona data consolidation
  3. L2 Persona Profile โ€” ABCDE five-layer persona decomposition
  4. +1 System Prompt โ€” Compile into deployable soul.md / System Prompt

๐Ÿ“‚ Project Structure

soulcraft/
โ”œโ”€โ”€ souls/                              โ† Atomic units
โ”‚   โ”œโ”€โ”€ cao-cao/
โ”‚   โ”‚   โ”œโ”€โ”€ soul.md                     โ† Base soul: pure personality
โ”‚   โ”‚   โ””โ”€โ”€ teams/three-kingdoms/
โ”‚   โ”‚       โ””โ”€โ”€ soul.md                 โ† Team-tuned: personality + orchestration directives
โ”‚   โ”œโ”€โ”€ zhuge-liang/
โ”‚   โ”‚   โ”œโ”€โ”€ soul.md
โ”‚   โ”‚   โ””โ”€โ”€ teams/three-kingdoms/soul.md
โ”‚   โ”œโ”€โ”€ warren-buffett/soul.md
โ”‚   โ””โ”€โ”€ elon-musk/soul.md
โ”‚
โ”œโ”€โ”€ teams/                              โ† Team manifest files
โ”‚   โ”œโ”€โ”€ three-kingdoms.yaml             โ† References team-tuned souls
โ”‚   โ””โ”€โ”€ dream-company.yaml
โ”‚
โ”œโ”€โ”€ l0_adapter/                         โ† Data source converter (DLG/MON/MIC/ATT)
โ””โ”€โ”€ docs/                               โ† Pipeline templates & documentation

๐Ÿงฌ Dual-Layer Soul Model

Like open-source LLMs, SoulCraft provides two modes:

Mode Analogy What it contains
Base Soul Qwen-base Pure personality. No orchestration. Use as-is or fine-tune yourself.
Team-Tuned Soul Qwen-instruct Personality + orchestration directives (who reports to whom, conflict rules, trust levels).

Orchestration is embedded in the persona file, not in a separate routing engine. The host framework (OpenClaw, CrewAI, AutoGen) handles execution.

A team-tuned soul adds:

  • Chain of command (who is the superior, who are subordinates)
  • Request routing rules (what to handle, what to delegate)
  • Conflict arbitration strategy
  • Trust level and review policies

๐Ÿฏ Team Templates

Three Kingdoms Management Team

Role Soul Why
CEO / Router Cao Cao (ๆ›นๆ“) Cross-validates outputs, trust-level based delegation, fast course-correction
COO Xun Yu (่€ๅฝง) Resource allocation, operational planning
CSO Guo Jia (้ƒญๅ˜‰) Risk assessment, competitive strategy
CTO Zhuge Liang (่ฏธ่‘›ไบฎ) System architecture, technical decisions
VP Engineering Zhang Liao (ๅผ ่พฝ) Execution, implementation, delivery
Red Team Sima Yi (ๅธ้ฉฌๆ‡ฟ) Adversarial review, find weaknesses

Built-in conflict dynamics: CTO vs Red Team (healthy adversarial tension), CSO (aggressive) vs COO (conservative) strategic balance, CEO as final arbiter.


๐Ÿ”Œ Integration

SoulCraft is a compiler, not a runtime. It produces soul artifacts; host frameworks execute them.

# Export to different frameworks
soulcraft export warren-buffett --target openclaw   # โ†’ .openclaw/soul.md
soulcraft export warren-buffett --target crewai      # โ†’ Agent(role, backstory, ...)
soulcraft export warren-buffett --target autogen      # โ†’ AssistantAgent config

OpenClaw

.openclaw/
โ”œโ”€โ”€ soul.md          โ† Generated by SoulCraft
โ”œโ”€โ”€ identity.md
โ””โ”€โ”€ agents.md

Canonical Soul IR

Under the hood, SoulCraft maintains a soul.json (or .yaml) as the source of truth. soul.md is a human-readable compilation target. The IR includes ABCDE layers, provenance (source quotes, confidence scores, parser type), and version metadata.


๐Ÿš€ Quick Start

git clone https://github.com/who96/soulcraft.git
cd soulcraft

# Convert interview subtitles to unified format
python -m l0_adapter --type DLG \
  --input examples/sample_interview.srt \
  --output examples/transcripts/ \
  --target-speaker "Example Person"

# Then use the 3+1 pipeline prompt template to extract persona
# (See docs/pipeline_prompt_template.md)

๐Ÿ“– Documentation


๐Ÿ—บ๏ธ Roadmap

Phase 1: Core Loop (MVP)

  • 3+1 Pipeline v5 with ABCDE model
  • L0 Adapter (Dialogue, Monologue, Micro-burst, Attributed parsers)
  • Canonical soul schema (JSON/YAML IR with provenance)
  • Example base souls: Linus, Buffett (end-to-end)
  • Verification v0 (holdout set + automated eval script)
  • OpenClaw soul.md compiler + runnable demo

Phase 2: Teams & Ecosystem

  • Team schema (team_schema.json) โ€” sequential routing, array order = execution order
  • Team compiler (team_compile.py) โ€” team.yaml โ†’ team-tuned soul.md
  • First team: Code Review (Linus + Buffett) โ€” end-to-end demo
  • demo.py --team โ€” sequential multi-soul pipeline with handoff
  • 84 tests passing (53 Phase 1 + 31 Phase 2)

Phase 3: More Teams & Integration

  • More base souls: Cao Cao, Munger, Zhuge Liang
  • Three Kingdoms team-tuned souls
  • OpenClaw team-aware packaging
  • CrewAI / AutoGen exporters
  • Contributor submission template

Phase 4: Advanced

  • Web UI for soul browsing + evidence chain
  • More team templates (Dream Company, China Business)
  • Multi-agent interaction playground

๐Ÿค Contributing

We welcome contributions! Key areas:

  1. New base souls โ€” Extract personas and submit soul.md with evidence
  2. New L0 parsers โ€” Support more data source formats
  3. Team-tuned variants โ€” Create orchestration-aware soul variants
  4. Evaluation metrics โ€” Better ways to measure persona fidelity
  5. Framework exporters โ€” Connect with more agent frameworks (OpenClaw, CrewAI, AutoGen)

๐Ÿ“œ License

MIT License


๐Ÿ™ Acknowledgements


"Bad programmers worry about the code. Good programmers worry about data structures and their relationships." โ€” Linus Torvalds

SoulCraft worries about the soul.

About

Craft AI souls from humanity's greatest minds. A data-driven persona extraction pipeline for multi-agent systems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors