otel-genai-graph

Turn your OpenTelemetry GenAI traces into a graph you can actually ask questions of. Cost per model, agent delegation, tool blast radius — one command, zero Cypher, mixed vendors, real tokens.

cost_by_model running across mixed-vendor captures

Try the graphs — interactive, no install

Each card opens a self-contained cytoscape.js viewer for one captured trace. Pan, zoom, hover for properties, share by sending one HTML file. Same output as python tools/render_graph.py --fixture … locally.

simple llm call

Smallest possible graph. One chat span. Three nodes total — Session, Model, Operation.

4 nodes · 2 edges · Model, Operation, Resource, Session

multi agent

Orchestrator delegates to a specialist. Shows the DELEGATED_TO edge that distinguishes multi-agent traces from a single timeline.

8 nodes · 9 edges · Agent, Model, Operation, Resource, Session

agent with tool

An agent invokes an LLM, calls a tool, then invokes the LLM again. Classic ReAct shape.

9 nodes · 11 edges · Agent, Model, Operation, Resource, Session, Tool

rag flow

Embeddings → retrieve from a vector store → chat with retrieved context. Exercises DataSource and RETRIEVED_FROM.

8 nodes · 8 edges · DataSource, Model, Operation, Resource, Session

multi turn conversation

Three chat turns sharing one conversation.id across distinct trace_ids — collapsed to a single Session node.

6 nodes · 6 edges · Model, Operation, Resource, Session

error case

A tool fails. The ERROR status propagates up the parent chain to every ancestor.

6 nodes · 5 edges · Agent, Operation, Resource, Session, Tool

real gemini chat

Real Gemini 2.5 Flash chat captured via the bundled capture script. Sanitised conversation id; token counts and response preview authentic.

4 nodes · 2 edges · Model, Operation, Resource, Session

Token spend by model — union of every loaded trace

Mixed-vendor cost attribution from OTel spans alone. Real tokens from real captures.

provider    model                   calls  input_tokens  output_tokens
----------  ----------------------  -----  ------------  -------------
anthropic   claude-sonnet-4-5       7      1760          830          
openai      text-embedding-3-small  1      20            0            
anthropic   claude-opus-4-7         1      500           300          
gcp.gen_ai  gemini-2.5-flash        1      8             136          

Tool usage — from agent_with_tool, error_case, and real tool_call captures

tool        calls
----------  -----
db_query    1    
web_search  1    

Calls by vendor

provider    calls
----------  -----
anthropic   8    
openai      1    
gcp.gen_ai  1    

Get it

All the demos above came out of the same library you can install in 10 seconds.

# once published to PyPI
pip install otel-genai-graph

# or clone for the CLIs and capture scripts
git clone https://github.com/kums1234/otel_genai_graph_exporter.git
cd otel_genai_graph_exporter
pip install -e ".[dev]"