Skip to content

git for agent brains.
Your agent switches frameworks. Its memories come with it.

Move, debug, and secure AI agent state across 10 frameworks.
LangGraph ↔ MCP ↔ CrewAI ↔ AutoGen ↔ DSPy ↔ LlamaIndex & more. Open source.

MCP Server Ships built-in
Encrypted AES-256-GCM
Portable 10 frameworks
Tested 440+ tests
Apache 2.0 License

Every migration erases your agent's brain

Without a standard, switching frameworks means losing everything your agent learned.

Without StateWeave
# Agent accumulated 8 messages, 4 findings
# Switch from LangGraph → MCP...

conversation_history  → lost
working_memory        → lost
research_findings     → lost
confidence_score      → lost
tool_results          → lost

# Start over from scratch.
With StateWeave
# Export → Encrypt → Import. Done.

payload = adapter.export_state("agent-1")
mcp_adapter.import_state(payload)

conversation_history  → preserved ✓
working_memory        → preserved ✓
research_findings     → preserved ✓
confidence_score      → preserved ✓
tool_results          → preserved ✓

N adapters, not N² translations

Star topology. Every framework translates to one Universal Schema. Adding a framework = one adapter.

LangGraph CrewAI AutoGen UNIVERSAL SCHEMA MCP Letta Custom

Star topology — each framework only needs to translate to the Universal Schema. Adding framework N costs one adapter, gives N-1 migration paths.

Export. Import. Done.

Export state, import state. Encrypted, validated, with explicit non-portable warnings.

export.py
from stateweave import LangGraphAdapter, StateWeaveSerializer

# Set up a LangGraph adapter
adapter = LangGraphAdapter()
payload = adapter.export_state("my-thread-id")

serializer = StateWeaveSerializer()
raw_bytes = serializer.dumps(payload)
from stateweave import MCPAdapter

mcp_adapter = MCPAdapter()
mcp_adapter.import_state(payload)

# Agent resumes with its full context intact.
# Conversation history, working memory, goals — all preserved.
from stateweave import EncryptionFacade, MigrationEngine

key = EncryptionFacade.generate_key()
engine = MigrationEngine(encryption=EncryptionFacade(key))

result = engine.export_state(
    adapter=langgraph_adapter,
    agent_id="my-agent",
    encrypt=True,
)

engine.import_state(
    adapter=mcp_adapter,
    encrypted_data=result.encrypted_data,
    nonce=result.nonce,
)
from stateweave.core.diff import diff_payloads

diff = diff_payloads(state_before, state_after)
print(diff.to_report())

# ═════════════════════════════════════════
#  STATEWEAVE DIFF REPORT
# ═════════════════════════════════════════
#  Changes: 5 (+2 -1 ~2)
#  [working_memory]
#    + working_memory.new_task: "research"
#    ~ confidence: 0.7 → 0.95

Full demo — 7 steps from pip install stateweave

StateWeave demo — export, import, diff, time travel, encrypt

Want copy-paste-and-run code? See examples/full_demo.py

pip install stateweave Read Docs →

90 seconds from zero to working demo

10-framework adapter ecosystem

One adapter per framework. Instant compatibility with every other.

Framework Export Import Tier
LangGraph 🟢 Tier 1
MCP 🟢 Tier 1
CrewAI 🟢 Tier 1
AutoGen 🟢 Tier 1
DSPy 🟡 Tier 2
OpenAI Agents 🟡 Tier 2
LlamaIndex 🔵 Community
Haystack 🔵 Community
Letta / MemGPT 🔵 Community
Semantic Kernel 🔵 Community
Custom Extensible

🟢 Tier 1 = Core team, guaranteed stability  ·  🟡 Tier 2 = Actively maintained  ·  🔵 Community = Best-effort

Ships as an MCP Server

Any MCP-compatible assistant can export, import, and diff agent state directly.

Tools

export_agent_state Export cognitive state from any framework
import_agent_state Import into target framework with validation
diff_agent_states Detailed change report between two states

Resources

schemas/v1 Universal Schema specification
migrations/history Migration history log
agents/{id}/snapshot Live agent state snapshot

Encrypted. Validated. Zero silent loss.

AES-256-GCM

Authenticated encryption. Unique nonce per operation. Ciphertext bound to agent metadata.

Ed25519 Signing

Digital signatures verify sender identity and detect tampering. Sign, verify, and attach to payloads.

PBKDF2 · 600K

OWASP-recommended key derivation. Passphrase-based with versioned key IDs.

Credential Stripping

API keys, OAuth tokens, and passwords are flagged as non-portable and stripped on export.

Non-Portable Warnings

Every non-transferable element is documented with severity, reason, and remediation. Never silent.

MCP Server + Docker

Deploy behind your firewall. Dockerfile and docker-compose included.

Delta transport. State merge. Compliance.

Ship only state diffs. Merge parallel agents. Enforce compliance with 10 automated scanners.

Delta Transport

Send only state differences instead of full payloads. SHA-256 hash verification prevents base mismatch.

State Merge (CRDT)

Merge parallel agents with conflict resolution: Last-Writer-Wins, Union, or Manual review.

UCE Compliance

10 automated scanners enforce schema integrity, encryption, import discipline, and test coverage. Zero false passes.

Auto-Detection

stateweave detect identifies source framework from raw state via fingerprinting heuristics.

Migration Reports

HTML, Markdown, and JSON reports with fidelity scores, audit trails, and non-portable analysis.

