Frameworks
Auto-instrumentation for agent frameworks.
Risicare provides deep integrations with popular agent frameworks.
Supported Frameworks
LangGraph
Graph-based agents
CrewAI
Multi-agent crews
AutoGen
Conversational agents
LangChain
Chains and agents
OpenAI Agents
OpenAI Agents SDK
Instructor
Structured outputs
LiteLLM
Unified LLM interface
DSPy
Declarative prompting
Pydantic AI
Type-safe AI
LlamaIndex
RAG framework
JavaScript SDK
The JS SDK supports 4 of the 10 frameworks above. The remaining 6 have no JavaScript integration in the Risicare SDK.
| Framework | JS Import | Function |
|---|---|---|
| LangChain | risicare/langchain | RisicareCallbackHandler + withSuppression() |
| LangGraph | risicare/langgraph | instrumentLangGraph() |
| Instructor | risicare/instructor | patchInstructor() |
| LlamaIndex | risicare/llamaindex | RisicareLlamaIndexHandler |
What's Captured
Framework integrations provide rich observability beyond basic LLM tracing:
| Feature | Description |
|---|---|
| Agent Identity | Name, role, and hierarchy |
| Decision Flow | Think/Decide/Act phases |
| Tool Execution | Tool calls with inputs/outputs |
| Graph State | The names of the graph state keys, and one span for each node in step order (LangGraph). With content capture on, each node span also carries its input state and its update as text |
| Inter-Agent Messages | Communication between agents |
| Iteration Tracking | Loop counts and convergence |
Provider Span Behavior
Some frameworks suppress the provider span of a call that the framework itself makes, so the call is counted once. Others let provider spans appear alongside framework spans. A provider call that your own code makes outside a framework call keeps its span. LiteLLM, DSPy and LlamaIndex suppress every provider call made while their call runs (LiteLLM: on the same thread), not only their own.
| Framework | Provider Suppression | Notes |
|---|---|---|
| LangChain | Yes | The provider call of a model run gets no second span |
| LiteLLM | Yes | Suppressed from the pre-call hook to the end of the call |
| DSPy | Yes | Suppresses for LM calls |
| LlamaIndex | Selective | Non-streaming LLM and embedding calls only; a streamed LLM call also gets the provider span |
| LangGraph | No | A node that calls a LangChain model gets no provider span (the LangChain rule); a direct provider call does |
| CrewAI | No | Provider spans appear as children |
| AutoGen | No | Provider spans appear as children |
| OpenAI Agents | No | Provider spans appear as children when the Agents SDK uses Chat Completions; by default it uses the Responses API, which is not traced |
| Instructor | No | Provider spans appear as children |
| Pydantic AI | No | Provider spans appear as children, for models whose API the SDK traces (OpenAI: Chat Completions) |
Auto vs Manual Instrumentation
Auto-Instrumentation
Call risicare.init(), or use Tier 0 (import risicare with RISICARE_API_KEY and RISICARE_TRACING=true):
import risicare
risicare.init()
# Framework code is automatically traced
from langgraph.graph import StateGraph
# ... your agent codeManual Instrumentation
Add explicit context for more control:
from risicare import agent, trace_think, trace_decide, trace_act
@agent(name="researcher", role="specialist")
def research_agent(query: str):
@trace_think
def analyze():
return analyze_query(query)
@trace_decide
def plan():
return create_plan(analysis)
@trace_act
def execute():
return run_search(plan)
analysis = analyze()
plan = plan()
return execute()Framework Detection
Risicare automatically detects which frameworks are installed and instruments them:
import risicare
# Returns a dict keyed by module name; each value describes that
# module's instrumentation state
print(risicare.get_instrumented_modules())