Skip to main content

Agent soul transfer — export, absorb, and merge AI agent identities across machines

Project description

🚀 SoulPort — Agent Soul Transfer

.bm is the standard format for AI agent souls. The CLI is just the first consumer.

Export your agent's personality, memories, and skills into a single portable file. Move between machines, merge diverged copies, or evaluate on SoulArena.

Migration is the first use case. Evaluation (SoulArena), fusion, version control, and cross-framework interop are next.

Previously known as "BeiMingKungFu" (北冥神功). Renamed to SoulPort in v0.2.0.

Install

pip install soulport

Commands

# Core — transfer
soulport export                     # Export soul → .bm file
soulport export --layers skills     # Soul Shard: export only skills layer
soulport export -l memory -l identity  # Soul Shard: multiple layers
soulport absorb ./agent.bm         # Restore soul on a new machine
soulport absorb ./agent.bm -i      # Interactive: select layers to absorb
soulport merge a.bm b.bm -o out.bm # Merge multiple agent souls
soulport merge a.bm b.bm --semantic # LLM-assisted semantic merge
soulport merge a.bm b.bm --semantic --dry-run  # Preview merge plan
soulport inspect ./agent.bm        # Preview package contents

# Diagnose
soulport doctor                     # Five-layer health check + score
soulport diff ./agent.bm           # Compare .bm vs current workspace
soulport diff a.bm b.bm            # Compare two .bm packages
soulport status                     # Health score + snapshot overview

# Version control
soulport watch                      # Auto-backup daemon (6h default)
soulport watch --once               # Single snapshot for cron/scripts
soulport changelog                  # Show changes between snapshots
soulport rollback <hash>            # Restore to a previous snapshot

# Cloud sync (auth via SOULPORT_CLOUD_KEY env var or --api-key)
soulport push                       # Upload .bm to soul.polly.wang
soulport pull <agent_name>          # Download latest soul from cloud

Soul Layers

Layer Files What it captures
🧠 Memory MEMORY.md, memory/*.md Long-term + daily memories
👤 Identity SOUL.md, IDENTITY.md, USER.md Personality, name, human context
⚙️ Config AGENTS.md, TOOLS.md, HEARTBEAT.md Behavior rules, tool notes, routines
🛠️ Skills skills/*/SKILL.md User-created workspace skills
🔧 System openclaw.json (sanitized) MCP servers, model config

Soul Lineage

Every snapshot records its parent's hash, forming a lineage chain:

snapshot-1: hash=d7fcf876..., parent=(root)
snapshot-2: hash=5a0ca89d..., parent=d7fcf876...
snapshot-3: hash=1be975f7..., parent=5a0ca89d...

Use soulport changelog to trace changes. Use soulport rollback <hash> to go back.

Semantic Merge

When the same agent runs on two machines, memories diverge. --semantic resolves this with a four-layer filter pipeline:

Layer 1: File-level    → 97%+ identical files skipped (zero LLM)
Layer 2: Section-level → identical/new sections resolved (zero LLM)
Layer 3: Line-level    → pure appends and tiny diffs resolved (zero LLM)
Layer 4: LLM           → only true semantic conflicts sent to LLM

Result: 38 files → 0 LLM calls for typical merges. Prompt reduced from ~28KB to ~500 words when LLM is needed.

soulport merge home.bm office.bm --semantic -o merged.bm
soulport merge home.bm office.bm --semantic --dry-run  # preview first

MCP Server

SoulPort includes a Model Context Protocol server, allowing AI agents to manage their own souls programmatically:

pip install 'soulport[mcp]'
soulport mcp           # Start MCP server (stdio)
soulport mcp --http    # Start MCP server (HTTP)

Add to your OpenClaw config (openclaw.json):

{
  "mcpServers": {
    "soulport": {
      "command": "soulport",
      "args": ["mcp"]
    }
  }
}

6 tools: soulport_export, soulport_doctor, soulport_diff, soulport_changelog, soulport_status, soulport_snapshot. Read/create only — destructive ops require human confirmation.

Security

  • API keys/tokens auto-redacted on export (__SOULPORT_REDACTED__)
  • Redaction is intentionally irreversible — your soul travels, your keys stay
  • After absorb, CLI shows 🔑 Action Required panel listing redacted fields to configure
  • Path traversal protection on absorb (resolve().relative_to())
  • Cloud endpoints: safe-name regex + is_relative_to() double guard
  • tarfile filter='data' on merge/extract
  • inspect before absorb, --dry-run before rollback
  • Pre-rollback auto-backup (opt out with --no-backup)
  • MCP Server: read-only (no absorb/merge/rollback exposed)

File Format

.bm files are compressed archives (tar.gz) containing:

  • manifest.json — metadata, version, content hash, parent hash
  • workspace/ — agent workspace files
  • config/ — sanitized system configuration See FORMAT.md for the full format specification.

Why .bm? Named after 北冥 (BěiMíng) — the mythical Northern Sea from Zhuangzi's "Wandering Beyond", where a fish transforms into a bird. A soul's form is free.

Supported Frameworks

  • OpenClaw (first-class support)
  • 🔜 Cross-framework adapters (Claude Desktop, Cursor, etc.)

Links

License

MIT

Your agent's soul deserves to travel. 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soulport-1.0.0.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

soulport-1.0.0-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file soulport-1.0.0.tar.gz.

File metadata

  • Download URL: soulport-1.0.0.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for soulport-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7ed44a9f61321e42deb71ed71e67b3e94b66f600999993aebf1a355d97687fa3
MD5 227ab9db4175b583064858b135336ca6
BLAKE2b-256 24224cb866e3c2810ab9a62ca1220df1fe32bb7dd8dbf83b51334ce077e69b0f

See more details on using hashes here.

File details

Details for the file soulport-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: soulport-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for soulport-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77a81da4d99a78c4f0005c2e3f7cc599a8cfbddb3aaf4480a457e452a73ef5ad
MD5 ce6928140ad5318548cbb09c87fa4f5f
BLAKE2b-256 6196dce53c0a0ea57a8d735d668ce2e7b6ad64df90b21bff5c2c0a4b2ddc30bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page