Observability

Structured JSON logging, in-memory metrics, and trace_operation context manager for monitoring.

Time travel. Auto-checkpoint. One-command diagnostics.

Version your agent's brain. Roll back bad decisions. Get a health check before you ship.

🔁

Auto-Checkpoint Middleware

Wrap any function with @auto_checkpoint — StateWeave snapshots state automatically at the interval you choose.

@auto_checkpoint(every_n_steps=5)
def run_agent(payload):
    # Your logic here
    return payload
🩺

Doctor CLI

One command checks Python, StateWeave version, installed frameworks, checkpoint store, encryption readiness, serialization safety, and dependencies.

$ stateweave doctor

✓ Python 3.11 (supported)
✓ StateWeave 0.3.1
✓ langgraph 0.6.11 detected
✓ Encryption: AES-256-GCM ready
7 passed — healthy

Embed everywhere. Reduce friction to zero.

VS Code, CI pipelines, TypeScript, browser playground, schema discovery — StateWeave meets developers where they already work.

VS Code Extension

Validate payloads, diff checkpoints, run doctor, preview agent state — all from your editor. Status bar shows StateWeave at a glance.

5 commands

GitHub Action

Add one line to your CI. Validates all .stateweave.json files on push and generates diffs on pull requests.

CI/CD

TypeScript SDK

Full Universal Schema types, serializer, diff engine, and adapter interface for Node.js, LangChain.js, and Vercel AI SDK.

TypeScript

Interactive Playground

Try state translation, diffing, and time travel in your browser — no installation needed. Self-hosted or run locally.

Web UI

Schema Registry

Publish, discover, and reuse payload schemas. Search by name, tag, or framework. Local-first with hosted option coming.

Discovery

Project Scaffolder

create-stateweave-agent generates a new project with adapters, CI, and middleware pre-wired. Start with StateWeave from line one.

CLI

One canonical format

Every framework translates to and from the Universal Schema. Star topology, not mesh.

StateWeavePayload
StateWeavePayload(
  stateweave_version="0.3.0",
  source_framework="langgraph",
  cognitive_state=CognitiveState(
    conversation_history=[...],
    working_memory={...},
    goal_tree={...},
    tool_results_cache={...},
    trust_parameters={...},
    long_term_memory={...},
    episodic_memory=[...],
  ),
  metadata=AgentMetadata(...),
  audit_trail=[...],
  non_portable_warnings=[...],
)
conversation_history
Complete message thread — human, AI, system, tool messages
working_memory
Current task state, key-value pairs, active research context
goal_tree
Active goals, sub-goals, completion status
tool_results_cache
Cached outputs from web searches, file reads, API responses
trust_parameters
Confidence scores, reliability metrics, source credibility
audit_trail
Full operation history — every export, import, migration logged

One adapter, N connections

Subclass one ABC. Implement four methods. Instant compatibility with the entire ecosystem.

my_adapter.py
from stateweave.adapters.base import StateWeaveAdapter
from stateweave.schema.v1 import StateWeavePayload, AgentInfo

class MyFrameworkAdapter(StateWeaveAdapter):
    @property
    def framework_name(self) -> str:
        return "my-framework"

    def export_state(self, agent_id: str, **kwargs) -> StateWeavePayload:
        # Framework state → Universal Schema
        ...

    def import_state(self, payload: StateWeavePayload, **kwargs):
        # Universal Schema → framework state
        ...

    def list_agents(self) -> list[AgentInfo]:
        # Return discoverable agents
        ...

Common questions

Install with pip install stateweave. Use the source framework's adapter to export_state(), then the target framework's adapter to import_state(). All cognitive state — conversation history, working memory, goals, tool results — transfers through the Universal Schema.
StateWeave never silently drops data. Non-portable elements (database connections, credentials, framework internals) are stripped and documented in non_portable_warnings with severity, reason, and remediation guidance.
Yes. AES-256-GCM authenticated encryption with PBKDF2 key derivation (600K iterations). Each operation gets a unique nonce. Ciphertext is bound to agent metadata via associated data.
Subclass StateWeaveAdapter and implement framework_name, export_state, import_state, and list_agents. That's it — your framework gets instant migration paths to every existing adapter through the star topology.
Yes. StateWeave ships as an MCP Server with three tools: export_agent_state, import_agent_state, and diff_agent_states. Any MCP-compatible AI assistant can use StateWeave directly.
Apache 2.0. Use it, modify it, ship it. Includes a patent shield and retaliation clause. Every component — adapters, serializer, encryption, diff engine, MCP server — is open source.
v0.3.x ships with 440+ tests, continuous integration across all 10 framework adapters, and compliance scanners that enforce architecture rules. Tier 1 adapters (LangGraph, MCP, CrewAI, AutoGen) are round-trip tested and maintained by the core team. We use semantic versioning and publish a CHANGELOG with every release.
GitHub Issues for bug reports. GitHub Discussions for questions and community support. Our target response time is 48 hours. Contributions welcome via CONTRIBUTING.md.
Our CI runs an adapter-matrix test suite that imports each framework and verifies the adapter still produces correct Universal Schema output. When a framework releases a breaking change, CI flags it immediately. Adapters are versioned independently — a LangGraph update won't break your CrewAI workflow.

Build a new adapter

Every adapter you build gives every other adapter instant portability to your framework. One adapter, N connections.

Contribute on GitHub