Migrate with an AI coding tool
Install Bento’s Agent Skills so your AI coding tool knows how to do the migration. Copy this prompt into Claude Code, Cursor, Codex, OpenCode, or Windsurf:The three paths
Pick the smoothest path that applies and fall through to the next. Most migrations land on Path B for the bulk and Path C for a handful of bespoke decorators. If your app runs Google ADK agents, take Path A: three lines at startup. If your call sites uselangfuse.openai, langfuse.langchain, or Anthropic through an instrumentor, take Path B: drop one import and register one instrumentor. For bespoke @observe, start_as_current_observation, or custom spans, Path C renames them call site by call site.
Path A: Google ADK integration
If your app runs Google ADK agents, this captures every model call, tool call, and agent step automatically.Path B: Auto-capture with OpenInference
Replace Langfuse’sfrom langfuse.openai import OpenAI (and the langfuse.langchain.CallbackHandler) with an OpenInference instrumentor registered against a BentoLabsSpanProcessor. Your call sites stay untouched, since Bento captures every LLM call at the SDK level.
from langfuse.openai import OpenAI for the stock import. The instrumentor wraps the client for you:
CallbackHandler and register LangChainInstrumentor() the same way. For Anthropic or Bedrock, install the matching openinference-instrumentation-* and register it.
See OTel transport for the full reference.
Path C: Manual translation
For bespoke@observe() decorators, manual context managers, and identity helpers, translate per the tables.
Setup
Decorators
Multi-step / context managers
Identity
What’s gone
Watch out for
A few renames don’t map one to one. Bento usessession_id everywhere except bento.track_ai, which uses convo_id; it’s the same attribute under the hood. Langfuse metadata becomes properties, a direct rename, but the magic keys like langfuse_user_id don’t exist, so pass the real kwargs instead. And there’s no OpenAI drop-in: reach for Path B (OpenInference) rather than hunting for a from bento.openai import OpenAI equivalent.
Side-by-side
Langfuse
Bento
See also
Configuration
init(), identity getters, env vars.Tracking events
The
bento.track_ai reference.