Integration Guide

agentAssert for LangGraph

Behavioral contracts for stateful agent graphs.

Why agentAssert + LangGraph

Graph-Aware Enforcement

Contracts attach at graph nodes. Monitor state transitions. Enforce invariants across the entire execution graph.

State Drift Prevention

Mathematical bounds on agent state drift. Lyapunov stability ensures your graph converges, not diverges.

Composition Guarantees

Multi-graph pipelines with containment. If one subgraph violates, others are protected.

Get Started

Install, wrap, and enforce in three steps.

Install
Terminal
# Request evaluation access at /contact
# Integration packages provided with access
Wrap your graph
app.py
from agentassert.integrations import LangGraphEnforcer

# Load contract and wrap your graph
enforcer = LangGraphEnforcer.from_file("contract.yaml")
enforced_graph = enforcer.wrap(your_graph)

# Run with enforcement
result = enforced_graph.invoke(input_data)

Frequently Asked Questions

Does agentAssert slow down my LangGraph execution?

Minimal overhead. Contract checks run in <2ms per node. Async monitoring for zero-blocking enforcement.

Can I use different contracts for different nodes?

Yes. Assign node-specific contracts or use a single graph-level contract. Composition rules handle the rest.

What happens when a violation is detected?

Configurable recovery: pause execution, switch to fallback, alert operators, or log and continue. Your choice.

Does it work with LangGraph Cloud?

Yes. agentAssert is a Python library that wraps your graph. It works anywhere your LangGraph code runs.

Is LangGraph required?

No. agentAssert is framework-agnostic. LangGraph integration is one of many supported frameworks.