@mutagent/langgraph
v0.1.2
Published
MutagenT integration for LangGraph - tracer for graph-based agent workflows
Maintainers
Readme
MutagenT LangGraph
╔════════════════════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ███╗ ███╗██╗ ██╗████████╗ █████╗ ██████╗ ███████╗███╗ ██╗████████╗ ║
║ ████╗ ████║██║ ██║╚══██╔══╝██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝ ║
║ ██╔████╔██║██║ ██║ ██║ ███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ║
║ ██║╚██╔╝██║██║ ██║ ██║ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ║
║ ██║ ╚═╝ ██║╚██████╔╝ ██║ ██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ║
║ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ║
║ ║
║ ██╗ █████╗ ███╗ ██╗ ██████╗ ██████╗ ██████╗ █████╗ ██████╗ ██╗ ██╗ ║
║ ██║ ██╔══██╗████╗ ██║██╔════╝ ██╔════╝ ██╔══██╗██╔══██╗██╔══██╗██║ ██║ ║
║ ██║ ███████║██╔██╗ ██║██║ ███╗██║ ███╗██████╔╝███████║██████╔╝███████║ ║
║ ██║ ██╔══██║██║╚██╗██║██║ ██║██║ ██║██╔══██╗██╔══██║██╔═══╝ ██╔══██║ ║
║ ███████╗██║ ██║██║ ╚████║╚██████╔╝╚██████╔╝██║ ██║██║ ██║██║ ██║ ██║ ║
║ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ║
║ ║
║ LangGraph Integration for AI-Native Observability. ║
║ ║
╚════════════════════════════════════════════════════════════════════════════════════════════╝LangGraph tracer for graph-based agent workflow tracing to MutagenT.
Installation
npm install @mutagent/langgraph @mutagent/sdkPeer Dependencies
| Package | Version |
|---------|---------|
| @langchain/langgraph | >=0.0.1 |
| @mutagent/sdk | ^0.1.0 |
Quick Start
import { MutagentGraphTracer } from '@mutagent/langgraph';
import { initTracing } from '@mutagent/sdk/tracing';
// Initialize tracing once at app startup
initTracing({ apiKey: process.env.MUTAGENT_API_KEY! });
// Create the tracer
const tracer = new MutagentGraphTracer();
// Trace graph execution
tracer.handleGraphStart('my-agent', { query: 'Hello' });
tracer.handleNodeStart('classifier', { query: 'Hello' });
tracer.handleNodeEnd('classifier', { category: 'greeting' });
tracer.handleEdgeTransition('classifier', 'responder', {
isConditional: true,
condition: 'route_by_category',
conditionResult: 'greeting',
});
tracer.handleNodeStart('responder', { category: 'greeting' });
tracer.handleNodeEnd('responder', { reply: 'Hi there!' });
tracer.handleGraphEnd({ reply: 'Hi there!' });API Reference
MutagentGraphTracer
Traces three levels of graph execution:
- Graph lifecycle --
handleGraphStart,handleGraphEnd,handleGraphError - Node lifecycle --
handleNodeStart,handleNodeEnd,handleNodeError - Edge transitions --
handleEdgeTransition(supports conditional routing metadata)
Node spans are automatically parented to the graph span. Edge spans are instantaneous and recorded with optional isConditional, condition, and conditionResult attributes.
License
MIT
