Framework integration¶
LoopLens is not a standalone app you rebuild your agent inside. You add it to the agent you already have. There are a few ways to do that, from zero-instrumentation to full manual control.
graph LR
A[Your agent] -->|OTel exporter| B[/v1/traces/]
A -->|callback handler| C[LangGraph adapter]
A -->|trace / event| D[Manual SDK]
B --> E[(LoopLens server)]
C --> E
D --> E
E --> F[Detectors + metrics + live UI]
Pick an approach¶
1. OpenTelemetry — universal, zero code¶
Most agent frameworks — LangChain/LangGraph, LlamaIndex, CrewAI, AutoGen, the OpenAI Agents SDK, and more — can emit OpenTelemetry spans via the OpenInference or OpenLLMetry instrumentations. Point their OTLP exporter at LoopLens and the spans become runs, events, and loop warnings with no LoopLens-specific code in your agent.
2. LangGraph adapter — tight, in-process¶
A single LangChain callback handler that captures every node's LLM and tool calls. One line in your run config.
3. OpenAI Agents SDK adapter — native handoffs & guardrails¶
A native TracingProcessor that captures the SDK's typed spans, including
handoffs and guardrail trips that the generic OTel path only approximates.
4. CrewAI adapter — native crew delegation¶
A BaseEventListener that captures crew events and emits a handoff when control
moves to a different agent — so a stuck crew trips handoff_bounce.
5. Manual SDK — full control¶
Call trace() / event() / @observe yourself. Best for hand-rolled loops or
when you want to emit exactly the events you care about.
Which should I use?¶
| You have… | Use |
|---|---|
| Any framework with an OpenInference/OpenLLMetry instrumentor | OpenTelemetry |
| A LangGraph or LangChain app | LangGraph adapter (or OpenTelemetry) |
| An OpenAI Agents SDK app | OpenAI Agents adapter (native handoffs/guardrails) |
| A CrewAI crew | CrewAI adapter (native delegation handoffs) |
| A hand-rolled loop, or a framework with no instrumentor | Manual SDK |
All of these funnel through the same ingestion pipeline, so the loop detectors, health scoring, and live UI work identically no matter how the events arrived.