Skip to main content
GitHub

Frameworks

Auto-instrumentation for agent frameworks.

Risicare provides deep integrations with popular agent frameworks.

Supported Frameworks

JavaScript SDK

The JS SDK supports 4 of the 10 frameworks above. The remaining 6 have no JavaScript integration in the Risicare SDK.

FrameworkJS ImportFunction
LangChainrisicare/langchainRisicareCallbackHandler + withSuppression()
LangGraphrisicare/langgraphinstrumentLangGraph()
Instructorrisicare/instructorpatchInstructor()
LlamaIndexrisicare/llamaindexRisicareLlamaIndexHandler

What's Captured

Framework integrations provide rich observability beyond basic LLM tracing:

FeatureDescription
Agent IdentityName, role, and hierarchy
Decision FlowThink/Decide/Act phases
Tool ExecutionTool calls with inputs/outputs
Graph StateThe 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 MessagesCommunication between agents
Iteration TrackingLoop 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.

FrameworkProvider SuppressionNotes
LangChainYesThe provider call of a model run gets no second span
LiteLLMYesSuppressed from the pre-call hook to the end of the call
DSPyYesSuppresses for LM calls
LlamaIndexSelectiveNon-streaming LLM and embedding calls only; a streamed LLM call also gets the provider span
LangGraphNoA node that calls a LangChain model gets no provider span (the LangChain rule); a direct provider call does
CrewAINoProvider spans appear as children
AutoGenNoProvider spans appear as children
OpenAI AgentsNoProvider spans appear as children when the Agents SDK uses Chat Completions; by default it uses the Responses API, which is not traced
InstructorNoProvider spans appear as children
Pydantic AINoProvider 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 code

Manual 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())

Next Steps