Skip to main content
Both SDKs are built on OpenTelemetry, so most of your code maps over directly.

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 skill carries the full playbook: it finds your Langfuse call sites, installs Bento alongside, translates each construct, verifies traces land, then removes Langfuse. The rest of this page is the same translation guide, by hand.

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 use langfuse.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.
That’s the whole change. See Integrations for the full reference.

Path B: Auto-capture with OpenInference

Replace Langfuse’s from 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.
Now swap from langfuse.openai import OpenAI for the stock import. The instrumentor wraps the client for you:
For LangChain, drop the 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 uses session_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.