Skip to main content

Framework Integrations

Briefcase provides drop-in instrumentation for three AI frameworks. Pick the handler that matches your stack — or combine them.

Supported Frameworks

FrameworkHandler ClassMechanismInstall Extra
LangChainBriefcaseLangChainHandlerCallback handler (duck-typed)base
OpenAI Agents SDKOpenAIAgentsTracerTracingProcessor via add_trace_processorbase
PageIndexPageIndexTracerSDK wrapper around PageIndexClientpageindex
PageIndex via MCPPageIndexMCPObserverPost-processor for MCP tool call recordsbase

What Each Handler Captures

BriefcaseLangChainHandler

Eventdecision_typeKey fields
LLM / Chat model callllmmodel name, prompts/messages, completion text, token usage
Chain executionchainchain class name, inputs, outputs
Tool invocationtooltool name, input string, output string
Retriever queryretrieverquery string, retrieved documents (count + preview)

OpenAIAgentsTracer

Span typetype fieldKey fields
Agent runagent_runagent_name, tools list, handoffs list, output_type
Tool calltool_calltool_name, input, output
Agent handoffhandofffrom_agent, to_agent
Guardrail evaluationguardrailguardrail_name, triggered
Model generationgenerationmodel, usage, input, output

PageIndexTracer

AttributeTypeDescription
pageindex.doc_idstrDocument identifier passed to chat_completions
pageindex.retrieval_methodstrAlways "tree_search"
pageindex.tree.depthintMaximum depth of the document tree
pageindex.tree.nodes_visitedintTotal nodes in the tree (upper-bound proxy)
pageindex.tree.pathstrHuman-readable path summary: root > Section 1 > ...
pageindex.tree.backtrack_countintAlways 0 (server-side only)

PageIndexMCPObserver

Adds the same pageindex.* attributes as PageIndexTracer by parsing the JSON output of MCP tool calls. No pageindex package required.

Common Fields

All handlers produce records with these fields:

decision_id          UUID string
started_at / ended_at ISO 8601 timestamps
execution_time_ms float
engagement_id project identifier (LangChain/PageIndex only)
workstream_id workflow identifier (LangChain/PageIndex only)
context_version optional version tag
error error message if the call failed

Choosing Between Handlers

Use BriefcaseLangChainHandler when your agent is built with LangChain chains or agents. It automatically captures all nested events in a single invocation — LLM calls, tool calls, and retrievers — with parent/child span relationships.

Use OpenAIAgentsTracer when using the OpenAI Agents SDK directly. It hooks into the global tracing layer so you don't need to thread callbacks through every component.

Use PageIndexTracer when calling PageIndex directly (not as a LangChain tool). It captures tree structure metadata unavailable from the LangChain tool output.

Use PageIndexMCPObserver when an LLM agent calls PageIndex via MCP. The observer post-processes the tool call record from A1 or A2 handlers to add pageindex.* attributes.

See Also