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.
Every migration erases your agent's brain
Without a standard, switching frameworks means losing everything your agent learned.
# 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.
# 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.
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.
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
Want copy-paste-and-run code? See examples/full_demo.py
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
Resources
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.
Agent Time Travel
Version, checkpoint, rollback, and branch agent cognitive state. Content-addressable storage with SHA-256, parent hash chains, and delta compression.
store = CheckpointStore()
store.checkpoint(payload, label="before-experiment")
store.rollback("my-agent", version=3)
store.branch("my-agent", 3, "experiment-b")
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 commandsGitHub Action
Add one line to your CI. Validates all .stateweave.json files on push and generates diffs on pull requests.
TypeScript SDK
Full Universal Schema types, serializer, diff engine, and adapter interface for Node.js, LangChain.js, and Vercel AI SDK.
TypeScriptInteractive Playground
Try state translation, diffing, and time travel in your browser — no installation needed. Self-hosted or run locally.
Web UISchema Registry
Publish, discover, and reuse payload schemas. Search by name, tag, or framework. Local-first with hosted option coming.
DiscoveryProject Scaffolder
create-stateweave-agent generates a new project with adapters, CI, and middleware pre-wired. Start with StateWeave from line one.
One canonical format
Every framework translates to and from the Universal Schema. Star topology, not mesh.
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=[...],
)
One adapter, N connections
Subclass one ABC. Implement four methods. Instant compatibility with the entire ecosystem.
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
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.
non_portable_warnings with severity, reason, and remediation guidance.
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.
export_agent_state, import_agent_state, and diff_agent_states. Any MCP-compatible AI assistant can use StateWeave directly.