Skip to main content
Omium instruments LangGraph at runtime. Once enabled, your calls to invoke(), ainvoke(), stream(), and astream() are traced without rewriting your graph.

Quickstart

Install dependencies:
pip install omium langgraph
Then initialize Omium and enable LangGraph instrumentation once at startup:
import omium

omium.init()  # uses ~/.omium/config.json or OMIUM_API_KEY / OMIUM_API_URL
omium.instrument_langgraph()
Your graph code runs unchanged:
from langgraph.graph import StateGraph

graph = StateGraph(dict)
# … add nodes and edges …
app = graph.compile()

result = app.invoke({"input": "Hello"})
Open app.omium.ai to view the execution and trace.

What Omium captures

SignalNotes
Execution IDOne per graph run (invoke / ainvoke).
Inputs & outputsInitial state and final state for the run.
TimingTotal duration and step timings (where available).
ErrorsExceptions and failure context for debugging.
Streaming metadataFor streaming runs, counts and progress events.

Instrumentation lifecycle

Enable instrumentation

Call instrument_langgraph() once at process start (before you begin running graphs):
import omium

omium.init()
omium.instrument_langgraph()

Disable instrumentation

Temporarily turn it off (for debugging or A/B testing):
import omium

omium.uninstrument_langgraph()

Async and streaming

Omium supports both sync and async execution.
import omium

omium.init()
omium.instrument_langgraph()

# Sync streaming
for chunk in app.stream({"input": "Hello"}):
    print(chunk)

# Async invoke / stream
# result = await app.ainvoke({"input": "Hello"})
# async for chunk in app.astream({"input": "Hello"}):
#     print(chunk)

Configuration

Most teams start with omium init and defaults. For explicit configuration:
import omium
from omium import OmiumConfig

omium.configure(
    OmiumConfig(
        api_key="omium_xxx",
        project="my-langgraph-app",
        auto_trace=True,
        auto_checkpoint=True,
    )
)

omium.instrument_langgraph()

Troubleshooting

Traces not appearing

  • Ensure omium.init() is called before instrument_langgraph().
  • Confirm your API key and URL with Configure.
  • Verify connectivity to https://api.omium.ai.

ImportError: LangGraph is not installed

pip install langgraph

Next steps

CrewAI

Auto-instrument kickoff() and multi-agent runs.

Python SDK

Full SDK reference for tracing and checkpoints.